40 years of secret key exchange
by Luca De Feo
Rentrée des Masters Jacques Hadamard
September 89, 2016. Paris Saclay.
The beginnings of public key cryptography
Cryptography, helping lovers since 2000 BC
O Romeo, Romeo! wherefore art thou Romeo? Deny thy father and refuse thy name; Or, if thou wilt not, be but sworn my love, And I’ll no longer be a Capulet.
Confidentiality: Has Tybalt seen the message?
Authenticity: Is the message really from Juliet?
Integrity: Is the message exactly what Juliet meant to send?
…and: Secret sharing, homomorphic encryption, multiparty computation, plausible deniability, anonimity, proofs of knowledge, proofs of work, …
Secret key (symmetric) cryptography
Romeo and Juliet have met in the Capulet’s orchard. Upon falling in love, they have agreed on a secret key S.
It was the nightingale, and not the lark, That pierced the fearful hollow of thine ear; ↓ S Lw#zdv#wkh#qljkwlqjdoh#dqg#qrw#wkh#odun# Wkdw#slhufhg#wkh#ihduixo#kroorz#ri#wklqh#hdu ↓ S^{1} It was the nightingale and not the lark That pierced the fearful hollow of thine ear
 Known since the ancient times;
 Widely used during war times, played a key role in WWII;

The cryptanalytic efforts of WWII gave birth to the modern computer (ever heard of Enigma, Alan Turing, Bletchley Park, Colossus, …)
 With a little care, secret key cryptography achieves confidentiality, authenticity and integrity.
The birth of public key (asymmetric) cryptography
The modern day Romeo and Juliet have only met on Tinder. They want to share their most intimate secrets in a confidential way, but the Internet is fraught with pirates, hackers, governments, and techsavvy Italian moms wanting to spy on their messages.
Can Romeo and Juliet establish a common secret by chatting on a public channel without having ever met before in person?
1976: New directions in cryptography
Our modern day Romeo and Juliet: W. Diffie and M. Hellman
We stand today on the brink of a revolution in cryptography. The development of cheap digital hardware has freed it from the design limitations of mechanical computing and brought the cost of high grade cryptographic devices down to where they can be used in such commercial applications as remote cash dispensers and computer terminals. In turn, such applications create a need for new types of cryptographic systems which minimize the necessity of secure key distribution channels and supply the equivalent of a written signature. At the same time, theoretical developments in information theory and computer science show promise of providing provably secure cryptosystems, changing this ancient art into a science.
The DiffieHellman key exchange protocol (abstract version)
Let be a finite cyclic group, noted multiplicatively, generated by an element .
 is abelian,
 Let be the order of ,
Romeo  Juliet  
Picks at random;  Picks at random;  
Computes ;  Computes ;  
Computes  Computes 
Ok, is a common something. But is it a secret?
Lady Capulet is spying on Romeo and Juliet’s conversation:
 She knows , and ;
 She sees and .
How can she recover ?
Let’s see an example with .
Hard problems
Let be a cyclic group of order .
Discrete logarithm
Let , the discrete logarithm is the unique integer such that .
 Discrete logarithm problem (DLP)
 Given , find .
 Computational DiffieHellman problem (CDH)
 Given , find such that .
Security reductions
Obviously: CDH → DLP (if you can solve DLP, you can solve CDH);
Conjectured: DLP → CDH.
Computational security
We cannot hope discrete logarithm to be unsolvable for any group. But we can hope it to take VERY LOOONG to solve.
Cost of secret generation
Squareandmultiply exponentiation algorithm:
 recursive calls;
 one or two group operations at each call.
Total cost: group operations.
We say that DLP (or CDH) is hard in if no algorithm solves it in polynomial time in .
 DLP is clearly not hard in .
 DLP is at worse exponential in (hint: test all exponents ).
 Advanced algorithms (Baby stepgiant step, Pollard rho) solve DLP in .
 By the Chinese remainder theorem, this can be reduced to , where is the largest prime factor of (PohligHellman).
