README.txt 1.92 KB
Newer Older
Sophie Leuenberger's avatar
Sophie Leuenberger committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Usage of crypto_builder.sage and crypto_builder_me.sage
=======================================================

What is this?
-------------

These two sage scripts can be used to set up a McEliece cryptosystem using alternant codes. The decoder is based on the concept of error-correcting pairs, see
1. Pellikaan, Ruud: On decoding by error location and dependent sets of error positions. 1992.
2. Marquez-Corbella, Irene and Pellikaan, Ruud: Error-correcting pairs for a public-key cryptosystem. 2012.

Requirements
------------

1. SageMath (free open source mathematics software system), <http://www.sagemath.org>


Usage Examples
==============

crypto_builder.sage
-------------------

This script simulates the exchange of a randomly generated secret key.
Parameters:
1. q: Size of finite field
2. m: Degree of extension field
3. n: Lenght of alternant code
4. k: Dimension of underlying GRS-code
5. name: Choose a name for your system. Will create a folder with this name for the private key.

Example:
> sage crypto_builder.sage 31 2 500 100 myTest

This command will generate the following:
* myTest_encrypter.sage: Sage script for encryption.
* myTest.public.sobj: Sage object representing the public key.
* myTest: Folder containing the private key, in particular the sage script decrypter.sage which is used for decryption.
and will output the number [t] of errors which can be added to a codeword.

Encryption:
> sage myTest_encrypter.sage myTest.public [t]
This command will output the encrypted message [m].

Decryption:
> cd myTest
> sage decrypter.sage [m]


crypto_builder_me.sage
----------------------

This script can be used to exchange messages. The usage is similar to the usage of crypto_builder.sage.
Note that the size of the finite field determines the number of characters which can be encrypted.
In order to encrypt all characters of the extended ASCII-table, choose q=271.

Example:
> sage crypto_builder.sage 271 2 500 100 myTest