| Contents | Announcements | Exams | Literature | Videos and slides | Course notes and exercise sheets | Old exams |
Tanja Lange
Coding Theory and
Cryptology
Eindhoven Institute for the Protection
of Systems and Information
Department of Mathematics and Computer Science
Room MF 5.062
Technische Universiteit Eindhoven
P.O. Box 513
5600 MB Eindhoven
Netherlands
Phone: +31 (0) 40 247 4764
The easiest ways to reach me wherever I am:
e-mail:tanja@hyperelliptic.org
This page belongs to course 2MBD60 - Introduction to cryptology. This course is offered at TU/e as part of the bachelor's elective package Security and used to be called 2WF80 - Introduction to Cryptology.
Contents
Classical systems (Caesar cipher, Vigenère, Playfair, rotor machines), shift register sequences, DES, RC4, RSA, Diffie-Hellman key exchange, cryptanalysis by using statistics, factorization, attacks on WEP (aircrack).
Some words up front: Crypto is an exciting area of research. Learning
crypto makes you more aware of the limitations of security and privacy
which might make you feel less secure but that's just a more
accurate impression of reality and it a good step to improve your
security.
Here is a nice, though somewhat dated, link collection
of software to help you stay secure
https://prism-break.org/en/
and private
https://www.privacytools.io/.
If you study mathematics, you should have participated in "2MBD20 - Algebraic
Structures"
and "2MBD30 - Applied Number Theory and Algebra".
If you study computer science or any other program you should have
participated in "2DBI00 - Linear Algebra and Applications",
"2IT50 or 2IT80 - Discrete structures", and
"2WF90 - Algebra
for security" before taking this course.
If not you can find some material in the Literature section
but note that you are on your own for learning this.
Lectures take place Mon block 3 and 4
and Thu block 7 and 8.
We have three locations for the instruction sessions (Thu block 5 and 6),
please join the room that's emptier. We might reduce to two rooms if not enough
students show up, but I really recommend doing the instruction sessions and
attending them live if you can fit them in your agenda. They are more important
than the lecture, and thus get the prime spot. We'll have enough instructors in
the rooms so that you can ask your questions and check the answers to your
exercises with them. We will not hand out solutions.
In 2020 and 2021 the course has been
running online with short videos – one video per topic,
so several videos per unit.
This year lectures happen only in person.
The teaching assistants/instructors for this course are the following 7 people.
We will not have a lecture on 6 Jan.
It is not necessary to purchase a book to follow the course.
For some background on algebra see
For easy prototyping of crypto implementations I like the computer
algebra system Sage. It is based on
python and you can use it online or install it on your computer (in a
virtual box in case you're running windows).
I recorded a
video to
demonstrate how to use Sage https://www.sagemath.org/, covering basics of finite fields and
elliptic curves. The latter do not for this course, so watch start till
minute 10:50 and then again for about 2 minutes after 19:30.
I also wrote a short ``cheat sheet'' with commands for Sage,
see here
For encrypting your homeworks you should use GPG/PGP. If you're
running Linux then GNU uPG is easy to install.
GPG4win; if
you're using MAC-OS you can use GPG
Suite (though I'm getting reports that they changed their system and now
charge for the full version, the command-line linux version works for sure).
Thunderbird has good integration and I hear that also outlook can
work well with the plugins.
Please always include all TAs when you send in your homeworks -- and make
sure that you encrypt to all of them and to your team mates. All email
systems that I know of will do this automatically if you have all keys in your
address book and the people in the To or Cc field your email.
The teaching assistants from 2023 wrote
this
guide to homework submission for this course.
If absolutely not possible otherwise, we are OK with having only the attachment being
encrypted and signed, but prefer proper encryption of the whole email. If you
end up going for file encryption only you must ensure that all recipients can
decrypt and you're missing out on the support that the email system offers you.
30% of the grade is determined by homeworks. There will be six
sets of homework during the quarter. You should hand in your homework
in groups of 3 or 4. To make sure that you get used to crypto we require
solutions to be sent encrypted and signed with GPG/PGP. Each participant must
have communicated with the TAs at least once using GPG/PGP.
You will find the keys for the TAs linked above.
If for some reason you need to email me,
you can find my public key for tanja@hyperelliptic.org on the key servers
and on my
homepage.
The exam will take place on 25 January 2027, 13:30 - 16:30,
please double check on the official
TU/e pages before going to the exam.
The retake is likely scheduled for April 7
The exam
accounts for the remaining 70% of the grade.
For 2022 and 2023 the lectures were recorded
and posted at
TU/e's
Yuja site. Search for course code 2WF80 (the old name of this course) to
see the recordings. Mine are the 2022/23 and 2023/24 versions, not the 2018/19
version which for some reason loads with preview. Click on the three vertical
dots on the right end of the course to select "open" and get to the videos.
For the 2020 and 2021 editions of the course I recorded a lot of short videos
which you can find on the YouTube
Channel which are better for self study or if you want a more direct way to
look up a subject.
The
course page for 2021 has short descriptions of all videos, slides,
and no-cookie links to the YouTube videos. Watch them
from there if you're on a low-cookie diet.
This section is extended through the course with notes of what happened in class and links to blackboard pictures. You can also find here the exercise sheets for the sessions on Thursdays.
09 Nov 2026
This lecture was be given by
Silvia
Ritsch.
Silvia presented the requirements that cryptography should achieve, namely to provide
confidentiality, integrity, and authenticity, against attackers that have
access to all messages sent and who may attempt to inject messages or to modify
messages. Then, presented an introduction to public-key cryptography and
signatures and their security properties
Pictures of black boards are here.
Additionally you can also consult the slides for the general
introduction, and the
introduction to public-key
cryptography,
For the security notions Silvia wrote on the board and
showed these
slides as well as the
definition of IND-CPA
and EUF-CMA
12 Nov 2026
Note that we have exercises in block 5 &6, lectures in block 7 & 8.
Here is the exercise sheet for block 5 and 6: exercise-1.pdf. See also the raw data if paste fails.
If you get stuck on the Hill cipher watch the 2021 video on XGCD under
Math
background on the 2021 course page.
For most of the exercises the solution is obvious when you have it. If you're
not sure, please ask the TA in your room to check you solution.
There are many more pages on the web with tools for cryptanalysis of
classical ciphers, e.g.
https://www.guballa.de/vigenere-solver,
https://www.braingle.com/brainteasers/codes/index.php,
http://www.cryptool-online.org,
https://www.boxentriq.com/code-breaking.
sadly one of these doesn't offer https version (kind of hilarious, given the
topic, but then it's about attacks ....)
This lecture was be given by
Silvia
Ritsch.
Silvia covered several examples of historical ciphers using these slides:
We had some rotor machines from the
Cryptomuseum
on show in the MetaForum and maybe might get some again, but for now we don't
have a nice display box.
Check out the extensive website of the Cryptomuseum on crypto machines and spy craft.
As a secure historical example Silvia covered the one-time pad and its practical limitations. You can think of it as Viginiere having the keyword length match the message length, but we also need a random key to get the strong security that is offers (information-theoretic security).
Finally Silvia covered
stream ciphers
as an example of symmetric-key
encryption and as a more practical alternative to one-time pads. All security
concerns of one-time pads apply – never use them twice – and additionally
stream ciphers need to be checked whether they really produce random-looking
streams. Basic essentials to avoid the two-time pad issue is to use an IV
(initialization vector) to make sure that the stream cipher has a fresh
randomized starting point for each message and that the space for the IV is big
enough to avoid repetitions.
We'll cover the more formal statements and some examples of stream ciphers on
Monday.
The first homework is due on 19 November 2026 at 13:30. Here is the first homework sheet.
For submitting your homework you need to
generate a keypair (a private and a public key). As the names suggest you
should keep the private key private and can publish your public key. The latter
is needed to encrypt messages to you and to verify signatures made by you, so
that's what you need to send in along with your homework solution and that's
also what your team mates need from you in order to communicate securely with
you. You can find the keys of the TAs above under Announcements.
Please remember to submit your homework by encrypted, signed email to
all the TAs.
Don't forget to include your public key and those of your team mates.
16 Nov 2026
I've been trying to help people team up in groups for the homework. Please see
the announcement on Canvas and react to it if you're still offering or searching
space. Your group may have 3 or 4 people.
I repeated the basic definitions of stream ciphers and what the notation of
{0,1}^n meant and why the IV matters for security and for practical
applications -- we must avoid reusing keystream and thus would need to maintain
and update a state for each communication partner .... and advance the stream
cipher by as many steps as we had used already if there was no IV.
Then I introduced feedback-shift registers (FSRs), incl. with an example and
we covered some theory on periodic and ultimately-period sequences and showed
that if a sequence repeats every l steps then l is a multiple of the period.
Note that the period the minimal r > 0 with the feature that s_i = s{i+r} for
all i.
(L)FSRs are examples of stream ciphers. The IV is used as the initial state and
the key defines the feedback function. Note that this is very much
simplifying
things and LFSRs alone are really bad stream ciphers as you can recover the
state update from the IV and just n-1 more output bits. However, LFSRs are used
in bigger constructions because we can reason well about the periods they
generate (without having to try everything).
We have seen that depending on the function and the initial state,
the output sequence can have a very short period.
We also established that the all-zero state leads to the all-zero
sequence of period 1 for any LFSR. We covered 2 complete examples for LFSRs with
state-size 3 for all states, one had periods 7 and 1, the other had
4,2,1,1. Note that there are 2^n different states, so the sum needs to match
2^n, so 8 in theses examples.
I also showed how to represent LFSRs as a vector-matrix multiplication, which
defines the state-update matrix C. The order of C is the smallest integer l > 0
so that C^l = I (the n x n identity matrix). I didn't show this yet, but for
LFSRs with c_0 = 1 (which I said we always want to have) the order of C is
defined. We did see that the period divides the order of the state-update
matrix (this was just a few comments after showing these slides which show the
order of the state update matrix of our second example.
The photos of the blackboard are here.
19 Nov 2026
Here is the exercise sheet for block 5 and 6: exercise-2.pdf. You should really try to
solve these exercises and make some conjectures about how orders,
degrees, and periods fit together.
You can call over the TAs for checking and I've put a quiz on Canvas
so that you can check the numbers yourself -- and ask the TAs if you didn't get
the right answer. I do expect that you use a computer for the larger examples.
In class we covered more details on LFSRs.
I showed that the order of the state update matrix is always defined if
c0=1, that the period length,, reached by any starting state, is a divisor of
ord(C),
Then we showed that the order of the state-update matrix equals the longest
period that that LFSR can produce and that it is produced using starting state
S0 of (00....01) (n-1 zeros followed by 1 one).
I showed the definition of the characteristic polynomial and we proved
that the characteristic polynomial equals x^n -
Σcixi.
We also noted some conjectures along the way regarding the orders of C and f(x)
and how they relate to the period lengths, based on what students have found in
the exercise session. Our job now is to figure out what of these is true and
then how to prove them. Once they are proven, you
can use them as facts, so proofs are useful.
I used Rabin's irreducibility test. Note that the second line should have
specified d|n and d< n (I missed the latter and it would contradict the first
line).
You should know that from previous lectures and you should be able to
recognize some irreducible polynomials of small degree namely x, x+1, x^2+x+1,
x^3+x+1, and x^3+x^2+1 as factors of polynomials. I also stated the irreducible
polynomials of degree 4 and that at that degree it is no logger sufficient to
check for roots. We computed the order of an irreducible polynomial of degree 2
and degree 3 by just observing the 2^n-1 is prime and thus is divisible only by
1 and itself; the order cannot be less than the degree, hence it is 2^n-1, i.e.
3 resp. 7. For those of degree 4 we
needed a bit more work, but only needed to check whether it was 5 or not, after
excluding divisors 1 and 3 as being smaller than the degree. In the first case
the degree was not 5 and hence had to be 15 (it needs to divide 2^n-1). In the
second case it was 5.
Note that P(x)=det(xI-C) implies that P(C) = 0, where you take powers of C in
place of powers of C, so C is interchangeable with x modulo P(x) and
C^r = 1 corresponds to x^r =1 mod P(x), i.e. the order of C equals the order of
P(x), which explains why we defined order of P this way. Note that in
the instructions you computed the order of C and the orders of the
factors of P(x), so you didn't always get the same results -- or rather
you only got the same results for the cases that P was irreducible.
Pictures of black boards are here.
The second homework is due on Thursday 26 November 2026 at 13:30. Here is the second homework sheet. Please remember to submit your homework by encrypted, signed email to the TAs. Don't forget to include your public key and those of your team mates.
23 Nov 2026
A primitive polynomial is one of degree n which has order 2^n -1, this is the
maximal order a polynomial of degree n can have.
For primitive polynomials we have periods 2^n-1 and 1, for irreducible but not
primitive we have (2^n-1)/ord(P) disjoint sequences of period ord(P) and one of
period 1.We don't know yet how to handle polynomials that are not irreducible.
On the practical side taking sums of LFSRs can be motivated by asking what we can build from given small hardware components, and in fact many designs are actually built from such pieces, but it is also a useful step in. our quest to understand LFSRs which do not have irreducible LFSRs and we got some ideas – and disproved some.
We defined a few more properties of LFSRs and their characteristic
polynomials so that we had more tools available and could tackle understanding
what is actually going on. The main result of this
lecture is that the characteristic polynomial of the LFSR that one obtains as
the sum of two LFSRs equals the lcm of the characteristic polynomials of the
LFSRs that are added up. We also proved that for an irreducible characteristic
polynomial all non-zero output sequences have the same period length. Both of
these results needed generating functions, which are very useful tools to know
anyways.
See here for the slides
of the sums of polynomials and
here
for the proofs that I showed showed, while I also took notes on the board.
This gave us a different way to define the characteristic polynomial P(x) of a sequence, namely as the polynomial P of degree n so that when one multiplies the generating function by the reciprocal of P(x) one obtains a polynomial of degree less than n.
Generating functions were also helpful to analyze sums of LFSRs. We can now understand all examples from these slides; we normally get a sequence of period the lcm of the periods of the summand sequences, but we also saw that using the same LFSR twice can give period 1 (because they cancel) and is at best as good as just one of them, so not a smart idea to do this, We also had an odd example where we added two sequences and got a period that was shorter than the input. With the proof we now know how to analyze characteristic polynomials that are composite.
Pictures of black boards are here.
26 Nov 2026
Here is the exercise sheet for block 5 and 6: exercise-3.pdf.
I summarized how to approach the analysis of LFSRs based on what we found out over the past two weeks.
LFSRs are used in practice because they are small and efficient, but they
need a non-linear component to be secure. I covered three ciphers from
telecommunication (A5/11, A5/2, and SNOW-3G) which all are based on LFSRs with
some nonlinear components. See the slides
for their definitions and some details.
These ciphers were in every cell phone using GSM 2G and downgrade
attacks were possible for a long time.
It sounds like the 54 bits were
a compromise between countries wanting strong crypto and others wanting
weak crypto. One of the first postings on it
with some details on the history
(note that the original link
does not work now)
an attack idea for A5/1 by Ross Anderson is from 1994, but many
details were missing. The full algorithm descriptions of A5/1 and its
purposefully weakened sibling A5/2 were reverse engineered and
posted in 1999 by
Marc Briceno, Ian Goldberg, and David Wagner. The same group also
showed a devastating attack on A5/2, allowing for real-time decryption.
Sadly enough, the A5 algorithms allow downgrade attacks, so this is a
problem for any phone which has code for it, which is most until
recently. Also A5/1 does not offer 2^54 security (54 bits is the
effective key length) but only 2^24 (with some precomputation/space).
However, A5/2 is broken even worse, in 2^16 computations, with efficient
code online, e.g A5/2 Hack Tool.
On the slides I showed a table regarding the best known attacks on some real-world stream ciphers. That table is from https://eprint.iacr.org/2017/511, a paper my Alex Biryukov and Leo Perrin. They wrote a nice overview of lightweight ciphers, including more modern and less broken ones.
Since then even more details on GSM have come out and in 2021 details of two more GSM ciphers, GEA-1 and GEA-2, were published and analyzed. I mentioned that I wanted to show some more, take a look at page 7 of the scientific publication about the attack. The attack made news in 2021 because many new cell phones were still supporting GEA-1, even though it was "removed" from the standard by ETSI in 2013, and because it was unusually weak: GEA-1 has a 64-bit key but it is designed such that after initialization there are only 2^40 different states (instead of 2^64 that should be possible). The design was not public, but a cursory look would not reveal this property; this strongly looks like a back door. GEA-2 does not have this problem (and so far is not discontinued) but it also offers far less security than it should. It is unclear whether the techniques used in the attack were known in the 1990s.
If this didn't make you sufficiently skeptical of everything ETSI, here is another one that came out this summer (2026) TETRA:BURST against the Terrestrial Trunked Radio (TETRA) standard, a standard by ETSI which is used for radio communication incl. for critical infrastructure and emergency services, and which totally crumbled under analysis. We had Carlos and Wouter give a talk about their work at the 2024 edidiotn of Security in Times of Surveillance.
Further reading on finite fields and the mathematical theory of LFSRs is in Lidl/Niederreiter (see literature section), van Tilborg (see literature section), and David Kohel's lecture notes.
The cipher we analyzed in the exercise session is RC4. Even as recently as 2013
this was the preferred symmetric cipher for https.
(The alternative was a block cipher in CBC mode, which we'll learn about next
week).
I find it quite
surprising that such a widely used cipher exhibits properties we can
find in an exercise session (well, knowing where to look, of course).
Note that
RC4 was a secret design, available only as black box implementation.
Soon after it was leaked as "arcfour" weaknesses were found.
I did the first exercise live and we saw a nice bias at 0. Then we explained
where it came from and did a heuristic analysis explaining why it is about
twice as high as the others.
I also showed a few example for the bias in the 3rd exercise, which is less
easy to see but leaks key information. For the final one I only showed the graph
from the slides. Them I explained why these biases are an issue in practice
(assuming that you're trying to defend security. These biases continue past
the first output byes, see the last pages in
these slides, and more at the
paper linked from there.
Better stream ciphers exist, e.g. the final portfolio from the eSTREAM competition has held up well.
Pictures of black boards are here.
The third homework is due on 03 December 2026 at 13:30. Here is the third homework sheet.
Please remember to submit your homework by encrypted, signed email to
all the 4 TAs (and not to Tanja).
Don't forget to include your public key and those of your team mates.
Do not submit as a singleton or pair, the minimum group size is 3.
This course was given for the first time in Q2 of 2014. Here are my exams so far