And if you know a little about complexity theory:
 DLP is in NP.
 If P = NP, then DLP is not hard for any group.
 Since we do not know whether P = NP, we do not know any group with hard DLP.
… But we can still conjecture that DLP is hard for some groups…
The classical DiffieHelman protocol
Let be a prime, the modular integers form a finite field, also written .
Denote by the multiplicative group of units of .
That is all elements of , except , with group operation given by multiplication.
 is cyclic of order ;
 A generator of can be computed easily using Lagrange’s theorem.
If has a large prime factor, the DLP in seems to be hard!
Capulet in the middle
It is easy to prove that if CDH is hard, then the DiffieHellman key exchange is secure against passive adversaries.
However, if Lady Capulet can intercept messages on Tinder and manipulate them…
Romeo  Lady Capulet  Juliet  
Picks at random;  Picks at random;  Picks at random;  
Computes ;  Computes ;  Computes ;  
Computes  Computes  
Computes  Computes  
Public key encryption
Instead of an ephemeral key, Juliet has a long term secret key anyone can use to send her private message.
Public key encryption system
 Key pair
 A pair (public key, secret key),
 is publicly known (published on Juliet’s Tinder profile).
 Encryption algorithm
 Inputs: public key and a message ;
 Output: a cyphertext .
 Decryption algorithm
 Inputs: secret key and a cyphertext ;
 Output: the message .
Security properties:
 Only the owner of can decrypt cyphertexts encrypted with .
 It is easy to derive a key exchange protocol from a PK encryption one.
 The other direction is harder.
First ever encryption protocol: RSA (Rivest, Shamir, Adleman 1977)
 Based on hardness of integer factorization;
 Already known to GCHQ by 1973.
From DiffieHellman to PK encryption: the El Gamal protocol (1985)
Parameters
 Finite field ;
 Generator ;
Keys
 Secret key: random ;
 Public key: ;
Encryption
Input: Public key , a message ;
 Pick random ;
 Compute ;
 Compute (shared secret);
 Compute ;
Output: The cyphertext .
Decryption
Input: Secret key , a cyphertext ;
 Compute (shared secret);
 Compute ;
Output: The message .
CDH hard ⇒ El Gamal is secure
Signatures
But how does Juliet know that the message is really from Romeo?
Public key signature system
 Key pair
 A pair (public key, secret key),
 is publicly known (published on Romeo’s Tinder profile).
 Signature algorithm
 Inputs: secret key and a message ;
 Output: a signature .
 Verification algorithm
 Inputs: public key , a message , a signature ;
 Output: OK if , FAIL otherwise.
Security property:
 Only the owner of can sign messages for .
 Security proofs for signature protocols are usually much more complicated than for encryption protocols. We will not discuss them.
Signatures are hard:
 No automatic way to obtain a signature algorithm from PK encryption;
 RSA signature, introduced together with RSA;
 Signatures from DiffieHellman: Schnorr signature (1988), DSA (1991).
Schnorr signatures
Parameters
 Finite field ;
 Generator ;
 A hash function ;
Keys
 Secret key: random ;
 Public key: ;
Signature
Input: Secret key , a message ;
 Pick random ;
 Compute ;
 Compute ;
 Compute ;
Output: The signature .
Verification
Input: Public key , a message , a signature ;
 Compute ;
 Compute ;
Output: OK if , FAIL otherwise.
Final remarks

A weaker form of signatures gives authentication protocols. These can be combined with key exchange protocols to obtain a key exchange secure in presence of active adversaries.

All along we have assumed that we trust Tinder to correctly present Romeo and Juliet’s public keys. But what if Lady Capulet manipulates Tinder? Distributing public keys in a safe manner requires a trust infrastructure (Public Key Infrastructure (PKI), web of trust, …). This is a complex subject, out of the scope of this course.
Modern day key exchange
Generic attacks on DLP
Let be a cyclic group of order , let be a generator.
DLP: Given , find .
Babystep/giantstep, Pollard Rho
Idea: look for collisions of the form
then .
 Babystep/giantstep: time/memory tradeoff, time and memory;
 Pollard Rho: random walk, based on birthday paradox, time, constant memory.
