CRYPTOGRAPHIC ENGINEERING

Academic Year 2023/2024 - Teacher: MARIO DI RAIMONDO

Expected Learning Outcomes

  • Knowledge and understanding: the student will acquire a technical background on some developing tools for Modern Cryptography; it will cover high-level cryptographic solutions but also low-level developing tools in order to be able to implement any kind of cryptographic schemes.
  • Applying knowledge and understanding: the student will learn how to determine the effective security level of a cryptographic solution but also to prevent the use of not-secure approaches in his own code; such goal will be pursued by means of the study of existing applied solutions but by understanding how some notable cryptographic attacks work.
  • Making judgements: the student will learn to judge the goodness of existing cryptographic schemes but also its suitability in a software project making use of it.
  • Communication skills: the student will learn the specific technical micro-language and he will be able to interface with technical documentation but also to communicate with experts in such field.
  • Learning skills: the theoretical background from Cryptography, jointly with the specific practical-technical knowledge acquired in this course, will permit the student to approach the adoption/adaptation/development of any cryptographic scheme in a more complex software project.

Course Structure

In class oral lessons on theoretical arguments and on laboratory-related aspects.

Should teaching be carried out in mixed mode or remotely, it may be necessary to introduce changes with respect to previous statements, in line with the programme planned and outlined in the syllabus.

Required Prerequisites

requirements: knowledge of Cryptographic theory and good programming skills

prerequisite: Cryptography

Attendance of Lessons

Attendance to class is strongly recommended.

Detailed Course Content

This class is intended as the continuance of the theoretical path started with the course “Cryptography” and it can be considered a bridge towards the practice. It covers arguments from the, so called, "Cryptographic Engineering" field: it is fusion of the theoretical and practical knowledges that are necessary to implement cryptographic schemes in a sound, secure and efficient way. The first part of the class covers some basic concepts of theory and the introduction of some efficient algorithms widely used in implementations of multi-precision integers (MPI) arithmetic. Such knowledge is strictly necessary in order to optimize the performances of the cryptographic schemes but also to effectively understand many advanced cryptographic attacks presented during in the course. A second part of the class covers the study of some real-world standards (SSL/TLS, SSH) and to some related advanced cryptographic attacks. A third part goes deep in the implementation details on the topic.

Textbook Information

  • [AvOV] Alfred Menezes, Paul van Oorschot, Scott Vanstone: Handbook of Applied Cryptography
  • [PP] Christof Paar, Jan Pelzl: Understanding Cryptography: A Textbook for Students and Practitioners
  • [S] N.P. Smart: Cryptography Made Simple 

The slides include several references to technical scientific papers.

Course Planning

 SubjectsText References
