Goppa Mceliece
Goppa Mceliece
SURFACE
Syracuse University Honors Program Capstone Syracuse University Honors Program Capstone
Projects Projects
Spring 5-1-2015
Recommended Citation
Valentijn, Ashley, "Goppa Codes and Their Use in the McEliece Cryptosystems" (2015). Syracuse
University Honors Program Capstone Projects. 845.
https://surface.syr.edu/honors_capstone/845
This Honors Capstone Project is brought to you for free and open access by the Syracuse University Honors Program
Capstone Projects at SURFACE. It has been accepted for inclusion in Syracuse University Honors Program Capstone
Projects by an authorized administrator of SURFACE. For more information, please contact [email protected].
Goppa Codes and Their Use In The McEliece Cryptosystem
Ashley Valentijn
Candidate for Bachelor of
Science
and Renée Crown University Honors
May 2015
Date:
Abstract
We explore the topic of Goppa codes and how they are used in the McEliece
Cryptosystem. We first cover basic terminology that is needed to understand the rest of the
paper. Then we explore the definition and limitations of a Goppa code along with how such
Cryptosystem in particular and explain how the security of this method works.
2
Executive Summary
Efficient and secure methods of communication have been in use since before the
peak of the Roman Empire. A cryptosystem is a method of secure data transmission such
that no one other than the intended receiver can read the original message. The problems
that are usually faced with these methods vary, but include potential interception during
transmission, errors, and whether or not a method is even practical to use. Errors can be
detected and corrected by error-correcting codes such as Goppa codes, which are the
original codes used in the McEliece cryptosystem. This paper explains Goppa codes and
how they are used in the original McEliece cryptosystem, and investigates the security of
the cryptosystem.
Sometimes a sent message and the received message are not the same. This is
mainly due to the occurrence of errors. Errors can be caused by random noise over a
code are used to detect or correct errors in a message. This is done by adding redundancy,
that is, extra information that makes the message easier to understand if an error were to
occur, in the message. For example, the message “I am going to bring my gloves” is sent, but
hairbrush.” The receiver may not understand that the message has an error in it and also
has no idea what the original message was supposed to be. Now suppose the message had
been given some added redundancy so that it read, “Because it is snowing heavily outside, I
am going to bring my gloves.” Because of this added redundancy, the receiver could
3
correctly deduce that there was an error in the received message and that the sender had
meant to say he or she was going to bring some sort of warm clothing to ward off the cold.
However, errors are not always added by accident. Errors can also be purposefully
algorithm, these errors can then be reversed. Adding an error vector further scrambles a
message and as a result, can make the cryptosystem even more secure.
which is when a series of numbers increases towards a certain number and upon reaching
said number, starts back over at 0 again. A real-life example of modular arithmetic is using
a 24-hour clock versus a 12-hour clock to tell time. A 24-hour clock represents the hour in
modulo 24 whereas the 12-hour clock represents the hour in modulo 12. For example, 3:00
A.M. is the same in a 12-hour clock and a 24-hour clock. However, 15:00 P.M. in a 24-hour
clock is actually 3:00 P.M. in a 12-hour clock because the clock “wraps back around” so that
any hour above 12, in this case 15, is reduced so that 15 − 12 =3.
method, and a decryption method. Suppose two friends, Alice and Bob, wish to securely
communicate with each other, but know that a third party named Eve could potentially
eavesdrop on them. Let us assume Alice wishes to send a message to Bob. Alice then uses a
key to encrypt her message, known as plaintext, before sending it to Bob. Once Bob
receives the encrypted plaintext, known as ciphertext, he can use the key to decrypt and
discover the original message. We always assume Eve knows the general method that is
being used, but not the key that is used. Eve usually has one of the following intentions:
4
read the message, uncover the key and use it to read all messages encrypted by said key,
alter Alice’s message, and/or pretend to be Alice and exchange messages with Bob.
The McEliece cryptosystem is a Public Key Cryptosystem, which means that it uses a
public key and a private key in order to encrypt and decrypt a message. In our example,
Bob publishes his public key so that anyone can read it. Alice uses Bob’s public key in order
to encrypt a message and send it to Bob. Bob then uses his private key in order to decrypt
the message. However this is only useful if Eve cannot decode a message just by knowing a
public key. Instead, Eve would need to know the private key, which is only known to the
Specifically, in the McEliece Cryptosystem, Bob would construct his public key by
selecting a Goppa polynomial 𝑔𝑔(𝑧𝑧) of degree 𝑡𝑡 and compute the generator matrix 𝐺𝐺 of the
Goppa code. Bob would then choose a random invertible matrix 𝑆𝑆 and a random
permutation matrix 𝑃𝑃 and use them to compute 𝐺𝐺′ = 𝑆𝑆𝑆𝑆𝑆𝑆. Bob would then publish his
public key that consists of (𝐺𝐺′, 𝑡𝑡). His private key, which he would not publish, would
Alice would first write her message and represent it in binary strings of bits and
then she would encrypt every string. Then she would choose a random error vector with
weight of 𝑡𝑡 or less, add it to the encryption, and then send the final encryption so that the
Bob would then use his matrix 𝑃𝑃 to compute 𝑦𝑦 ′ = 𝑦𝑦𝑃𝑃−1 . Then, Bob would use the
decoding algorithm for his Goppa code 𝐺𝐺 to error correct 𝑦𝑦′ into the codeword 𝑚𝑚′ = 𝑚𝑚𝑚𝑚 by
5
finding 𝑒𝑒′. And because he already knows 𝑆𝑆 −1 , he can calculate the original message 𝑚𝑚 =
𝑚𝑚′ 𝑆𝑆 −1 .
Eve would have a difficult time trying to decrypt Alice’s message without the private
key. This is because she would need to separate matrix 𝐺𝐺 from matrix 𝐺𝐺′. And because the
matrix 𝐺𝐺′ is not invertible, Eve would need to know the inverse of the chosen random
matrix 𝑆𝑆, which was not published. Eve also does not know what the matrix 𝑃𝑃 is and so
cannot find 𝑦𝑦’ in order to find 𝑚𝑚′. Basically, in order to keep this cryptosystem secure, it
needs to be very laborious to decode 𝑦𝑦′ and find 𝑚𝑚′. In order to do this, the Goppa code is
published in 1978, McEliece suggested the use of a [1024, 524] Goppa code, i.e. a Goppa
code of length 1024 and dimension 524. This Goppa code can correct for up to 50 errors.
However, this is a major issue because the larger the code is, the less practical it is to use
the cryptosystem. But as technology advances and memory capacity increases, this
Another disadvantage of this system is that using the same encryption matrix 𝐺𝐺′ to
send the same message several times will make the system more vulnerable to attack. Also,
there is no explicit way to use this cryptosystem for signatures, such as in the Rivest-
Shamir-Adleman cryptosystem (RSA). This means that unless there was a password that
was previously determined by the two friends, Bob has no idea whether or not Alice sent
the message because anyone can use his public key to send him a message.
6
On the other hand, the advantages of this system are that the system is one of the
more simple cryptosystems available and it has been widely studied since its introduction
in 1978. Also, using this system allows for high encryption and decryption speeds.
7
Table of Contents
1.1 Cryptology 11
1.3 Fields 13
1.5 Binary 16
2.2 Parameters 21
2.5 Encoding 23
2.8 Decoding 30
8
Part III: The McEliece Cryptosystem 31
3.1 Overview 31
3.2 Example 32
3.3 Attacking 35
3.4 Security 37
References 39
9
10
Part I: Basic Terminology
1.1 Cryptology
Cryptology is the age-old study of how to send and receive messages without any
Let us consider two friends Alice and Bob. They wish to securely communicate with
each other, but know a third party named Eve could potentially eavesdrop on them. Let us
say Alice wants to send a message to Bob. Using a method, or cryptosystem, that was
previously agreed upon between the two friends, Alice encrypts her message, also called
the plaintext, into a series of codewords, which is referred to as the ciphertext. Usually, we
assume Eve knows which cipher or cryptosystem is used and so the only thing keeping the
message secure is the specific key or keys that are used in the encoding and decoding
processes. Once Bob receives the codewords, he uses the key to decrypt the codewords
back into Alice’s original message. Eve usually has one of the following goals: read the
message, discover the key and so read all messages encrypted with said key, alter Alice’s
message in such a way that Bob still thinks the message is from Alice, pretend to be Alice
and exchange messages with Bob even though Bob believes he is talking to Eve and not
Alice.
necessarily the same as the method used to decode a message. One example of this is the
11
cryptosystems are based on a public key and a private key. Bob publishes his public key so
that anyone, Alice and Eve included, can read it. Alice then uses the public key in order to
encode the message and sends it to Bob, who then uses his private key to decode the
message. The method used, however, is such that Eve cannot decode the message just by
knowing the public key. The private key is what is needed in order to decode a message,
and as the receiver of the ciphertext, Bob is the only one who knows the private key.
Bob has received a message from Alice; however, the message does not make any
sense. What happened? Well, either this was a crude attempt at misdirection from Eve or
something happened during the transmission of the message that altered it. Errors can
come from random noise over a channel, nearby channels, the fading of a channel, physical
Error correcting codes (ECC) are codes that can be used to detect errors in a sent
message and correct them. This is done by adding redundancy, that is, extra information
that makes the message easier to understand if an error were to occur, to the message. In
coding theory, redundancy can also be called parity or parity check. This is called encoding.
Once a message is encoded, it becomes a codeword that contains both the message and
redundancy. These codes have specific decoding algorithms that can correct up to a specific
amount of errors. Once this decoding algorithm is applied, some of the errors that may
have occurred during the transmission of the message can be corrected, and the original
12
Another way to use error-correcting codes is to purposefully add error to a message
such that the received ciphertext is 𝑦𝑦 = 𝑐𝑐 + 𝑒𝑒, where 𝑐𝑐 is the codeword and 𝑒𝑒 is an error
vector with a weight less than or equal to some fixed number 𝑟𝑟. This is helpful because Eve
would have a hard time retrieving the codeword from the received ciphertext.
1.3 Fields
Definition 1.3.1 A 𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓 𝐹𝐹 is defined as a set of elements that is closed under two
1. 𝑇𝑇ℎ𝑒𝑒𝑒𝑒𝑒𝑒 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑎𝑎𝑎𝑎 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑎𝑎 ∈ 𝐹𝐹 𝑠𝑠𝑠𝑠𝑠𝑠ℎ 𝑡𝑡ℎ𝑎𝑎𝑎𝑎, 𝑓𝑓𝑓𝑓𝑓𝑓 𝑎𝑎𝑎𝑎𝑎𝑎 𝑥𝑥 ∈ 𝐹𝐹, 𝑥𝑥 + 𝑎𝑎 = 𝑥𝑥.
2. 𝑇𝑇ℎ𝑒𝑒𝑒𝑒𝑒𝑒 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑎𝑎𝑎𝑎 𝑒𝑒𝑙𝑙𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑏𝑏 ∈ 𝐹𝐹 𝑠𝑠𝑠𝑠𝑠𝑠ℎ 𝑡𝑡ℎ𝑎𝑎𝑎𝑎, 𝑓𝑓𝑓𝑓𝑓𝑓 𝑎𝑎𝑎𝑎𝑎𝑎 𝑥𝑥 ∈ 𝐹𝐹, 𝑥𝑥𝑥𝑥 = 𝑥𝑥.
3. 𝑥𝑥 + 𝑦𝑦 = 𝑦𝑦 + 𝑥𝑥
4. 𝑥𝑥𝑥𝑥 = 𝑦𝑦𝑦𝑦
6. (𝑥𝑥𝑥𝑥)𝑧𝑧 = 𝑥𝑥(𝑦𝑦𝑦𝑦)
8. 𝐹𝐹𝐹𝐹𝐹𝐹 𝑒𝑒𝑒𝑒𝑒𝑒ℎ 𝑥𝑥, 𝑡𝑡ℎ𝑒𝑒𝑒𝑒𝑒𝑒 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑎𝑎𝑎𝑎 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 − 𝑥𝑥 𝑠𝑠𝑠𝑠𝑠𝑠ℎ 𝑡𝑡ℎ𝑎𝑎𝑎𝑎 𝑥𝑥 + (−𝑥𝑥) = 𝑎𝑎.
9. 𝐹𝐹𝐹𝐹𝐹𝐹 𝑒𝑒𝑒𝑒𝑒𝑒ℎ 𝑥𝑥 ≠ 𝑎𝑎, 𝑡𝑡ℎ𝑒𝑒𝑒𝑒𝑒𝑒 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑎𝑎𝑎𝑎 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑥𝑥 −1 𝑠𝑠𝑠𝑠𝑠𝑠ℎ 𝑡𝑡ℎ𝑎𝑎𝑎𝑎 𝑥𝑥𝑥𝑥 −1 = 𝑏𝑏.
13
Example 1.3.1. The integers, written ℤ ≔ {… − 3, −2, −1, 0, 1, 2, 3, … }, are not a field under
(+,∗). This is because other than the integers 1, −1, and 0, the integers do not have
𝑎𝑎
Example 1.3.2 The set of rational numbers ℚ ≔ �𝑏𝑏 𝑠𝑠𝑠𝑠𝑠𝑠ℎ 𝑡𝑡ℎ𝑎𝑎𝑎𝑎 𝑎𝑎, 𝑏𝑏 ∈ ℤ 𝑎𝑎𝑎𝑎𝑎𝑎 𝑏𝑏 ≠ 0� is a field
closed under (+,∙) and as such, upholds the previous nine rules.
0 0
1. 𝑦𝑦 = 𝑧𝑧 𝑓𝑓𝑓𝑓𝑓𝑓 𝑎𝑎𝑎𝑎𝑎𝑎 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑧𝑧 ≠ 0 𝑠𝑠𝑠𝑠 𝑡𝑡ℎ𝑎𝑎𝑎𝑎 𝑧𝑧 + 𝑥𝑥 = 𝑥𝑥.
1 1
2. 𝑦𝑦 = 1 𝑠𝑠𝑠𝑠𝑠𝑠ℎ 𝑡𝑡ℎ𝑎𝑎𝑎𝑎 1 ∙ 𝑥𝑥 = 𝑥𝑥.
𝑎𝑎 𝑐𝑐 𝑐𝑐 𝑎𝑎
3. 𝑏𝑏
+ 𝑑𝑑 = 𝑑𝑑 + 𝑏𝑏
𝑎𝑎 𝑐𝑐 𝑐𝑐 𝑎𝑎
4. ∙ = 𝑑𝑑 ∙ 𝑏𝑏
𝑏𝑏 𝑑𝑑
𝑎𝑎 𝑐𝑐 𝑒𝑒 𝑎𝑎 𝑐𝑐 𝑒𝑒
5. �𝑏𝑏 + 𝑑𝑑� + 𝑓𝑓 = 𝑏𝑏 + �𝑑𝑑 + 𝑓𝑓�
𝑎𝑎 𝑐𝑐 𝑒𝑒 𝑎𝑎 𝑐𝑐 𝑒𝑒
6. �𝑏𝑏 ∙ 𝑑𝑑� ∙ 𝑓𝑓 = 𝑏𝑏 ∙ �𝑑𝑑 ∙ 𝑓𝑓�
𝑎𝑎 𝑐𝑐 𝑒𝑒 𝑎𝑎 𝑐𝑐 𝑎𝑎 𝑒𝑒
7. 𝑏𝑏
∙ �𝑑𝑑 + 𝑓𝑓� = 𝑏𝑏 ∙ 𝑑𝑑 + 𝑏𝑏 ∙ 𝑓𝑓
𝑎𝑎 −𝑎𝑎 𝑎𝑎
8. 𝐹𝐹𝐹𝐹𝐹𝐹 𝑒𝑒𝑒𝑒𝑒𝑒ℎ 𝑏𝑏 ∈ ℚ , 𝑜𝑜𝑜𝑜𝑜𝑜 ℎ𝑎𝑎𝑎𝑎 𝑏𝑏
+ 𝑏𝑏 = 0.
𝑎𝑎 𝑏𝑏 𝑎𝑎 𝑏𝑏
9. 𝐹𝐹𝐹𝐹𝐹𝐹 𝑒𝑒𝑒𝑒𝑒𝑒ℎ 𝑏𝑏 ∈ ℚ, 𝑤𝑤𝑤𝑤𝑤𝑤ℎ 𝑎𝑎 ≠ 0, 𝑡𝑡ℎ𝑒𝑒 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒 𝑎𝑎
𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 𝑏𝑏
∙ �𝑎𝑎� = 1.
Definition 1.3.2 A field with a finite number of elements is called a 𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓 𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓, or a
𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺𝐺 𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓. A Galois field is written as 𝐺𝐺𝐺𝐺 (𝑞𝑞) with 𝑞𝑞 being the order of a field.
Theorem 1.3.1 Let 𝑝𝑝 be prime. For every power 𝑝𝑝𝑚𝑚 , there exists a unique finite field with
the order 𝑝𝑝𝑚𝑚 and these are the only possible finite fields.
14
Proof
Definition 1.3.3 Let 𝑝𝑝 be a prime number, 𝑘𝑘 > 0, and 𝑘𝑘 ∈ ℤ. The Galois field of order 𝑞𝑞 =
𝑝𝑝𝑘𝑘 , that is, the amount of elements in the field, is called the extension Galois field of 𝐺𝐺𝐺𝐺(𝑝𝑝) of
Definition 1.3.4 A polynomial over 𝐺𝐺𝐺𝐺(𝑝𝑝𝑚𝑚 ) is called irreducible if it is not divisible by any
Example 1.3.3 Take 1 + 𝑋𝑋 + 𝑋𝑋 3 over 𝐺𝐺𝐺𝐺(2). Any polynomial with a degree less that 3
𝑋𝑋+𝑋𝑋 5
= 1 + 𝑋𝑋 4 .
𝑋𝑋
Definition 1.3.5 Suppose we have an irreducible polynomial 𝑓𝑓(𝑥𝑥) with degree 𝑚𝑚 over
𝑋𝑋 3 )(𝑋𝑋 3 + 𝑋𝑋 2 + 1). It can be checked that 𝑓𝑓(𝑥𝑥) does not divide 𝑋𝑋 𝑣𝑣 such that 𝑣𝑣 < 7.
15
1.4 Modular Arithmetic
Definition 1.4.1 For a positive integer 𝑛𝑛, integers 𝑎𝑎 and 𝑏𝑏 are said to be
𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚 𝑛𝑛, written 𝑎𝑎 ≡ 𝑏𝑏 (𝑚𝑚𝑚𝑚𝑚𝑚 𝑛𝑛) if and only if 𝑎𝑎 − 𝑏𝑏 = 𝑘𝑘𝑘𝑘 for some integer 𝑘𝑘.
5 divides 49-b such that the answer is an integer. According to definition, we need to
find a k such that 49 − 𝑏𝑏 = 5𝑘𝑘. But simply finding 5𝑘𝑘 is enough. Some multiples would be
45, 40, and 35, which would lead to 𝑏𝑏 = 4,9, and 14 respectively.
Ideally, we want a 𝑏𝑏 such that 0 ≤ 𝑏𝑏 < 5. Such a 𝑏𝑏 is called the smallest possible
Example 1.4.2 Write 81 ≡ 𝑏𝑏(𝑚𝑚𝑚𝑚𝑚𝑚 2) such that 𝑏𝑏 is the smallest possible non-negative
residue.
81 − 𝑏𝑏 = 2𝑘𝑘
81 − 𝑏𝑏 = 2(40)
𝑏𝑏 = 1
Example 1.4.3 𝐺𝐺𝐺𝐺(2) = ℤ2 = {0,1}=the integers modulo 2. This is also known as the
binary field.
1.5 Binary
16
For many situations involving computers, it has become accepted practice to
convert information into a string of 1s and 0s. This conversion is referred to as writing
information in binary. Usually, we think of numbers in base 10. For example, 321 = 3 ∗
102 + 2 ∗ 101 + 1 ∗ 100 . However, binary is written in base 2. This means numbers are
converted by writing the number in additive terms of powers of 2, with the coefficients
being either 0 or 1.Then, by taking the coefficients and putting them in order, we have a
binary representation of the number. For example the number 37 can be written as 1 ∗
binary.
Only the integers 0 and 1 are used in binary form and they have the additive
100101+100101=1001010.
defined to have a specific length. Using our previous example, 100101 is a 6-bit number.
Definition 1.6.1 Let 𝐴𝐴 be an alphabet and let 𝐴𝐴𝑛𝑛 : ={all sequences of length 𝑛𝑛 of elements in
𝐴𝐴}. A code 𝐶𝐶 of length 𝑛𝑛 is a nonempty subset of 𝐴𝐴𝑛𝑛 . An element in this subset, written as
𝑐𝑐 = (𝑐𝑐1 , 𝑐𝑐2 , … , 𝑐𝑐𝑛𝑛 ), is called a code vector, legal codeword, or just a codeword. An illegal
17
Throughout this paper, we will assume alphabet 𝐴𝐴 will consist of the binary bits 0
and 1. In other words, the alphabet is the field ℤ2 = {0,1}=the integers modulo 2. A code
Example 1.6.1 Suppose we determine that all codewords of length 3 are only legal if they
are even when added together and illegal if they are odd. Thus, the code vector (1,0,1) = 0
each other as possible. Otherwise, a simple error could turn one codeword into another.
This is typically done by spacing out the illegal codewords among the legal codewords. By
doing this, we further the Hamming distance between two legal codewords.
Definition 1.6.2 A Hamming distance is the distance between two codewords 𝑐𝑐𝑖𝑖 and 𝑐𝑐𝑗𝑗 in a
message 𝑚𝑚. This is measured by counting the amount of differing bits in the two
codewords.
Example 1.6.1 Suppose 𝑐𝑐𝑖𝑖 = (0,0,0) and 𝑐𝑐𝑗𝑗 = (1, 1, 1). The Hamming distance between
Definition 1.6.3 The smallest Hamming distance, denoted 𝑑𝑑(𝐶𝐶), between two legal
codewords 𝑐𝑐𝑖𝑖 and 𝑐𝑐𝑗𝑗 in the code 𝐶𝐶 is called the minimum Hamming distance of 𝐶𝐶. This
Definition 1.6.4 For a codeword 𝑐𝑐𝑖𝑖 , the Hamming weight, denoted 𝑤𝑤𝑤𝑤(𝑐𝑐𝑖𝑖 ), is the number of
nonzero places in 𝑐𝑐𝑖𝑖 . For a binary codeword, this would be the number of ones in the
codeword.
18
Example 1.6.2 Let 𝑐𝑐 = (1,0,1). The Hamming weight of this number would therefore be
two.
Definition 1.7.1 A linear code of dimension 𝑘𝑘 and length 𝑛𝑛 over a field 𝐹𝐹 is a 𝑘𝑘-dimensional
subspace of the vector space 𝐹𝐹 𝑛𝑛 , a set of 𝑛𝑛-dimensional vectors and can be referred to as an
[𝑛𝑛, 𝑘𝑘] code. If the minimum Hamming distance of the code is 𝑑𝑑, then the code is called a
For our use, a linear code is a binary code of length 𝑛𝑛 and dimension 𝑘𝑘, a set of 2𝑘𝑘
binary 𝑛𝑛-tuples, i.e. the codewords, such that a sum of two codewords is always another
codeword.
19
Part II: Goppa Codes
2.1 Definition
A Goppa code is a linear, error-correcting code that can be used to encrypt and
Definition 2.1.1 Let a Goppa polynomial be defined as a polynomial over 𝐺𝐺𝐺𝐺(𝑝𝑝𝑚𝑚 ), that is,
𝑡𝑡
𝑖𝑖=0
with each 𝑔𝑔𝑖𝑖 ∈ 𝐺𝐺𝐺𝐺(𝑝𝑝𝑚𝑚 ). Let 𝐿𝐿 be a finite subset of the extension field 𝐺𝐺𝐺𝐺(𝑝𝑝𝑚𝑚 ), 𝑝𝑝 being a
such that 𝑔𝑔(𝛼𝛼𝑖𝑖 ) ≠ 0 for all αi ∈ L. Given a codeword vector 𝑐𝑐 = (𝑐𝑐1 , … , 𝑐𝑐𝑛𝑛 ) over 𝐺𝐺𝐺𝐺(𝑞𝑞), we
𝑐𝑐
𝑅𝑅𝑐𝑐 (𝑧𝑧) = ∑𝑛𝑛𝑖𝑖=1 𝑥𝑥−𝛼𝛼
𝑖𝑖
,
𝑖𝑖
1 1
where 𝑥𝑥−𝛼𝛼𝑖𝑖
is the unique polynomial with (𝑥𝑥 − 𝛼𝛼𝑖𝑖 ) ∗ 𝑥𝑥−𝛼𝛼 ≡ 1 �𝑚𝑚𝑚𝑚𝑚𝑚 𝑔𝑔(𝑥𝑥)� with a degree
𝑖𝑖
less than or equal to 𝑡𝑡 − 1. Then, a Goppa code Γ�𝐿𝐿, 𝑔𝑔(𝑥𝑥)� is made up of all code vectors
𝑐𝑐 such that 𝑅𝑅𝑐𝑐 (𝑥𝑥) ≡ 0 �𝑚𝑚𝑚𝑚𝑚𝑚 𝑔𝑔(𝑥𝑥)�. This means that the polynomial 𝑔𝑔(𝑥𝑥) divides 𝑅𝑅𝑐𝑐 (𝑥𝑥).
20
2.2 Parameters
Recall that Goppa codes are linear codes. As such, we can use the notation [𝑛𝑛, 𝑘𝑘, 𝑑𝑑] to
describe a Goppa code with the parameters of length 𝑛𝑛, dimension 𝑘𝑘, and minimum
Hamming distance 𝑑𝑑. The length 𝑛𝑛 depends solely on the subset 𝐿𝐿.
Theorem 2.2.1 The dimension 𝑘𝑘 of a Goppa code Γ�𝐿𝐿, 𝑔𝑔(𝑥𝑥)� of length 𝑛𝑛 is greater than or
Theorem 2.2.2 The minimum distance 𝑑𝑑 of a Goppa code Γ�𝐿𝐿, 𝑔𝑔(𝑥𝑥)� of length 𝑛𝑛 is greater
Proof
Please refer to Jochemsz [E] for the proof of the above theorems.
A binary Goppa code is when Γ�𝐿𝐿, 𝑔𝑔(𝑥𝑥)� uses a polynomial 𝑔𝑔(𝑥𝑥) over 𝐺𝐺𝐺𝐺(2𝑚𝑚 ) of
degree 𝑡𝑡. For this paper, we want to particularly emphasize irreducible binary Goppa codes.
irreducible Goppa polynomial. This is because the generating polynomial of such a code
Theorem 2.3.1 An irreducible, binary Goppa code Γ�𝐿𝐿, 𝑔𝑔(𝑥𝑥)� has a minimum distance 𝑑𝑑 of
21
Proof
Please refer to section 2.2 in Engelbert, Overbeck, and Schmidt [C] for this proof.
Q.E.D.
Therefore, the parameters for an irreducible, binary Goppa code would be [𝑛𝑛, ≥ 𝑛𝑛 −
For the rest of this paper, the reader should assume that by Goppa code, we mean a
The parity check matrix of a Goppa code is used in order to decode a message.
Definition 2.4.1 A parity check matrix of a Goppa code is defined to be a matrix 𝐻𝐻 such that
𝐻𝐻𝑐𝑐 𝑇𝑇 = 0 for all code vectors 𝑐𝑐 in 𝐺𝐺𝐺𝐺(2𝑚𝑚 ) that satisfy the Goppa code requirement.
𝑔𝑔𝑡𝑡 0 0 ⋯ 0 1 1 ⋯ 1
𝛼𝛼 𝛼𝛼2 ⋯ 𝛼𝛼𝑛𝑛
𝑋𝑋 = �𝑔𝑔𝑡𝑡−1 𝑔𝑔𝑡𝑡 0 ⋯ 0 � , 𝑌𝑌 = � 1 �, and 𝑍𝑍 =
⋮ ⋮ ⋮ ⋱ ⋮ ⋮ ⋮ ⋱ ⋮
𝑔𝑔1 𝑔𝑔2 𝑔𝑔3 ⋯ 𝑔𝑔𝑡𝑡 𝑡𝑡−1
𝛼𝛼1 𝛼𝛼2𝑡𝑡−1 ⋯ 𝛼𝛼𝑛𝑛𝑡𝑡−1
1
𝑔𝑔(𝛼𝛼1 )
0 ⋯ 0
⎛ 1 ⋮ ⎞
0 ⋱
⎜ 𝑔𝑔(𝛼𝛼2 ) 0 ⎟ , then matrix 𝐻𝐻 is a parity check matrix for a Goppa code Γ(𝐿𝐿, 𝑔𝑔(𝑥𝑥)).
⎜⋮ ⋮ ⋱ ⎟
1
⎝0 ⋯ 0 𝑔𝑔(𝛼𝛼𝑛𝑛 )⎠
22
Since 𝑔𝑔(𝑥𝑥) is irreducible, there exists a primitive element 𝛼𝛼 for all 𝛼𝛼 ∈ 𝐺𝐺𝐺𝐺(2𝑚𝑚 ) such
that 𝑔𝑔(𝛼𝛼) ≠ 0 . And so the subset 𝐿𝐿 can contain all elements of 𝐺𝐺𝐺𝐺(2𝑚𝑚 ).
𝑗𝑗
𝑔𝑔(𝑥𝑥)−𝑔𝑔(𝛼𝛼𝑖𝑖 ) 𝑥𝑥 𝑖𝑖 −𝛼𝛼𝑖𝑖 𝑗𝑗−1−𝑤𝑤
Notice that = ∑𝑡𝑡𝑗𝑗=0 𝑔𝑔𝑗𝑗 ∙ = ∑𝑡𝑡−1 𝑤𝑤 𝑡𝑡
𝑤𝑤=0 𝑥𝑥 ∑𝑗𝑗=𝑤𝑤+1 𝑔𝑔𝑗𝑗 𝛼𝛼𝑖𝑖 , 𝑓𝑓𝑓𝑓𝑓𝑓 𝑎𝑎𝑎𝑎𝑎𝑎 1 ≤ 𝑖𝑖 <
𝑥𝑥−𝛼𝛼𝑖𝑖 𝑥𝑥−𝛼𝛼𝑖𝑖
1
𝑗𝑗−1−𝑤𝑤
𝑛𝑛 + 1. An arbitrary vector 𝑐𝑐 ∈ Γ(𝐿𝐿, 𝑔𝑔(𝑥𝑥)) if and only if ∑𝑛𝑛𝑖𝑖=1(𝑔𝑔(𝛼𝛼 ) ∑𝑡𝑡𝑤𝑤+1 𝑔𝑔𝑗𝑗 𝛼𝛼𝑖𝑖 ) ∙ 𝑐𝑐𝑖𝑖 =
𝑖𝑖
0, for all 𝑤𝑤 = 0, … , 𝑡𝑡 − 1 .
𝛼𝛼 𝛼𝛼2 ⋯ 𝛼𝛼𝑛𝑛 ⎛ 1 ⋮ ⎞
0 ⋱
�𝑔𝑔𝑡𝑡−1 𝑔𝑔𝑡𝑡 0 ⋯ 0 � , 𝑌𝑌 = � 1 ⋱ �, and 𝑍𝑍 = ⎜ 𝑔𝑔(𝛼𝛼2 ) 0 ⎟ .
⋮ ⋮ ⋮ ⋱ ⋮ ⋮ ⋮ ⋮ ⎜⋮ ⋮ ⋱ ⎟
𝑔𝑔1 𝑔𝑔2 𝑔𝑔3 ⋯ 𝑔𝑔𝑡𝑡 𝛼𝛼1𝑡𝑡−1 𝛼𝛼2𝑡𝑡−1 ⋯ 𝛼𝛼𝑛𝑛𝑡𝑡−1 1
⎝0 ⋯ 0 𝑔𝑔(𝛼𝛼𝑛𝑛 )⎠
Therefore, we have that any codeword 𝑐𝑐 ∈ Γ(𝐿𝐿, 𝑔𝑔(𝑧𝑧)) if and only if 𝐻𝐻𝑐𝑐 𝑇𝑇 = 0.
Q.E.D.
2.5 Encoding
The encoding of a Goppa code involves multiplying the message by the generator
Definition 2.5.1 The generator matrix of a Goppa Code is defined to be the 𝑘𝑘 × 𝑛𝑛 matrix
𝐺𝐺 such that the rows of 𝐺𝐺 for the basis of the Goppa code Γ�𝐿𝐿, 𝑔𝑔(𝑥𝑥)�.
Proposition 2.5.1 Any 𝑛𝑛 × 𝑘𝑘 matrix G with rank 𝑘𝑘, such that 𝐺𝐺𝐻𝐻 𝑇𝑇 = 0, is a generator
matrix.
23
Proof
Q.E.D.
In order to send a message using Goppa codes, the message is first written in blocks
of 𝑘𝑘 symbols. Then, each block is multiplied by the generator matrix 𝐺𝐺. The resulting
vectors are a set of codewords. An example of one block being encoded follows:
degree 4. First, we find a primitive element 𝛼𝛼. We can factor 𝑋𝑋15 − 1 (𝑚𝑚𝑚𝑚𝑚𝑚 2) into
irreducible factors.
We will leave the actual calculations for the above equation to the reader.
If we let 𝑘𝑘(𝑋𝑋) = 𝑋𝑋 4 + 𝑋𝑋 + 1, then 𝛼𝛼, a root of 𝑘𝑘(𝑋𝑋), is a primitive element if and only
if the order of 𝛼𝛼 is 15. Because 𝛼𝛼 ≠ 1 and the order of an element must divide the order of
actually a cyclic subgroup generated by 𝛼𝛼, that is, < 𝛼𝛼 >, and so
24
𝐺𝐺𝐺𝐺(24 ) = 𝐺𝐺𝐺𝐺(24 ) ∪ {0} = {0,1, 𝛼𝛼, 𝛼𝛼 2 , 𝛼𝛼 3 , … , 𝛼𝛼14 }.
As a result, we can write the elements of 𝐺𝐺𝐺𝐺(24 ) as the powers of 𝛼𝛼, plus the
element 0,much like how we write binary form. Again, we use the fact that 𝛼𝛼 4 = 𝛼𝛼 + 1.
0 = 0 ∙ 1 + 0 ∙ 𝛼𝛼 + 0 ∙ 𝛼𝛼 2 + 0 ∙ 𝛼𝛼 3 = (0,0,0,0)𝑇𝑇
1 = 1 ∙ 1 + 0 ∙ 𝛼𝛼 + 0 ∙ 𝛼𝛼 2 + 0 ∙ 𝛼𝛼 3 = (1,0,0,0)𝑇𝑇
𝛼𝛼 = 0 ∙ 1 + 1 ∙ 𝛼𝛼 + 0 ∙ 𝛼𝛼 2 + 0 ∙ 𝛼𝛼 3 = (0,1,0,0)𝑇𝑇
𝛼𝛼 2 = 0 ∙ 1 + 0 ∙ 𝛼𝛼 + 1 ∙ 𝛼𝛼 2 + 0 ∙ 𝛼𝛼 3 = (0,0,1,0)𝑇𝑇
𝛼𝛼 3 = 0 ∙ 1 + 0 ∙ 𝛼𝛼 + 0 ∙ 𝛼𝛼 2 + 1 ∙ 𝛼𝛼 3 = (0,0,0,1)𝑇𝑇
𝛼𝛼 4 = 1 ∙ 1 + 1 ∙ 𝛼𝛼 + 0 ∙ 𝛼𝛼 2 + 0 ∙ 𝛼𝛼 3 = (1,1,0,0)𝑇𝑇
𝛼𝛼 5 = 0 ∙ 1 + 1 ∙ 𝛼𝛼 + 1 ∙ 𝛼𝛼 2 + 0 ∙ 𝛼𝛼 3 = (0,1,1,0)𝑇𝑇
𝛼𝛼 6 = 0 ∙ 1 + 0 ∙ 𝛼𝛼 + 1 ∙ 𝛼𝛼 2 + 1 ∙ 𝛼𝛼 3 = (0,0,1,1)𝑇𝑇
𝛼𝛼 7 = 1 ∙ 1 + 1 ∙ 𝛼𝛼 + 0 ∙ 𝛼𝛼 2 + 1 ∙ 𝛼𝛼 3 = (1,1,0,1)𝑇𝑇
𝛼𝛼 8 = 1 ∙ 1 + 0 ∙ 𝛼𝛼 + 1 ∙ 𝛼𝛼 2 + 0 ∙ 𝛼𝛼 3 = (1,0,1,0)𝑇𝑇
𝛼𝛼 9 = 0 ∙ 1 + 1 ∙ 𝛼𝛼 + 0 ∙ 𝛼𝛼 2 + 1 ∙ 𝛼𝛼 3 = (0,1,0,1)𝑇𝑇
𝛼𝛼 10 = 1 ∙ 1 + 1 ∙ 𝛼𝛼 + 1 ∙ 𝛼𝛼 2 + 0 ∙ 𝛼𝛼 3 = (1,1,1,0)𝑇𝑇
𝛼𝛼 11 = 0 ∙ 1 + 1 ∙ 𝛼𝛼 + 1 ∙ 𝛼𝛼 2 + 1 ∙ 𝛼𝛼 3 = (0,1,1,1)𝑇𝑇
𝛼𝛼 12 = 1 ∙ 1 + 1 ∙ 𝛼𝛼 + 1 ∙ 𝛼𝛼 2 + 1 ∙ 𝛼𝛼 3 = (1,1,1,1)𝑇𝑇
𝛼𝛼 13 = 1 ∙ 1 + 0 ∙ 𝛼𝛼 + 1 ∙ 𝛼𝛼 2 + 1 ∙ 𝛼𝛼 3 = (1,0,1,1)𝑇𝑇
25
𝛼𝛼 14 = 1 ∙ 1 + 0 ∙ 𝛼𝛼 + 0 ∙ 𝛼𝛼 2 + 1 ∙ 𝛼𝛼 3 = (1,0,0,1)𝑇𝑇
Consider the following Goppa code over subset 𝐿𝐿 = {𝛼𝛼 𝑖𝑖 𝑠𝑠𝑠𝑠𝑠𝑠ℎ 𝑡𝑡ℎ𝑎𝑎𝑎𝑎 2 ≤ 𝑖𝑖 ≤ 13} with
𝑔𝑔(𝑥𝑥) = 𝑥𝑥 2 + 𝑥𝑥 + 𝛼𝛼 3 .
Note that this code is irreducible over 𝐺𝐺𝐺𝐺(24 ). Therefore, this code has the
To find the parity check matrix H, we can use Proposition 2.4.1 by assigning 𝑔𝑔1 =
1
𝛼𝛼7 , 𝑔𝑔2 = 1, 𝑎𝑎𝑎𝑎𝑎𝑎 𝛼𝛼1 = 𝛼𝛼 2 , 𝛼𝛼2 = 𝛼𝛼 3 , … , 𝛼𝛼12 = 𝛼𝛼13 . We can then calculate the factors 𝑔𝑔(𝛼𝛼 ) for
𝑖𝑖
𝑖𝑖 = 1, … , 12.
1 1 1
= 2 2 = 4 = [(1,1,0,0)𝑇𝑇 + (0,0,1,0)𝑇𝑇 + (0,0,0,1)𝑇𝑇 ]−1
𝑔𝑔(𝛼𝛼1 ) (𝛼𝛼 ) + 𝑥𝑥 + 𝛼𝛼 3 𝛼𝛼 + 𝛼𝛼 2 + 𝛼𝛼 3
1 1 1
= 3 2 = 6 = [(0,0,1,1)𝑇𝑇 + (0,0,0,1)𝑇𝑇 + (0,0,0,1)𝑇𝑇 ]−1
𝑔𝑔(𝛼𝛼2 ) (𝛼𝛼 ) + 𝑥𝑥 + 𝛼𝛼 3 𝛼𝛼 + 𝛼𝛼 3 + 𝛼𝛼 3
1 1 1
= 4 2 = = [(1,0,1,0)𝑇𝑇 + (1,1,0,0)𝑇𝑇 + (0,0,0,1)𝑇𝑇 ]−1
𝑔𝑔(𝛼𝛼3 ) (𝛼𝛼 ) + 𝛼𝛼 4 + 𝛼𝛼 3 𝛼𝛼 8 + 𝛼𝛼 4 + 𝛼𝛼 3
1 1 1
= 5 2 = = [(1,1,1,0)𝑇𝑇 + (0,1,1,0)𝑇𝑇 + (0,0,0,1)𝑇𝑇 ]−1
𝑔𝑔(𝛼𝛼4 ) (𝛼𝛼 ) + 𝛼𝛼 5 + 𝛼𝛼 3 𝛼𝛼10 + 𝛼𝛼 5 + 𝛼𝛼 3
26
1 1 1
= 6 2 = 12 = [(1,1,1,1)𝑇𝑇 + (0,0,1,1)𝑇𝑇 + (0,0,0,1)𝑇𝑇 ]−1
𝑔𝑔(𝛼𝛼5 ) (𝛼𝛼 ) + 𝛼𝛼 + 𝛼𝛼
6 3 𝛼𝛼 + 𝛼𝛼 6 + 𝛼𝛼 3
1 1 1
= 7 2 = 14 = [(1,0,0,1)𝑇𝑇 + (1,1,0,1)𝑇𝑇 + (0,0,0,1)𝑇𝑇 ]−1
𝑔𝑔(𝛼𝛼6 ) (𝛼𝛼 ) + 𝛼𝛼 + 𝛼𝛼
7 3 𝛼𝛼 + 𝛼𝛼 7 + 𝛼𝛼 3
1 1 1
= 8 2 = = [(0,1,0,0)𝑇𝑇 + (1,0,1,0)𝑇𝑇 + (0,0,0,1)𝑇𝑇 ]−1
𝑔𝑔(𝛼𝛼7 ) (𝛼𝛼 ) + 𝛼𝛼 + 𝛼𝛼
8 3 𝛼𝛼 + 𝛼𝛼 8 + 𝛼𝛼 3
1 1 1
= 9 2 = 3 = [(0,0,0,1)𝑇𝑇 + (0,1,0,1)𝑇𝑇 + (0,0,0,1)𝑇𝑇 ]−1
𝑔𝑔(𝛼𝛼8 ) (𝛼𝛼 ) + 𝛼𝛼 + 𝛼𝛼
9 3 𝛼𝛼 + 𝛼𝛼 9 + 𝛼𝛼 3
1 1 1
= 10 2 = 5 = [(0,1,1,0)𝑇𝑇 + (1,1,1,0)𝑇𝑇 + (0,0,0,1)𝑇𝑇 ]−1
𝑔𝑔(𝛼𝛼9 ) (𝛼𝛼 ) + 𝛼𝛼 + 𝛼𝛼
10 3 𝛼𝛼 + 𝛼𝛼10 + 𝛼𝛼 3
1 1 1
= 11 2 = 7 = [(1,1,0,1)𝑇𝑇 + (0,1,1,1)𝑇𝑇 + (0,0,0,1)𝑇𝑇 ]−1
𝑔𝑔(𝛼𝛼10 ) (𝛼𝛼 ) + 𝛼𝛼 + 𝛼𝛼
11 3 𝛼𝛼 + 𝛼𝛼11 + 𝛼𝛼 3
1 1 1
= 12 2 = 9 = [(0,1,0,1)𝑇𝑇 + (1,1,1,1)𝑇𝑇 + (0,0,0,1)𝑇𝑇 ]−1
𝑔𝑔(𝛼𝛼11 ) (𝛼𝛼 ) + 𝛼𝛼 + 𝛼𝛼
12 3 𝛼𝛼 + 𝛼𝛼12 + 𝛼𝛼 3
1 1 1
= 13 2 = 11 = [(0,1,1,1)𝑇𝑇 + (1,0,1,1)𝑇𝑇 + (0,0,0,1)𝑇𝑇 ]−1
𝑔𝑔(𝛼𝛼12 ) (𝛼𝛼 ) + 𝛼𝛼 + 𝛼𝛼
13 3 𝛼𝛼 + 𝛼𝛼13 + 𝛼𝛼 3
27
We can then compute 𝑋𝑋𝑋𝑋𝑋𝑋 = 𝐻𝐻.
0 0 1 0 1 0 0 0 0 0 0 1
0 1 1 1 0 0 0 0 1 0 0 0
⎛ ⎞
0 0 0 0 1 1 0 1 0 1 1 1
⎜ 0 0 1 1 ⎟
1 0
= ⎜1 1 0 0 0 0⎟.
⎜1 1 1 1 0 0 1 0 1 1 1 1⎟
⎜0 0 1 0 0 0 0 0 1 1 1 0⎟
0 1 0 0 0 0 0 1 0 1 0 1
⎝0 1 1 1 1 0 1 1 1 0 0 1⎠
Recall that 𝐺𝐺𝐻𝐻 𝑇𝑇 = 0. Therefore, we can compute the rows of 𝐺𝐺 to be the vectors of
0 1 1 0 1 0 1 0 0 1 0 0
0 1 1 1 1 0 0 1 1 0 0 0
the nullspace of 𝐻𝐻 𝑚𝑚𝑚𝑚𝑚𝑚 2. And so 𝐺𝐺 = � �. Since the
1 1 0 1 1 0 0 0 0 0 0 1
1 1 1 0 1 1 0 1 0 0 1 0
dimensions of this matrix is 4 × 12, we can conclude that the dimension of Γ(𝐿𝐿, 𝑔𝑔(𝑥𝑥)) is 4.
where there are 𝑟𝑟 places where 𝑒𝑒𝑖𝑖 ≠ 0. In order to correct the codeword back into the
original codeword, we must first find the error vector. As such, we need to find the set of
28
error locations, 𝐸𝐸 = { 𝑖𝑖 𝑠𝑠𝑠𝑠𝑠𝑠ℎ 𝑡𝑡ℎ𝑎𝑎𝑎𝑎 𝑒𝑒𝑖𝑖 ≠ 0}, and the corresponding error values 𝑒𝑒𝑖𝑖 for all 𝑖𝑖 ∈
𝐸𝐸.
Since we are using binary Goppa codes, it is sufficient to simply locate the errors since
there is only one other possible element. If we were to use regular Goppa codes, we would
In order to error correct a codeword, we must apply Patterson’s algorithm [H]. His
algorithm for correcting 𝑟𝑟 ≤ 𝑡𝑡 errors for 𝑔𝑔(𝑥𝑥) irreducible over 𝐺𝐺𝐺𝐺(2𝑚𝑚 ) is as follows:
a. Find ℎ(𝑥𝑥) such that 𝑠𝑠(𝑥𝑥)ℎ(𝑥𝑥) ≡ 1 �𝑚𝑚𝑚𝑚𝑚𝑚 𝑔𝑔(𝑥𝑥)�. If ℎ(𝑥𝑥) = 𝑥𝑥, then we are
c. Find 𝑎𝑎(𝑥𝑥) and 𝑏𝑏(𝑥𝑥), with 𝑏𝑏(𝑥𝑥) of least degree, such that 𝑑𝑑(𝑥𝑥)𝑏𝑏(𝑥𝑥) ≡
𝑎𝑎(𝑥𝑥)�𝑚𝑚𝑚𝑚𝑚𝑚 𝑔𝑔(𝑥𝑥)�.
3. Use 𝜎𝜎(𝑥𝑥) to determine the set of error locations 𝐸𝐸 = { 𝑖𝑖 𝑠𝑠𝑠𝑠𝑠𝑠ℎ 𝑡𝑡ℎ𝑎𝑎𝑎𝑎 𝜎𝜎(𝛼𝛼𝑖𝑖 ) = 0}.
4. Define the error vector 𝑒𝑒 = (𝑒𝑒1 , … , 𝑒𝑒𝑛𝑛 ) by 𝑒𝑒𝑖𝑖 = 1 for 𝑖𝑖 ∈ 𝐸𝐸 and 𝑒𝑒𝑖𝑖 = 0 elsewhere.
29
2.8 Decoding
Once all possible errors in a codeword are corrected, the receiver can easily recover
the original message. Recall that (𝑚𝑚1 , 𝑚𝑚2 , … , 𝑚𝑚𝑘𝑘 ) ∗ 𝐺𝐺 = (𝑐𝑐1 , … , 𝑐𝑐𝑛𝑛 ). Think of this function as
a map from 𝐹𝐹 𝑘𝑘 → 𝐹𝐹 𝑛𝑛 such that 𝑚𝑚 → 𝑚𝑚𝑚𝑚. Since 𝑚𝑚𝑘𝑘 has rank k and G has rank k and 𝐹𝐹 𝑛𝑛 has
rank 𝑛𝑛, this map from 𝐹𝐹 𝑘𝑘 → 𝐹𝐹 𝑛𝑛 is injective. Therefore, we can rearrange the equation
𝑚𝑚1 𝑐𝑐1
𝑚𝑚 𝑐𝑐
(𝑚𝑚1 , 𝑚𝑚2 , … , 𝑚𝑚𝑘𝑘 ) ∗ 𝐺𝐺 = (𝑐𝑐1 , … , 𝑐𝑐𝑛𝑛 ) so that 𝐺𝐺 𝑇𝑇 ∙ � ⋮ 2 � = � ⋮2 �.
𝑚𝑚𝑘𝑘 𝑐𝑐𝑛𝑛
This is simply a system of 𝑛𝑛 equations with 𝑘𝑘 unknowns, which we can use row reduction
to solve,
1 0 ⋯ 0 𝑚𝑚1
𝑐𝑐1 0 1 ⋯ 0 𝑚𝑚2
⎛ ⎞
⋮ ⋮ ⋱ ⋮ ⋮
�𝐺𝐺 𝑇𝑇 � ⋮ � ~ ⋯ ~ ⎜ ,
𝑐𝑐𝑛𝑛 ⎜0 0 ⋯ 1 𝑚𝑚𝑘𝑘 ⎟
⎟
−−−−−−−
⎝ 𝑋𝑋 ⎠
3.1 Overview
The McEliece Cryptosystem is a type of Public Key cryptosystem that uses a linear,
error-correcting code in order to create a public key and a private key. The original error-
correcting code used in this cryptosystem is the binary Goppa code. A public key, as one
would assume, is public; anyone and everyone can find it. The public key is based on the
30
private key, but in such a way that makes it unfeasible to recover the private key. In order
to do this, the private key is only held by the receiver of the message. Traditionally, we use
Suppose Alice wants to send a private message to Bob. Bob must first publish his
public key, which is based on his private key. Then, Alice takes Bob’s public key and
encrypts her message with it. The message then becomes a codeword. She sends her
encrypted message to Bob. Bob then uses his private key to decrypt the codeword and read
the message.
In order to construct the public and private keys, Bob must first choose an arbitrary
Goppa polynomial 𝑔𝑔(𝑧𝑧) with a degree 𝑡𝑡 over 𝐺𝐺𝐺𝐺 (2𝑚𝑚 ). The Goppa code defined by this
polynomial and by 𝐿𝐿 has parameters [𝑛𝑛, ≥ 𝑛𝑛 − 𝑚𝑚𝑚𝑚, ≥ 2𝑡𝑡 + 1]. Using this, Bob would then
compute the 𝑘𝑘 𝑥𝑥 𝑛𝑛 generator matrix 𝐺𝐺 of the Goppa code. Then, Bob randomly chooses a
𝑘𝑘 𝑥𝑥 𝑘𝑘 invertible matrix 𝑆𝑆 and a 𝑛𝑛 𝑥𝑥 𝑛𝑛 permutation matrix 𝑃𝑃, which means that 𝑃𝑃 has exactly
one 1 in every row and column, with all other entries being zero. Then he computes 𝐺𝐺 ′ =
𝑆𝑆𝑆𝑆𝑆𝑆. 𝐺𝐺′ is his encoding matrix. This results in his public key consisting of 𝐺𝐺′ and 𝑡𝑡 only.
The private key consists of the polynomial 𝑔𝑔(𝑧𝑧), the original matrix 𝐺𝐺, along with
Once Bob publishes his public key, Alice generates a random binary vector 𝑒𝑒 of
length 𝑘𝑘 that has a weight 𝑤𝑤𝑡𝑡(𝑒𝑒) ≤ 𝑡𝑡. Then, Alice can encode her message 𝑚𝑚 =
(𝑚𝑚1 , 𝑚𝑚2 , … , 𝑚𝑚𝑘𝑘 ) by computing 𝑦𝑦 = 𝑚𝑚𝑚𝑚′ + 𝑒𝑒. Then, Alice sends her ciphertext 𝑦𝑦.
Bob receives Alice’s codeword and uses his permutation matrix 𝑃𝑃 to compute
31
𝑦𝑦′ = 𝑦𝑦𝑃𝑃−1 = 𝑚𝑚𝐺𝐺 ′ 𝑃𝑃−1 + 𝑒𝑒𝑃𝑃−1 = 𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑃𝑃−1 + 𝑒𝑒 ′ = (𝑚𝑚𝑚𝑚)𝐺𝐺 + 𝑒𝑒′.
Bob can then decode 𝑦𝑦′ into the message 𝑚𝑚′ = 𝑚𝑚𝑚𝑚 by finding 𝑒𝑒 ′ , which is done by Bob
applying Patterson’s algorithm. Once this is done, Bob can is calculate 𝑦𝑦 − 𝑒𝑒′=𝑚𝑚𝑚𝑚𝑚𝑚 and
since Bob knows what 𝑆𝑆 is, he can calculate 𝑆𝑆 −1 , and then recover the original message 𝑚𝑚 =
𝑚𝑚′ 𝑆𝑆 −1 .
3.2 Example
We will use the same Goppa code from our previous examples. Recall our generator
matrix
0 1 1 0 1 0 1 0 0 1 0 0
0 1 1 1 1 0 0 1 1 0 0 0
𝐺𝐺 = � �.
1 1 0 1 1 0 0 0 0 0 0 1
1 1 1 0 1 1 0 1 0 0 1 0
Now we need to choose our random matrices 𝑆𝑆 and 𝑃𝑃 and modify matrix 𝐺𝐺. 𝐺𝐺 is
1 0 0 1
0 1 0 1
𝑆𝑆 = � �,
0 1 0 0
0 0 1 1
32
1 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0
⎛ ⎞
0 0 0 0 0 0 0 0 1 0 0 0
⎜ ⎟
⎜0 0 0 0 0 1 0 0 0 0 0 0⎟
⎜0 0 0 0 1 0 0 0 0 0 0 0⎟
𝑃𝑃 = ⎜0 1 0 0 0 0 0 0 0 0 0 0 ⎟.
⎜0 0 0 1 0 0 0 0 0 0 0 0⎟
⎜0 0 0 0 0 0 0 0 0 0 0 1⎟
⎜0 0 0 0 0 0 0 1 0 0 0 0⎟
⎜0 0 0 0 0 0 0 0 0 1 0 0⎟
0 0 0 0 0 0 0 0 0 0 1 0
⎝0 0 0 0 0 0 1 0 0 0 0 0⎠
Using these matrices, we compute the public encryption matrix 𝐺𝐺′ such that
1 1 0 1 0 0 0 0 0 1 1 1
1 1 0 0 0 1 0 1 0 0 1 0
𝐺𝐺′ = 𝑆𝑆𝑆𝑆𝑆𝑆 = � �.
0 0 1 0 1 1 0 1 1 0 0 1
0 1 0 0 0 1 1 0 1 0 1 1
Bob then publishes this matrix 𝐺𝐺′ along with 𝑡𝑡 = 2. Notice that anyone can encrypt a
message with this information. But let us suppose Alice wants to send a message 𝑚𝑚 =
(1,0,1,0).
𝑚𝑚𝐺𝐺 ′ = (1,1,1,1,1,1,0,1,1,1,1,0),
𝑦𝑦 = 𝑚𝑚𝐺𝐺 ′ + 𝑒𝑒 = (0,0,1,1,1,1,0,1,1,1,1,0).
This results in the ciphertext that Alice then sends to Bob. Bob then wants to retrieve the
original message 𝑚𝑚 from the ciphertext 𝑦𝑦. In order to do so, he first computes 𝑦𝑦𝑃𝑃−1 by
33
= 𝑚𝑚(𝑆𝑆𝑆𝑆𝑆𝑆)𝑃𝑃−1 + 𝑒𝑒 ′
= (𝑚𝑚𝑚𝑚)𝐺𝐺 + 𝑒𝑒 ′
1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 0
⎛0 1 0 0 0 0 0 0 0 0 0 0⎞
⎜ ⎟
0 0 0 0 0 0 1 0 0 0 0 0
⎜ ⎟
⎜0 0 0 0 1 0 0 0 0 0 0 0⎟
0 0 0 1 0 0 0 0 0 0 0 0⎟
= (0,0,1,1,1,1,0,1,1,1,1,0) ∙ ⎜
⎜0 0 0 0 0 0 0 0 0 0 0 1⎟
⎜0 0 0 0 0 0 0 0 1 0 0 0⎟
⎜0 0 1 0 0 0 0 0 0 0 0 0⎟
⎜0 0 0 0 0 0 0 0 0 1 0 0⎟
0 0 0 0 0 0 0 0 0 0 1 0
⎝0 0 0 0 0 0 0 1 0 0 0 0⎠
= (0,1,1,1,1,0,1,0,1,1,1,0).
With this permutation, the errors have been moved to the first and sixth columns. Bob
𝑚𝑚𝑚𝑚𝑚𝑚 = (1,1,1,1,1,1,1,0,1,1,1,0).
We know from section 2.8 that 𝑚𝑚𝑚𝑚 can be found by row reducing [𝐺𝐺 𝑇𝑇 |(𝑚𝑚𝑚𝑚𝑚𝑚)𝑇𝑇 ]. Thus we
1 1 1 0
0 0 1 0
find 𝑚𝑚𝑚𝑚 = (1,1,0,1). Finally, we compute 𝑚𝑚 = (1,1,0,1) ∙ � � = (1,0,1,0).
0 1 1 1
0 1 1 0
3.3 Attacking
In cryptology, there are various types of attacks. A brute force attack is when the
enemy tries every possible key and determines which key results in a meaningful message.
34
For this attack, the longer the length of a key, the longer it will take to try every possible
key. A direct, or per-message, attack is an attack that tries to decode a given message, but
does not necessarily solve the entire cryptosystem. A structural attack occurs when Eve
would try to recover the structure, or at least part of the structure, of the original message
The most effective attack against the McEliece cryptosystem is an attack called
“information-set decoding.” Many cryptologists have published variants of this attack from
McEliece in his original paper [K] to Stern [M] in his subsequent paper. Most of the variants
Stern’s attack refers to Stern’s method on finding codewords with a low Hamming
weight. In order to do so, we must select an integer 𝑤𝑤 ≥ 0 and a (𝑛𝑛 − 𝑘𝑘) × 𝑛𝑛 parity check
matrix 𝐾𝐾 for an [𝑛𝑛, 𝑘𝑘] code over the binary field. Our goal is to find a solution to the
equation 𝐾𝐾𝐾𝐾 = 0 with the weight |𝑧𝑧| = 𝑤𝑤. Then we complete the following steps:
out of the remaining columns of 𝐾𝐾 such that each column is chosen due to
3. Partition the leftover columns into two subsets 𝑋𝑋 and 𝑌𝑌. Each column is
1
added to either 𝑋𝑋 or 𝑌𝑌 with the probability of 2
.
35
4. Search for codewords with exactly 𝑝𝑝 nonzero bits in 𝑋𝑋, exactly 𝑝𝑝 nonzero bits
in 𝑌𝑌, no nonzero bits in 𝑍𝑍, and exactly 𝑤𝑤 − 2𝑝𝑝 nonzero bits in the remaining
matrix 𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚 2 for each row 𝑙𝑙 in order to compute the 𝑙𝑙-bit vector
c. Find all pairs 𝐴𝐴, 𝐵𝐵 such that 𝜋𝜋(𝐴𝐴) = 𝜋𝜋(𝐵𝐵). For every such pair,
compute the sum of all members of 𝐴𝐴 ∪ 𝐵𝐵. Said sum is a (𝑛𝑛 − 𝑘𝑘)-bit
vector. If the vector does not have a weight of 𝑤𝑤 − 2𝑝𝑝, then the attack
has failed. If the vector does have a weight of 𝑤𝑤 − 2𝑝𝑝, then the
columns, together with 𝐴𝐴 and 𝐵𝐵, form a codeword with weight 𝑤𝑤. If
there are no such codewords, the attack fails and Stern starts over
Say we have a code 𝐶𝐶 over the binary field. Let 𝑦𝑦 have a distance 𝑤𝑤 from a codeword 𝑐𝑐 ∈
𝐶𝐶, then 𝑦𝑦 − 𝑐𝑐 is a element with a weight w of the code 𝐶𝐶 + {0, 𝑦𝑦}. Eve knows the McEliece
public key 𝐺𝐺 ′ , 𝑡𝑡. thus, Eve can add y to the list of generators in order to form a generator
matrix 𝐶𝐶 + {0, 𝑦𝑦}. Note that the only codeword with weight 𝑡𝑡 is 𝑦𝑦 − 𝑐𝑐, which is precisely the
codeword we found with Stern’s attack. Therefore, Eve can use this codeword to find 𝑐𝑐 and
36
In the paper by Bernstein, Lange, and Peters [C], they present an improved attack
based on Stern’s method. They prove that their attack is more effective than any previous
attack. They demonstrated their attack on a [1024, 524] Goppa code and prove that they
can successfully break the code in about 1400 days with the use of a 2.4 GHz Intel Core 2
Quad Q6600 CPU. By using 200 of these computers, their attack takes approximately one
week. They note that the previously most effective attack by Canteaut, Chabaud, [D] and
Sendrier [E] would need 7400000 days on one 433MHz DEC Alpha CPU and would need
3.4 Security
As stated at the beginning of the paper, we assume that Eve knows what
cryptosystem is, one should always assume the enemy knows the method that is being used
The security of this cryptosystem depends on how difficult it is to decode 𝑦𝑦′ in order
to obtain 𝑚𝑚′. Eve will have a hard time trying to separate 𝐺𝐺 from 𝐺𝐺′ because in order to do
so, she would need to know the inverse of matrix 𝑆𝑆, which was not published. Also, Eve
does not know what 𝑃𝑃 is either, which means Eve cannot find 𝑦𝑦′ in order to find 𝑚𝑚′.
Multiplying 𝑆𝑆𝑆𝑆 together scrambles the message into another matrix. Then when we
multiply the result by the permutation matrix 𝑃𝑃, we further scramble the matrix by
randomizing the order of the columns. This is done in order to make the resulting matrix
look random and ensure the difficulty of obtaining the decoding method from the encoding
37
matrix. Because of this scrambling of the matrices, Eve cannot decipher the private key
In order to make this system as secure as possible, the chosen code needs to be very
large in order to successfully hide the Goppa code within the scrambled generator matrix
𝐺𝐺′. This is a major drawback because using a code with such a large key size makes it very
difficult to use this system practically. But as technology continues to advance and the
potential key size increases, this cryptosystem will become more and more useful.
In his original paper on the McEliece cryptosystem [K], McEliece suggested the use
of a [1024, 524] Goppa code. Such a code can correct for up to 50 errors. Ever since this
introduction, there have been a variety of modifications made to the cryptosystem, most of
them using different codes. However, most of these modifications have proved lacking and
Repeatedly sending the same message will also make the cryptosystem more
susceptible to attack. This is because sending the same message twice will generate two
different ciphertext and since the location of the errors are unlikely to be the same, Eve
References
[A] Artin, Michael. Algebra. Englewood Cliffs, NJ: Prentice Hall, 1991. Print.
38
[B] Berlekamp, E. "Goppa Codes." IEEE Transactions on Information Theory 19.5
(1973): 590-92. Web.
[C] Bernstein, Daniel J., Tanja Lange, and Christiane Peters. "Attacking and Defending
the McEliece Cryptosystem." Post-quantum Cryptography: Second International
Workshop, PQCrypto 2008 Cincinnati, OH, USA, October 17-19, 2008 Proceedings.
Ed. Johannes Buchmann and Jintai Ding. Berlin: Springer, 2008. 31-46. Print.
[D] Canteaut, Anne, and Chabaud, Florent. “A New Algorithm for Finding Minimum-
Weight Words In a Linear Code: Application to the McEliece Cryptosystem and to
narrow-sense BCH codes of length 511. IEEE Transactions on Information Theory,
44(1):367-378, 1998. Print.
[E] Canteaut, Anne, and Sendrier Nicolas. “Cryptanalysis of the Original McEliece
Cryptosystem.” Advances in Cryptology—ASIACRYPT ’98, volume 1514 of Lecture
Notes in Computer Science, pages 187-199. Springer, Berlin, 1998.
[F] Engelbert, Daniela, Raphael Overbeck, and Arthur Schmidt. "A summary of McEliece-
type cryptosystems and their security." Journal of Mathematical Cryptology 1, 151–
199. MR 2008h:94056. Print.
[G] Goppa, V. D. Geometry and Codes. Dordrecht: Kluwer Academic, 1988. Print.
[H] Jiang, Yuan. A Practical Guide to Error-Control Coding Using MATLAB. Boston: Artech
House, 2010. Print.
[I] Jochemsz, Ellen. “Goppa Codes & the McEliece Cryptosystem.” Amsterdam: Vrije
Universiteit Amsterdam, 2002. Print.
[J] Lay, David C. Linear Algebra and Its Applications. Boston: Pearson/Addison-Wesley,
2012. Print.
[K] McEliece, R. J. "A Public-Key Cryptosystem Based on Algebraic Coding Theory." Jet
Propulsion Laboratory DSM Progress Report 42-44. N.p., n.d. Web. 12 Jan. 2015.
[M] Stern, Jaques. “A Method For Finding Codewords of Small Weight.” Coding Theory
and Applications, 388: 106-133, 1989.
39
40