PohligHellman
Suppose , by the Chinese remainder theorem
 Solve a discrete logarithm in each of (using BSGS, Pollard Rho, …),
 Lift the solution using CRT.
Complexity: , where is the largest factor of .
Subexponential algorithms for finite fields
 polynomial complexity,
 exponential complexity.
Index calculus
 First discovered by Gauss;
 Based on the concept of smooth elements.
Smooth element
We say that an integer is smooth if it is the product of primes .
General index calculus
Input: , Output: .
 Choose a smoothness basis ;
 Choose a field generator ;
Compute the discrete logs base of all elements of :
Collect enough relations of the form
Put them in a matrix, use linear algebra to find each discrete log;
 Rewrite and as products of elements of ;
Output: .
Index calculs variants

Classical: , complexity .

Number Field Sieve: , complexity ; suitable for with prime or a small prime power.

Function Field Sieve: , complexity ; suitable for with a large prime power.

Quasipolynomial (Barbulescu, Gaudry, Joux, Thomé 2011): , complexity , suitable for of very small characteristic.
Secrity levels
It is usually assumed that unfeasible amounts of computation start at elementary operations.
For good measure
 A CPU @1GHz can do elementary ops/sec;
 Amazon EC2 cloud is reported to have delivered (in 2013) approx ops/sec at a rate of $/sec;
 The distributed Bitcoin infrastructure delivers (in 2016) more than ops/sec;
 Exascale computing ( ops/sec) is expected to arrive by 2018.
Security level  Ideal  DLP over  Elliptic curve DLP  NSA recommendation 

80  160  1024  160  
96  192  1536  192  
112  224  2048  224  
128  256  3072  256  SECRET 
192  384  7680  384  TOP SECRET 
256  512  15360  512 
Key lenghts (in bits) for given security level.
Elliptic curves
Projective space
Let be a field, the projective space is the set of all lines in passing through the origin.
Equivalently, it is the set of triples
up to the equivalence relation
Elliptic curves
An elliptic curve over a field (of characteristic ) is the set of projective solutions of an equation
with , with a distinguished point (the point at infinity ).
Group law
The chord and tangent law
Let’s work out some examples
Hasse’s theorem
Theorem
Let be an elliptic curve defined over a finite field , then the number of rational points of is bounded by
Bonus
 All cardinalities in the interval are attained;
 There tend to be more curves toward the middle (see Sato/Tate conjecture).
ECDLP
 Choose with e.g. ;
 Take curves at random;
 Use the SchoofElkiesAtkin point counting algorithm to compute ;
 Stop once you have found a curve with prime order.
Key exchange in a postquantum world
History of computers
Computer science  Physics  

1642  Blaise Pascal’s mechanical calculator  
1687  Isaac Newton’s Philosophiæ Naturalis Principia Mathematica  
1821  André Ampère’s theory of electrodynamics  
1822  Charles Babbage’s difference engine  
1837  Charles Babbage’s analytical engine  
1842  Ada Lovelace writes the first computer program  
1854  Lord Kelvin’s On the Dynamical Theory of Heat  
1871  Maxwell’s and Clausius statistical thermodynamics  
1873  James C. Maxwell’s Treatise on Electricity and Magneitsm  
1900  Max Planck’s black body radiation law  
1905  Albert Einstein’s special relativity  
1911  Niels Bohr’s atomic model  
1912  Henri Poincaré Sur la théorie des quanta  
1916  Albert Einstein’s general relativity  
1926  Erwin Schrödinger’s equation.  
1927  Werner Heisenberg’s uncertainity principle  
1935  EinsteinPodolskyRosen quantum entanglement (spooky action at a distance)  
1939  Konrad Zuse’s electromechanical computers  
1943  Max Newman’s Colossus  
1946  ENIAC  
1947  Transistors  
1952  Integrated circuits  
1964  John S. Bell’s inequalties  
1980  Quantum computing (Yuri Manin, Richard Feynman, …)  
1994  Peter Shor’s factoring algorithm  
2???  First quantum computer 
Quantum computing
Classical computers
 Elementary states (bits): either 0 or 1;
 Elementary transformations (boolean gates): AND, OR, NOT, …;
 Information can be copied at will.