1richiami: definizioni, nozioni di sicurezza, principali primitivecorso Crittografia, cap.11 di [S]
2richiami: gruppi, campi, gruppi ciclici, sottogruppi, generatori, teorema cinese del restocorso Crittografia, cap.8 di [PP], cap.1-2 di [S]
3richiami: problemi difficili, logaritmo discreto, fattorizzazione, algoritmi di risoluzione corso Crittografia, cap.8 di [PP], cap.2-3 di [S]
4introduzione alle curve ellittichecap.9 di [PP], cap.4 di [S]
5algoritmi per l'esponenziazione nei gruppi ciclici: square-and-multiply, a rango k, sliding windowcap.6 di [S], cap.14.6 di [AvOV]
6algoritmi per l'esponenziazione in casi particolari: moduli compositi, a esponente fisso, a base fissa, esponenziazioni multiplecap.7 di [PP], cap.6 di [S], cap.14.6 di [AvOV]
7algoritmi per l'aritmetica a multi-precisione: addizione, moltiplicazione elementare, quadrato, Karatsuba, Toom-k (accenno), riduzioni e moltiplicazioni di Montgomerycap.6 di [S], cap.14.6 di [AvOV]
8campionamento del tempo ad alta precisione: tempo di cpu, tempo effettivo, fonti di clock, contatore dei cicli della cpu, chiamate di sistema multi-piattaforma, utilizzo di assembly per l'accesso al registro tsc (accenno)slide, articoli
9libreria GMP: caratteristiche, numeri supportati, operazioni di base, input-output, operazioni modulari, ottimizzazioni, studio delle prestazioni, generatori di numeri pseudo-casuali, accesso ai pool di entropia multi-piattaformacap.6 di [S], doc. GMP
10implementazione della cifratura RSA: schema di base, sicurezza, ottimizzazioni, attacchi elementari, attacco basato sul parity oracle, padding PKCS#1 v1.5, attacco basato sul padding oracle (SSL), accenno ad attacco ROBOT, padding EME-OAEP, sicurezza di RSA-OAEPcap.7 di [PP], cap.15-16 di [S], articoli
11implementazione dello scambio di chiavi DH: schema di base, sicurezza, ottimizzazioni, lavorare su un sottogruppo, studio delle prestazionicap.8 di [PP], cap.18 di [S], doc. Nettle, articoli
12implementazione della cifratura Elgamal: schema di base, sicurezza, ottimizzazioni, attacco nel caso in cui si lavori in un sottogruppo, studio delle prestazionicap.8 di [PP], cap.16 di [S], articoli
13funzioni hash e funzioni derivate: costruzioni MAC da hash, PBKDF2, derivare sotto-chiavi, supporto nella libreria Nettle, studio delle prestazionicap.11-12 di [PP], cap.14 di [S], doc.Nettle, articoli
14implementazione della firma RSA: schema di base, sicurezza, ottimizzazioni, padding (PKCS#1 v1.5, EMSA-PSS)cap.10 di [PP], cap.16 di [S], articoli
15implementazione della firma Elgamal e di quella DSA: schemi di base, sicurezza, ottimizzazioni, attacchi notevolicap.10 di [PP], cap.16 di [S], articoli
16modalità di cifratura a blocchi: ECB, CBC, CTR, padding PKCS#7, attacchi elementari, supporto nella libreria Nettle, studio delle prestazionicap.5 di [PP], cap.13 di [S], doc. Nettle
17costruzioni per combinare autenticazione e cifratura: mac-and-encrypt, mac-then-encrypt, encrypt-them-mac, attacco a mac-then-encrypt di Vaudenay basato su oracolo di padding CBC (TLS), attacco a mac-and-encrypt al protocollo SSHcap.13 di [S], articoli
18modalità di cifratura autenticate: CCM, EAX, GCM, supporto nella libreria Nettle, studio delle prestazionidoc. Nettle
19implementazione di schemi su curve ellittiche con pairing: modello, sicurezza, libreria PBC, ottimizzazioni, scelta curve/pairing, implementazione delle firme digitali BLS, studio delle prestazionidoc. PBC, articoli
20implementazione di schemi su curve ellittiche senza pairing: caratteristiche, curve del NIST, curva 25519, supporto nelle librarie PBC e Nettle, implementazione dello scambio di chiavi DH su curve ellittiche, studio delle prestazionicap.8 di [PP], doc. PBC, articoli
21attacchi basati sui side-channel: scenario generale, attacco basato su timing di RSA/DH/DSA di Kocher, attacco su timing di RSA di Schindler, attacco su timing remoto a RSA (OpenSSL) di Brumley-Boneh, attacchi basati sulla compressione dei dati cifrati, attacchi a SSL/TLS CRIME, TIME e BREACHarticoli
22altri attacchi a SSL/TLS: attacco su IV predicibile in CBC-AES, attacco BEASTarticoli

Learning Assessment

Learning Assessment Procedures

The exam involves the assignment of a scientific article in the original language to the student: this article will typically contain the proposal of one or more cryptographic schemes or notable attacks on known schemes.

The student, after examining the article limited to the agreed parts (no demonstrations), must:

  • create an implementation project (using the tools and techniques introduced in class) of some cryptographic schemes (or attacks) contained in the article itself;
  • take an oral interview on the theoretical contents seen in class; the student who sufficiently passes the two (written) tests in progress will be exempted from this interview.

Verification of learning can also be carried out electronically, should the conditions require it.

Examples of frequently asked questions and / or exercises

Examples of assignments for past projects are available upon request to the teacher.