Quantum computers
 Quantum states (qubits): a mix of 0 and 1;
 Elementary transformations (quantum gates), reversible: Hadamard, CNOT, Pauli X, Y and Z, CNOT, Toffoli, Fredkin, …;
 Quantum information collapses to a classical state when read;
 Nocloning theorem: information cannot be copied at will.
Quantum cats
Qubit
Mathematically

Just an element of .

Usually represented on a basis :
where .

When observed (measured), we only obtain a pure state , or (with probabilities and , resp.).
Phisically
 an atom with two possible energy states and ,
 a photon with two possible polarizations,
 …
Entanglement
Two or more qubits can become entangled, also called a superposition state.
Mathematically

Qubits exists as tensor products of states, rather than as cartesian products,

e.g., the possible states for two qubits are
where .

The dimension of the state space grows exponentially with the number of qubits!

Measuring collapses the state onto a classical one.
Spooky action at a distance (EPR)
 Entanglement can be carried over long distances;
 Tested experimentally over hundreds of km;
 …very hard to maintain for a long time even locally, though.
Quantum circuits
Quantum gates
 Unitary matrices acting over the state space.
 Reversible, because physics is (at small scale, at least).
 Small set of elementary gates (similar to AND, OR, …).
Quantum circuits
 Networks of elementary quantum gates;
 Reversible: no measuring happens before the very end.
The most dangerous quantum circuit ever
Quantum Fourier transform (QFT)
 Computes a Fourier transform of a quantum state,
 Circuit size polynomial in the number of qubits → logarithmic in the size of the state space.
Peter Shor’s periodfinding algorithm
 Finds the period of a function , in quantum steps;
 Immediate application to DLP;
 Classical reduction from Integer factoring.
RSA is dead. DiffieHellman is dead
Or is it?
Postquantum cryptography
Slides at http://defeo.lu/talks/yacc270912.pdf
References

W. Diffie, M. Hellman, New Directions in Cryptography. IEEE transactions on Information Theory, 1976.

R.L. Rivest, A. Shamir, L. Adleman, A method for obtaining digital signatures and publickey cryptosystems Communications of the ACM, 1978.

T. El Gamal, A public key cryptosystem and a signature scheme based on discrete logarithms. Advances in cryptology, 1984.

C.P. Schnorr, Efficient signature generation by smart cards. Journal of cryptology, 1991.

A. Joux, Algorithmic cryptanalysis. CRC Press, 2009.

R. Barbulescu, P. Gaudry, A. Joux, E. Thomé, A heuristic quasipolynomial algorithm for discrete logarithm in finite fields of small characteristic. EuroCrypt, 2014.

S. Galbraith, Mathematics of Public Key Cryptography. Cambridge University Press, 2012.

M.A. Nielsen, I.L. Chuang, Quantum Computation and Quantum Information. 10th Anniversary Edition. Cambridge University Press, 2011.

A. Rostovtsev, A. Stolbunov, PublicKey Cryptosystem Based on Isogenies. IACR Cryptology ePrint Archive, 2006.

D. Jao, L. De Feo, Towards quantumresistant cryptosystems from supersingular elliptic curve isogenies International Workshop on PostQuantum Cryptography, 2011.

L. De Feo, D. Jao, J. Plût, Towards quantumresistant cryptosystems from supersingular elliptic curve isogenies. Journal of Mathematical Cryptology, 2014.