Quantum Computers and Quantum Secure Communication
Quantum Computers and Quantum Secure Communication
Description
Johanna Sepúlveda
UNIVERSITY OF SOUTH BRITTANY, France
2013: Post-Doctoral Researcher
Johanna Sepúlveda
Habilitation at TUM
“Secure and Efficient Post-quantum Security”
Walter Gademann Prize for the best Mint Prize for the best Master Thesis 2019
Master Thesis at TUM Post-Quantum
(2018) Q(CaSC) / Johanna Sepúlveda 6
Motivation
FIRST CONTACT
Cryptoanalysis
Side-Channel
Attacker
Quantum
In the future, traditional public key Threat
cryptography
will be broken by large Quantum
computers
Q(CaSC) / Johanna Sepúlveda 10
Motivation
Topics of the Lecture: QKD and PQC
RSA ECC
80
1. Quantum Key Distribution (QKD)
Neutral atoms
60
Quantum Channels
20
Traditional Infrastructure
0
1995 2000 2005 2010 2015 2020 2025
Post-Quantum Security
Integration Process IonQ’s 79 qubits Quantum Processor
Q(CaSC) / Johanna Sepúlveda 13
Motivation
Topics of the Lecture: In a nut shell
Quantum Computer
QKD PQC
Quantum-Key Distribution Post-Quantum Cryptography
Q(CaSC) / Johanna Sepúlveda 14
Motivation
Standardization efforts
Be part of security history
Interesting topic
DESCRIPTION
Learning Objective
At the end of this module, students
1) are able to understand the basic concepts of quantum computers and quantum
secure communication;
Theory
Q(CaSC) / Johanna Sepúlveda 18
Description
Lecture
Physical: At TUM (face to face)
Virtual: Lectures will have a video, so you can attend asynchronous
(look the lecture when you want)
Virtual: Some synchronous session for discussion (scheduled)
Forum (Moodle):
The topic of the
week, share news
Presentation
Live streaming
(Google Hangout)
Reading articles
Using quantum emulators and online tools (e.g., IBM)
Answering questions
Watch additional educational material
* Time distribution of the activities may change according to the topic of the lecture
Q(CaSC) / Johanna Sepúlveda 20
Description
Interactive questions
https://www.menti.com/
Q(CaSC) / Johanna Sepúlveda 21
Description
Contact
Johanna Sepúlveda
Email: [email protected]
(Questions, requests, schedule appointment)
Expected answer from 10 min to 7 hrs
24h/7
Grading (5 credits)
OPTIONAL:
Requirements
Willing to learn
Basic concepts of security
• Symmetric/asymmetric cryptography, hash
Basic concepts on embedded software programming
Basic knowledge of computer architecture
• Components, memory hierarchy, communication
structure
OPTIONAL
Advance knowledge of computer architecture
Optimization techniques for embedded programming
Secure implementation of cryptographic algorithms
References
Online books
• Post-Quantum Cryptography
Daniel Bernstein, Johannes Buchmann, Erik Dahmen
• An Introduction to Mathematical Cryptography
Jeffrey Hoffstein, Jill Pipher, Joseph Silverman, ISBN: 978-1-4939-1711
Videos
NIST (https://csrc.nist.gov/projects/post-quantum-cryptography)
ETSI (https://www.etsi.org/technologies/quantum-key-distribution)
Basic knowledge to prepare for the next lecture (Recommended for the students
that have no heard before quantum computers)
QKD
Quantum-Key Distribution
FAMILIAR
PQC
Quantum Computer Post-Quantum Cryptography
UNDERSTAND (vulnerabilities)
EVALUATE (security and performance)
APPLY (security countermeasures)
5
Q(CaSC) / Johanna Sepúlveda 5
We are Ready to Start..
Quantum
Computers
Basic Principles
Evolution
Structure
Types
Programming
Security threat
THE BEGINNING:
QUANTUM COMPUTER NEED
Computer Organization
Memories
Processor(s)
Communication
Software
structure
(buses, networks)
Interfaces
Peripherals
Computer Organization
Processor
Datapath Memory
Bus
Registers
Address
Control Data
Unit Control
ALU
Interfaces Co-processors
Integrated Circuits
Transistor Wires
Gates
Q(CaSC) / Johanna Sepúlveda 10
Need
Motivation
Hardware Software
Computation
Structure
Processors,
Memories,
Peripherals
Communication
Structure
Network-on-Chip (NoC) Tile-MX100(www.eetimes.com)
FinFet
Silicon nanosheet
New
Technologies
3D SoC Stacking
Carbon Nanotubes
Q(CaSC) / Johanna Sepúlveda 15
Shulaker et al. Monolithic 3D integration: A path from concept to reality. DATE 2015
Need
Motivation
Evolution of Computation
Sycamore
2019
Evolution of Computation
Processors
P (e.g. Intel AVX)
Neuromorphic
ASIC ASIC u Microcontroller cPros: Processors
(Application Specific Integrated Circuit) C ▪ Programmable (e.g. Intel Loihi)
(e.g. ARM Cortex-M) ▪ Low unit cost Pros:
Pros: ▪ Manycore
Pros: architecture ▪ Programmable
▪ Fast and easy development ▪ On-memory
▪ Low unit cost ▪ Advance features
▪ High performance (e.g., Out-of-order processing
▪ Wide variety
▪ Low area/power operation) Cons:
Cons: ▪ General purpose
Cons: ▪ Application
▪ Very expensive Cons:
▪ Time-consuming ▪ Specific and limited ISA specific
▪ Specific and fixed
FPGAs Microcontroller for ISA GPUs
(e.g. Nvidia)
(Field Programmable
Gate Array) SAFE
uC
safety
Pros: (e.g. AURIX of Infineon) Pros:
▪ Programmable Pros: ▪ High performance
configuration ▪ Massively parallel
▪ Parallel architecture ▪ Easy development
▪ Predictable behavior operations
▪ Fast development ▪ Safe-oriented design
Cons: ▪ Include security modules (HSM) Cons:
▪ Poor control over
optimization
Cons: ▪ High cost
▪ Specific and fixed ISA ▪ Black-box
▪ High power consumption ▪ Application oriented design
▪ Expensive in large-scale compilers
production ▪ Performance
▪ Volatile depends on nice
Q(CaSC) / Johanna Sepúlveda 17
code behavior flow
Need
Motivation
Richard Feynman
❑ Quantum circuits:
✔ Quantum gates can be combined
✔ Able to perform computation
David Deutsch
Q(CaSC) / Johanna Sepúlveda 20
Section 3
QUANTUM PRINCIPLES
1. Wave–Particle Duality
3. Schrödinger Equation
E= h. v E= m. c2
Velocity= V
Velocity=?
Planck Constant
Position Uncertainty
Momentum Uncertainty
Tunneling effect
(p=m.v)
Conditions that the electron must meet in order that a system is stable
Orbitals:
Described by quantum numbers (n l ml ms)
✔ n: Principal quantum number (energy level) n=[1,∞)
✔ l: Azimuthal quantum number (angular momentum) l=[0,n-1]
s, p, d, f..
✔ ml: Magnetic quantum number (orientation) ml=[-l,l]
✔ ms: Spin quantum number (magnetic field orientation) ms=[-1/2,1/2]
Quantum Phenomena
1. Superposition
2. Entanglement
Superposition
The state of a system is determined by the value of a set of
macroscopic variables which characterize the system in a given
moment of time. New temporal values of such variables will
characterize the state in other moment
Superposition
Duck
Realism Locality
Universe exist even if we do Each bit of the universe act
not observe it with the immediate
surrounding (no faster than c)
In the universe:
✔ Reality needs an observer
✔ Exists as superposition of
possibilities
✔ Described by of the superposition
✔ Experience when the moment is
measured
Niels Bohr
In the universe:
✔ All is real
✔ All is physical
✔ All is defined (local hidden variables)
Local realism
Q(CaSC) / Johanna Sepúlveda 32
Principles
Entanglement
e--
(spin different
direction)
Photon pos
✔ Wavefunction is entangled
✔ Until measure we cannot know which is the spinning direction
✔ Measure of one will let us know the measure of the second one
✔ Measure has an effect (AXIS of measurement)
1st
Entanglement
QUANTUM COMPUTER
✔Quantum superposition
of 0 and 1
Qubit: Operation
Qubit: Operation
Qubit: Operation
Summary
• Quantum mechanics
– Princpiples: Wave-particle duality, Uncertainty Principle,
Schödinger equation
– Phenomena: Superposition and Entanglement
Summary
Complex numbers
Q(CaSC) / Johanna Sepúlveda 46
Next Lecture
Quantum
Computers
Basic Principles
Next lecture: Quantum Computer Evolution
Structure
Types
Programming
Security threat
1) More videos:
Qubits
Datapath Memory
Bus
Registers
Address
Control Data
Unit Control
Interfaces Co-processors
1. Wave–Particle Duality
Velocity=?
Measure has a strong effect on the quantum system
3. Schrödinger Equation
Function that describes the state of a quantum-mechanical system
Superposition Entanglement
1
Complex numbers
Q(CaSC) / Johanna Sepúlveda 7
We are Ready to Start..
Quantum
Computers
Basic Principles
Evolution
Structure
Types
Programming
Security threat
QUBITS
Qubit Notation
|𝟎
𝑩𝑲
Dirac Bra-Ket Notation
Row Column
Vector Vector
|𝟏 𝟐 𝟐
Where 𝜶 + 𝜷 =𝟏 Quantum amplitudes
Qubit Notation
Where 𝜶 𝟐 + 𝜷 𝟐 =𝟏
Probability of 0 Probability of 1
Q(CaSC) / Johanna Sepúlveda 11
Qubit
Motivation
Qubit Notation
Qubit 0 (Ket 0)
1
|𝟎 = 0
Qubit 1 (Ket 1)
0
|𝟏 = 1
1
2
1
2
1
2
1
2
1
2
1
2
α Where 𝜶 𝟐
+ 𝜷 𝟐
=𝟏
β
1
α=β =
2
1
Probability of 0 = α2 =
2
1
2
1
−
2
3𝑒𝑖𝜋/7
?
5
−4𝑖
5
Outcome 0
(High Probability)
Superposition
between 0 and 1
(Dominant 0)
Outcome 1
Q(CaSC) / Johanna Sepúlveda (Low Probability) 17
Need
Motivation
Outcome 0
(50% Probability)
Explosion of states
Q(CaSC) / Johanna Sepúlveda 19
Compute
Motivation
Quantum state 0 0 0
𝑪𝟎 |𝟎𝟎𝟎 +
𝑪𝟏 |𝟎𝟎𝟏 + 1 1 1
Superposition Entanglement
No
1 0
1
1
QUANTUM GATES
Quantum Gates
Transformation of Qubits
|𝟎
Rotation Measure
Interaction among
qubits
|𝟏
Quantum Gate
Quantum Gates
Quantum Gate
Pauli Gate
0 1
Pauli X-gate (NOT gate or bit flip): 𝑋 =
1 0
1 0
• 0 = 1 =
0 1
0 1 1 0
• 𝑋0 = = = 1
1 0 0 1
0 −𝑖
Pauli Y-gate (bit flip and phase shift): 𝑌 =
𝑖 0
1 0
Pauli Z-gate (phase shift): Z =
0 −1
−𝑖𝜋
1 0
=𝑒 4 𝑒 0
𝑖𝜋 4
Phase gate: 𝑆 = 𝑖𝜋
0 𝑖 0 𝑒 4
−𝑖𝜋
1 0 𝑖𝜋 𝑒 8 0
π/8 gate: T = 𝑖𝜋 = 𝑒 8
𝑖𝜋
0 𝑒 4 0 𝑒 8
Control NOT
SWAP
Controlled NOT
(CNOT)
Controlled Z
(CZ)
Toffoli
Q(CaSC) / Johanna Sepúlveda 33
Gates
Quantum Gate
Measure
Quantum Circuits
INPUT OUTPUT
QUANTUM ORGANIZATION
Quantum Computer
Control Lines
Control Lines
QUANTUM TECHNOLOGIES
DiVicenzo Criteria
Technologies
Superconducting Circuits
Trapped Ions
Neutral Atoms
Summary
1) Documentation material
3) Build and send the simulation result of a quantum circuit executed in the IBM
computer (Try to predict the output using the matrix notation)
Example: (But you can try any other circuit)
4. Quantum Algorithms
Quantum Technology
Quantum Algorithms
Probability of 0 Probability of 1
Imaginary
𝛼= a+ib
α 𝛼= r𝑒 𝑖∅
b r
Φ Real
a
Q(CaSC) / Johanna Sepúlveda 5
Summary
𝛼= r𝑒 𝑖∅
𝜑 = 𝑟0 𝑒 𝑖∅0 |0 + 𝑟1 𝑒 𝑖∅1 |1
Where 𝒓𝟎 𝟐 + 𝒓𝟏 𝟐 = 𝟏 𝜃
𝜑 =𝑒 𝑖∅0
(𝑟0 |0 + 𝑟1 𝑒 |1 𝑖∅ 𝑟1 = sin
2
Where ∅ = ∅𝟏 − ∅𝟎 𝜃
𝑟0 = cos
Q(CaSC) / Johanna Sepúlveda 2 6
Summary
𝑪𝟎 |𝟎𝟎𝟎 +
𝑪𝟏 |𝟎𝟎𝟏 +
1 1 1
Superposition Entanglement
Quantum Gates
Transformation of Qubits
|𝟎
Rotation Measure
Interaction among
qubits
|𝟏
Control NOT
Quantum Computer
Quantum Computer
(Output)
Quantum Computer
Shield
Coaxial Cable
Cooling System (Communication)
Quantum
Computers
Basic Principles
Evolution
Structure
Types
Programming
Security threat
QUANTUM TECHNOLOGY
DiVicenzo Criteria
Coherence
Wavelength
Frequency
Velocity
Decoherence
Control
INPUT OUTPUT
Superconducting Circuits
Efficient (FAST)
Trapped Ions
Neutral Atoms
Interview: Oracle
Inputs Output
Oracle
Quantum Algorithm
Software
• Evidence for/amount of
beyond-classical power
• Implementation Feasibility
Q(CaSC) / Johanna Sepúlveda 33
Algorithm
Optimization in Industry
Optimization in Industry
Grover Algorithm: Polynomial speedup for these problems
Chemistry simulation
Optimization
Machine learning
Cryptography
Grover Algorithm
Shor Algorithm
Implications on Security
QUANTUM
Grover’s algorithm
SKC/PKC in CLASSIC
Halves the security of AES
Better classic algorithm
AES-128 AES-256
~ 1034 Steps
Shor’s algorithm
In a classic computer (THz)
(1 trillion of ops / sec)
~ 107 Steps
In a quantum computer (MHz)
~ 17 Trillions of years (1 million of ops / sec)
~ 10 Seconds
Quantum Threat
Asymmetric
(Public Key)
~ 10RSA-3072
34 Steps
ECC-256
128
128
0 Shor’s Algorithm
ECC521 256
In a classic computer (THz)
(1 trillion of ops / sec)
AES-128 128 64
Grover’s
Symmetric
AES-256 256 128 Algorithm
Grover’s Algorithm
https://quantum-computing.ibm.com/docs/guide/q-algos/grover-s-algorithm
Grover’s Algorithm
https://www.youtube.com/watch?v=IT-O-KSWlaE
https://www.youtube.com/watch?v=PAVKuYv1HC8
Summary
Quantum
Shor’s and Grover’s Quantum Algorithms
Computers
Q&A Quantum Technology Basic Principles
Evolution
Structure
Types
Programming
Security threat
Security Basics
Grover’s Algorithm
Shor’s Algorithm
Decoherence
Control
INPUT OUTPUT
Chemistry simulation
Optimization
Machine learning
Cryptography
Grover Algorithm
Shor Algorithm
Quantum
Computers
Basic Principles
Evolution
Structure
Types
Programming
Security threat
SECURITY BASICS
Public values
Alice‘s values Alice Bob Bob‘s values
Public values
Alice‘s values Alice Bob Bob‘s values
RSA ECC
Q(CaSC) / Johanna Sepúlveda 16
Security
Application layer
(I) COAP Generate Data Data
Security layer
(II) DTLS Encryption EData
Transport layer
(III) UDP UDP Header UDP
Network layer
(IV) IPv6 IP Header IP
Adaptation layer
(V) 6LoWPAN 6LoWPAN
Physical layer F F
MAC/PHY
(VI) IEEE 802.15.4 H F
Client Server
Application layer
(I) COAP *ClientHello
*ClientHelloVerify
Security layer
(II) DTLS ClientHello
C1
Transport layer ServerHello, Certificate
UDP C2
(III)
Network layer
C3 ClientKeyExchange
ClientKeyExchange
(IV) IPv6 PKC
Adaptation layer Finished
(V) 6LoWPAN C4
ChangeCipherSpec
C5
Physical layer
Finished
(VI) IEEE 802.15.4
C6
SC
Q(CaSC) / Johanna Sepúlveda 19
Security
Traditional Security
Today traditional cryptography
is considered secure
Factoring large integers Computing discrete logarithms
Traditional Cryptography
(RSA, ECC)
Cryptoanalysis
Side-Channel
Attacker
100
80
QUBITS
60
Superconductors
40 Ion Trap
Spin
20
Neutral atoms
0
1995 2000 2005 2010 2015 2020 2025
Implications on Security
QUANTUM
Grover’s algorithm
SKC/PKC in CLASSIC
Halves the security of AES
Better classic algorithm
AES-128 AES-256
~ 1034 Steps
Shor’s algorithm
In a classic computer (THz)
(1 trillion of ops / sec)
~ 107 Steps
In a quantum computer (MHz)
~ 17 Trillions of years (1 million of ops / sec)
~ 10 Seconds
Quantum Threat
Asymmetric
(Public Key)
~ 10RSA-3072
34 Steps
ECC-256
128
128
0 Shor’s Algorithm
ECC521 256
In a classic computer (THz)
(1 trillion of ops / sec)
AES-128 128 64
Grover’s
Symmetric
AES-256 256 128 Algorithm
Grover Algorithm
Optimization in Industry
Four stages:
Initialization Transformation
Oracle
Amplification
Measurement
Q(CaSC) / Johanna Sepúlveda 27
Grover
N= 8 2𝑛=3 = 8
N: number of cards
Repeat O( 𝑁) times
n: Qubits required to express
the N cards
Q(CaSC) / Johanna Sepúlveda 28
Grover
Repeat O( 𝑁) times
Uniform
Superposition
𝟏
Amplitude
𝑵 mean
X
1 2 3 4 5 6 7 8
|000 |001 |010 |011 |100 |101 |110 |111
Repeat O( 𝑁) times
𝟏
(flip sign of that <
𝑵 mean
state’s amplitude)
X
1 2 3 4 5 6 7 8
Identify Flip
Q(CaSC) / Johanna Sepúlveda 30
Grover
Result:
Amplitude representation: Inversion
Geometrical representation: reflection
Example:
Function that returns ‘0' for all possible input states,
except one input state (x= winner)
Repeat O( 𝑁) times
For M solutions
𝑵
r≈ times
𝑴
Repeat
𝛑 𝑵
r =( ) times
𝟒
N=8, r ≈ 2
Define states
Define function
Simulator
http://davidbkemp.github.io/animated-qubits/grover.html
Q(CaSC) / Johanna Sepúlveda 35
Grover
AddRoundKey S0 S1 S2 S3
State Key
S4 S5 S6 S7
S8 S9 S10 S11
SubBytes
S12 S13 S14 S15
ShiftRows 9 rounds S3 XOR
k3
S‘3
MixColumns
S‘0 S‘1 S‘2 S‘3
AddRoundKey
S‘4 S‘5 S‘6 S‘7 State
S‘8 S‘9 S‘10 S‘11
SubBytes S-Box
S‘12S‘13S‘14 S‘15
ShiftRows
V3
AddRoundKey
https://arxiv.org/pdf/1512.04965.pdf
Q(CaSC) / Johanna Sepúlveda 36
Grover
Message
(plaintext) Encrypted
AES Message
Secret (ciphertext)
N: number of
candidates
key
https://arxiv.org/pdf/1512.04965.pdf
https://eprint.iacr.org/2019/1146.pdf
Q(CaSC) / Johanna Sepúlveda 37
Grover
Large circuit depth due the unrolling the entire Grover iteration
https://arxiv.org/pdf/1512.04965.pdf
https://eprint.iacr.org/2019/1146.pdf
Q(CaSC) / Johanna Sepúlveda 38
Section 4
Shor Algorithm
Traditional Cryptography
(RSA, ECC)
Cryptoanalysis
Side-Channel
Attacker
N= p.q
Hard problem
Today traditional cryptography
is considered secure
Q(CaSC) / Johanna Sepúlveda 40
Shor
Check if p divides N
𝒑
𝒈2 ±1
Period Finding
p has a repeating property
𝒈𝒑+𝒙 = m2. N + r
Period Finding
Modular math:
Dividend Quotient
𝑎
=𝑞 With remainder r
𝑁
Divisor
𝒓 = 𝑎 𝑚𝑜𝑑 𝑁
𝒈𝒑+𝒙 = m2. N + r
Shor Algorithm
Superposition of all the
possible powers
Quantum
Measure r (superposition of
Guess 𝒈 answers with equal r)
Oracle
Measurement
Initialization Measurement
𝟏
𝒑
Find Period
Transformation
Q(CaSC) / Johanna Sepúlveda 47
Shor
𝑵
Choose a random g < 𝑵 . If gcd(𝒈, 𝑵) ≠ 1 then 𝑝1 = gcd(𝑥, 𝑁) and 𝑝2 = 𝑝1 ,
otherwise continue
𝒈 = 11
Choose the parameter 𝑴 ∈ 𝑁 2 , 2𝑁 2 ∶ 𝑴 = 2 𝒎
𝑴 = 512
𝒎=9
Apply the quantum algorithm to find the period 𝑟 of 𝑔𝑝 𝑚𝑜𝑑 𝑁
Initialize a register with 𝒏 + 𝒎 + 1 qubits
First 𝑛 + 𝑚 qubits to |0 and the last qubit to |1
𝒏 = 𝑙𝑜𝑔2 𝑵 = 5 and
𝑐 = 427
0
𝑀 2𝑀 3𝑀 𝑐
0
𝑝 𝑝 𝑝
Q(CaSC) / Johanna Sepúlveda 49
Shor
Period Finding
𝑴
Assuming we get a multiple of , use the continued fraction
𝒑
expansion algorithm (runs with polynomial time) to get the integer
𝑴
fraction that best approximates the result 𝑐 = 𝑘 , 𝑘 ∈ ℕ
𝒑
𝑐 𝑘 427 𝑘
min − = −
𝑴 𝒑 512 𝒑
p= 𝟔
𝒑
If 𝒑 is even and 𝒈 2 ≡ ±1 𝑚𝑜𝑑 𝑵, continue, otherwise, select a new
6
guess g11 2 ≡ 1331 ≡ 8 ≢ ±1 𝑚𝑜𝑑 21
Compute the factors of 𝑵 as
𝒑 𝒑
𝑝1 = gcd(𝒈 2 − 1, 𝑵) and p2 = gcd(𝒈 2 + 1, 𝑵)
𝑝1 = gcd 7, 21 = 7
𝑝2 = gcd 9, 21 = 3
Quantum Programming
https://qiskit.org/textbook/ch-algorithms/grover.html
Key Exchange
Quantum Communication
Public values
Alice‘s values Alice Bob Bob‘s values
Public values
Alice‘s values Alice Bob Bob‘s values
RSA ECC
Q(CaSC) / Johanna Sepúlveda 6
Summary
Traditional Security
Today traditional cryptography
is considered secure
Factoring large integers Computing discrete logarithms
Traditional Cryptography
(RSA, ECC)
Cryptoanalysis
Side-Channel
Attacker
SC
Q(CaSC) / Johanna Sepúlveda 8
Summary
Quantum Threat
Asymmetric
(Public Key)
~ 10RSA-3072
34 Steps
ECC-256
128
128
0 Shor’s Algorithm
ECC521 256
In a classic computer (THz)
(1 trillion of ops / sec)
AES-128 128 64
Grover’s
Symmetric
AES-256 256 128 Algorithm
Four stages:
Initialization Transformation
Amplification
Measurement
Q(CaSC) / Johanna Sepúlveda 11
Summary
Message
(plaintext) Encrypted
AES Message
Secret (ciphertext)
N: number of
candidates
key
https://arxiv.org/pdf/1512.04965.pdf
https://eprint.iacr.org/2019/1146.pdf
Q(CaSC) / Johanna Sepúlveda 12
Summary
Shor’s Algorithm
Period Finding
Goal: Find prime factors of N If N = 11, a= 5
Shor’s Algorithm
Superposition of all the
possible p
Quantum
Measure r
Guess 𝒈
They are p apart from each
Extract p other
Oracle
𝑃(𝑐)
0
Measurement
𝑀 2𝑀 3𝑀 𝑐
0
𝑝 𝑝 𝑝 Q(CaSC) / Johanna Sepúlveda 14
Summary
Initialization Measurement
𝟏
𝒑
Find Period
Transformation
Q(CaSC) / Johanna Sepúlveda 15
Summary
Quantum
Communication
(QKD)
Main Principles
Structure
Types
Standard
Use cases
KEY EXCHANGE
Secrecy of the
Confidentiality information
Data is not
Cryptographic Primitivescorrupted
Integrity
(Use a key)
Key Exchange
01101010100001010101000010…..
Enforced Negotiated
Selects Selects
g, p, a g, p, A b
Calculate Calculate
A = ga mod p B = gb mod p
B
Calculate Calculate
K = Ba mod p K = Ab mod p
Message
(plaintext) Encrypted
Encryption Message
Secret (ciphertext)
(key)
Encrypted
Message
(ciphertext) Message
Decryption (plaintext)
Secret
(key)
Message
(plaintext) Encrypted
XOR
Encryption Message
Secret (ciphertext)
(key)
Pre-shared key (identical) should have at least the same size as the message
being sent (ABSOLUTELY SECURE)
Encrypted
Message
(ciphertext) Message
XOR
Decryption (plaintext)
Secret
(key)
Message
(plaintext) Encrypted
AES Message
(ciphertext)
Secret
(key)
Encrypted
Message
(ciphertext) Message
AES (plaintext)
Secret
(key)
Selects Selects
g, p, a g, p, A b
Calculate Calculate
A = ga mod p B = gb mod p
B
Calculate Calculate
K = Ba mod p K = Ab mod p
Attacks: Eavesdropping
Alice Bob
Selects Selects
g, p, a g, p, A b
Calculate Calculate
A = ga mod p B = gb mod p
B
Calculate Calculate
K = Ba mod p K = Ab mod p
Quantum Communication
Teleportation Quantum-key-Distribution
Teleportation
QIN: Teleportation
Photon to be transmitted
Transmitted photon
Interact with other Modify the
particle quantum state
Any interaction with the entangled particle in one side (Rick) will be
immediately perceived by the other side (Morty)
Low Energy
Entangled Photons
High Energy Photon
Ngari transmitter
(Tibetan mountain)
Space-based link
Quantum-Key-Distribution (QKD)
Message
Encrypted Message
Message
Classical Network
Quantum Quantum
Quantum Channel
Device Device
V
L R
Orthogonal polarization
Q(CaSC) / Johanna Sepúlveda 38
QComm
(H)
Measure basis
OR
(H)
OR
Measure basis OR
Left (L)
Measure basis
OR
OR
Left (L)
Measure basis OR
Key Distillation
Error Correcting capabilities
Q(CaSC) / Johanna Sepúlveda 43
QComm
Public Channel
Quantum Channel
H V
Raw key
L R
Single photon
Encoding basis Encode
Selected basis
Correct measure Measure
Sifted key
Key Distillation
Reconciliation
Secret key
Q(CaSC) / Johanna Sepúlveda 44
QComm
QKD Today
QKD Applications
Poorly understood
Only to exchange key (other cryptoprimitives are not supported)
Rely on authenticated channels
Secure Implementation is mandatory
Extend the performance (limits on rate and range)
Cost
Killer application
QKD Standard
https://www.etsi.org/technologies/quantum-key-distribution
Next Lecture
Third Block
Cryptography
Secrecy of the
Confidentiality information
Data is not
Cryptographic Primitivescorrupted
Integrity
(Use a key)
Key Exchange
01101010100001010101000010…..
Enforced Negotiated
Message
(plaintext) EncryptedM
Encryption essage
Secret (ciphertext)
(key)
SC
Q(CaSC) / Johanna Sepúlveda 7
Summary
Traditional Security
Today traditional cryptography
is considered secure
Factoring large integers Computing discrete logarithms
Traditional Cryptography
(RSA, ECC)
Cryptoanalysis
Side-Channel
Attacker
Quantum Threat
34
RSA-3072 128
Asymmetric
(Public Key)
~ 10ECC-256
Steps 128
0 Shor’s Algorithm
ECC521 256
In a classic computer (THz)
(1 trillion of ops / sec)
AES-128 128 64
Grover’s
Symmetric
AES-256 256 128 Algorithm
Teleportation Quantum-key-Distribution
QIN: Teleportation
Photon to be transmitted
Transmitted photon
Interact with other Modify the
particle quantum state
Any interaction with the entangled particle in one side (Rick) will be
immediately perceived by the other side (Morty)
Low Energy
Entangled Photons
High Energy Photon
Quantum-Key-Distribution (QKD)
Message
Encrypted Message
Message
Classical Network
Quantum Quantum
Quantum Channel
Device Device
V
L R
Orthogonal polarization
Q(CaSC) / Johanna Sepúlveda 15
Summary
(H)
Measure basis
OR
(H)
OR
Measure basis OR
Public Channel
Quantum Channel
H V
Raw key
L R
Single photon
Encoding basis Encode
Selected basis
Correct measure Measure
Sifted key
Key Distillation
Reconciliation
Secret key
Q(CaSC) / Johanna Sepúlveda 19
Summary
QKD Today
QKD Applications
Post-Quantum
Cryptography
Main Principles
Families and Types
Standard
Main Components
Secure implementation
Use cases
CRYPTOGRAPHY
Defense
Technology
Health
Logistics
Cryptography History
Cryptography:
‘Krypto’ meaning hidden
and ‘graphene’ meaning writing.
Classical Cryptography
Reinassance Cryptography
Vigenère cipher
• Further development of
substitution-based
ciphers (polyalphabetic)
• Based on a series of
interwoven Caesar
ciphers
• Different alternatives
(rows)
Premodern Cryptography
Enigma Sigaba
Modern Cryptography
Note: Algorithms and parameters are PUBLIC and private keys are PRIVATE
Modern Cryptography
SYMMETRIC-KEY
(SKC)
Cryptography Definition
Parameters Performance
Industry
Researchers
Government Requirements
Get Expertise
Unilateral
Define
Public:
Competition
Q(CaSC) / Johanna Sepúlveda 37
Crypto
The Drama
NSA
Lucifer
(128-bits)
National Bureau of
Public and open discussion is mandatory
Standard
The Bureau
SHA-3
Secure Hash Algorithm 3
(2015)
Lightweight
57 Candidates
(2019)
We can get information that is leaked from the normal operation of the
system to retrieve some secret/privilege information
(time to execute a function, power, access, etc..)
Lattices
Lattice-Based Cryptography
LWE / NTRU
Cryptography:
‘Krypto’ meaning hidden
and ‘graphene’ meaning writing.
Cryptography History
Post-Quantum
Enigma
Hieroglyph
Scytale
Q(CaSC) / Johanna Sepúlveda 6
Summary
We can get information that is leaked from the normal operation of the
system to retrieve some secret/privilege information
(time to execute a function, power, access, etc..)
Traditional Security
Today traditional cryptography
is considered secure
Factoring large integers Computing discrete logarithms
Traditional Cryptography
(RSA, ECC)
Cryptoanalysis
Side-Channel
Attacker
Quantum Threat
Asymmetric
(Public Key)
~ 10RSA-3072
34 Steps
ECC-256
128
128
0 Shor’s Algorithm
ECC521 256
In a classic computer (THz)
(1 trillion of ops / sec)
AES-128 128 64
Grover’s
Symmetric
AES-256 256 128 Algorithm
100
15360 30720 512 3000
80
QUBITS
60
Superconductors
40 Ion Trap
Spin
20
Neutral atoms
0
1995 2000 2005 2010 2015 2020 2025
Message
Encrypted Message
Message
Classical Network
Quantum Quantum
Quantum Channel
Device Device
Distribute Key
Post-Quantum Cryptography Encrypt
Decrypt
Classical Network Sign
Verify
Algorithms used to secure messages on a classical computer and that are resistant to
traditional computers attacks AND quantum computers attacks
PQC: Comparison
PQC Momentum
0 5 10 15 20 25 30
Post-Quantum Security
Integration Process IonQ’s 79 qubits Quantum Processor
Q(CaSC) / Johanna Sepúlveda 15
Summary
First NIST
18 3 9 2 32
Round
Second NIST
7 2 4 1 12
Round
Advantages
- Wider portfolio of mathematical problems in
Advantages
comparison with traditional PKI (e.g., RSA, ECC)
- Security based on physics
- Use already deployed technology
- Virtually unhackable - Able to exchange keys, encrypt, decrypt, sign,
- Detect eavesdropping verify
- Target of intense research
- Standardization process (NIST, IETF, IEEE,
ETSI)
Disadvantages - Scalability
- Prone to implementation attacks - Good performance
- Resilience: Change in photon polarization - Target of intense research
- Lacks many security features (only key
exchange) Disadvantages
- Need of dedicated channel (high cost) - Prone to implementation attacks
- Restricted key throughput (scalability) - Need to build confidence
Q(CaSC) / Johanna Sepúlveda 18
- Larger keys when compared to traditional PKI
Summary
Post-Quantum
Cryptography
Main Principles
Families and Types
Standard
Main Components
Secure implementation
Use cases
LATTICE
Space Dimension
(Euclidean Space)
Basic Element
(Basis)
Order
(Pattern)
Lattices
𝑏2
𝑏1
• Generated by a basis
ℬ = 𝑏1 , … , 𝑏𝑛 Rank
ℬ𝑚𝑥𝑛
• ℒ = 𝑛𝑖=1(ℤ ⋅ 𝑏𝑖 )
𝑏2 Scary Basis: Long
ℒ(ℬ) = 𝑩𝒙 | 𝒙 ∈ ℤ𝑛 𝑏1 vectors
Lattices
Are these vectors a basis for our lattice?
𝑏1
𝑜
𝑏2
Dimension = 2
Rank = 1
Lattice Summary
We know
Some variations:
𝑆
α-shortest vector
𝑜
We know
𝑜
𝐶
𝑟
e
𝑜
𝒔
Interpretation of LWE
𝑒11 𝑟11
𝑒𝑚𝑥1 = 𝑒21⋮ 𝑟𝑚𝑥1 = 𝑟21⋮
𝑒𝑚1 𝑟𝑚1
Gaussian
e is the error vector r is the visible vector
(small magnitude)
𝑨. 𝒔 + 𝒆 = 𝒓 Decisional LWE
Given
Search LWE Find (and/or)
Q(CaSC) / Johanna Sepúlveda 31
Lattice
LWE – Decisional and Searching Problem
𝑨. 𝒔 + 𝒆 = 𝒓
Public values
Decisional LWE
Search LWE
(Distinguish)
Quantum
[R‘05]
GapSVP, ≤
SIVP
≤ ≤
Search-LWE Decision-LWE Crypto
Decision version of SVP
GapSVP
≤
[BFKL94] [R‘05],
[R‘05], [PW‘08]
[P‘09] [GPV08]
NTRU LWE
Classical
[P‘09]
V´
𝑠 c c
Taxonomy of Lattices
Lattices
NTRU
LWE
(SVP)
Ring
Replaces n dimensional
vectors by polynomials of
degree smaller than n
Q(CaSC) / Johanna Sepúlveda 36
Section 3
LATTICE-BASED CRYPTOGRAPHY
PKC Security
Transformation is based on hard problems which can not be
solved or they require excessive computation/memory resources
Selects Selects
g, p, a g, p, A b
Calculate Calculate
A = ga mod p B = gb mod p
B
Calculate Calculate
K = Ba mod p K = Ab mod p
A q
LWE CRYPTOGRAPHY
𝒃𝟏 = A. 𝒔 + 𝒆 -----
𝒃𝟏 . 𝒙 = (A. 𝒔 + 𝒆) . 𝒙 𝒗 = A. 𝒙
𝒗= (A.𝒃𝟐
𝒔)𝒗 𝑨−𝟏 + 𝒆 . 𝒙 𝒒
Calculate (Decryption) 𝒃𝟐 = 𝒃𝟏 𝒙 + 𝒎
= 𝒔.
Ciphertext
𝒗 + 𝒆 . 𝒙 𝟐
𝒒 Payload
𝒃𝟐 − 𝒔. 𝒗 = 𝒆.𝒙 + 𝒎 (Preamble)
𝟐
𝒒
Private vector e <<
𝟒
𝒒
𝒃𝟐 − 𝒔. 𝒗 = 𝒆.𝒙 + 𝒎
𝟐
Security Proof
Matrix A and integer q
Alice Bob
𝒒
e <<
𝟒
Public key
𝒃𝟏 = A. 𝒔 + 𝒆 𝒒
𝒃𝟐 = 𝒃𝟏 𝒙 +𝒎
𝒃𝟏 : 𝐑𝐚𝐧𝐝𝐨𝐦 𝐮𝐧𝐢𝐟𝐨𝐫𝐦 𝐯𝐚𝐥𝐮𝐞 𝟐
Binary/ternary vector 𝒒
e <<
Public key 𝟒
Selects (uniform m> n log q) Selects
𝒙 𝒗= A. 𝒙
𝒗
Multiplying by the inverse 𝑨−𝟏
𝒔 𝒆𝟏 𝒆𝟐
Calculate (Key Generation) 𝒗 𝑨−𝟏 = A. 𝒙 𝑨−𝟏 Calculate (Encryption)
𝒗 𝑨−𝟏 = 𝒙
𝒗 = A. 𝒙 𝒃𝟏 = A. 𝒔 + 𝒆𝟏
𝒃𝟏 ----- 𝒃𝟐
𝒃𝟏 . 𝒙 = (A. 𝒔 + 𝒆𝟏 ) . 𝒙 𝒒
Calculate (Decryption)
−𝟏
𝒃 𝟐 =𝒔. 𝒗 + 𝒆 𝟐 + 𝒎
= (A. 𝒔)𝒗 𝑨 + 𝒆 . 𝒙 𝟐
𝒃𝟏 . 𝒙 = 𝒔. 𝒗 + 𝒆𝟏 .𝒙 Ciphertext Payload 𝟏
= 𝒔. 𝒗 + 𝒆𝟏 . 𝒙
(Preamble)
𝒒
𝒃𝟐 − 𝒃𝟏 . 𝒙 = 𝒆𝟐 − 𝒆𝟏 .𝒙 + 𝒎
𝟐
𝒒
e <<
𝟒
𝒒
𝒃𝟐 − 𝒃𝟏 .𝒙 = 𝒆𝟐 − 𝒆𝟏 .𝒙 + 𝒎
𝟐
Keys Keys
Public key Public key
𝑨. 𝒃𝟏 = A. 𝒔 + 𝒆 𝑨 . 𝒗 = A. 𝒙
Pseudorandom Random
Fresh LWE sample with many encryption Many LWE samples with unique
coins 𝒙 encryption coins 𝒔
Q(CaSC) / Johanna Sepúlveda 48
LWE
Signature
calculated
Signature
calculated
f
D
R
x y
f -1
𝒚 = 𝑯 𝒎𝒆𝒔𝒔𝒂𝒈𝒆
𝑺𝒊𝒈𝒏𝒂𝒕𝒖𝒓𝒆 = 𝒇−𝟏 (𝒚)
Lattice-based Signatures
Generate uniform 𝑣𝑘 = 𝐴 with a secret trapdoor 𝑠𝑘 = 𝑇
Verify (A, μ, z)
Check 𝐴𝑧 = 𝐻 𝜇 and that 𝑧 is short 𝐴𝑧 = 𝐻 𝜇 ∈ ℤ𝑛𝑞
f
D
R
x y
f -1
NTRU CRYPTOGRAPHY
𝑅𝑁 , 𝑞 = 𝕫𝑞 𝑥
𝑥𝑁 − 1
Operations: Addition and Multiplication
NTRU steps
1. Key generation
2. Encryption
IEEE 1363.1 (2009)
3. Decryption NTRUEncrypt lattice-based
public-key encryption algorithm
Q(CaSC) / Johanna Sepúlveda 54
NTRU
NTRU: Encryption
Public values
Alice‘s values Alice N, p, q Bob
𝒉 = 𝒑 𝒇𝒒 ∗ 𝒈 𝒎𝒐𝒅 𝒒
𝒔𝒌 = 𝒇, 𝒇𝒑
m
1. Format m as a ternary
polynomial
m(x)
e(x)= 𝒓 ∗ 𝒉 + 𝒎′ 𝒎𝒐𝒅 𝒒
NTRU: Decryption
Public values
Alice‘s values Alice N, p, q Bob
𝒉 = 𝒑 𝒇𝒒 ∗ 𝒈 𝒎𝒐𝒅 𝒒
𝒔𝒌 = 𝒇, 𝒇𝒑
e(x)= 𝒓 ∗ 𝒉 + 𝒎′ 𝒎𝒐𝒅 𝒒
1. Compute
𝑎 = 𝑓 ∗ 𝒆 𝒙 𝑚𝑜𝑑 𝑞
𝑏 = 𝑎 𝑚𝑜𝑑 𝑝
2. Remove the mask
m’ = 𝑓𝑝 ∗ 𝑏 𝑚𝑜𝑑 𝑝
m = 𝑚′ − 𝑴𝑮𝑭 𝑒 − 𝑚′
3. Verify there are not CCA
Answer Quiz
Optional-Optional: Look the implementation at this site (try to compile the program)
https://newhopecrypto.org/
Additional Links
Matrix calculator
https://www.mathsisfun.com/algebra/matrix-calculator.html
Formal Lattice
https://ocw.mit.edu/courses/mathematics/18-409-topics-in-theoretical-
computer-science-an-algorithmists-toolkit-fall-2009/lecture-
notes/MIT18_409F09_scribe18.pdf
https://cseweb.ucsd.edu/classes/sp07/cse206a/lec2.pdf
Next Lecture
Third Block
PQC: Comparison
V´
c c
Taxonomy of Lattices
Lattices
NTRU
LWE
(SVP)
Ring
Replaces n dimensional
vectors by polynomials of
degree smaller than n
Q(CaSC) / Johanna Sepúlveda 6
Summary
Post-Quantum
Cryptography
Main Principles
Families and Types
Standard
Main Components
Secure implementation
Use cases
LWE
q = 13
m=7
n=4
Random - Lattice Secret Result
4 1 11 10 6 4
5 5 9 5 9 8
3 9 0 10 11 1
x =
1 3 3 2 11 10
12 7 3 4 4
6 5 11 4 12
3 3 5 0 9
4 1 11 10 6 0 4
5 5 9 5 9 -1 7
3 9 0 10 11 1 2
x + =
1 3 3 2 11 1 11
12 7 3 4 1 5
6 5 11 4 0 12
3 3 5 0 1 8
LWE
q = 13
m=7
n=4
Random - Lattice Secret Small Noise Result
4 1 11 10 4
5 5 9 5 8
3 9 0 10 1
x + =
1 3 3 2 10
12 7 3 4 4
6 5 11 4 12
3 3 5 0 9
LWE Search Problem: Given A and r find the secret and/or the error…
Q(CaSC) / Johanna Sepúlveda 11
Ex & RLWE
LWE
q = 13
m=7
n=4
Random - Lattice Secret Small Noise Result
4 1 11 n 10 4
u9 tio
5 5
t r ib 5
on
8
s i
Di u t
3 m 9 0 10
trib+ 1
for
i
x
Di
s =
Un 1 3 3 2 n 10
s sia
12 7 3 4 a u 4
G n
o
6 5 11 4 uti 12
3 3 5 0 is trib 9
n D
s ia
u s
G a
LWE Decision Problem: Given A distinguish r from a random …
Q(CaSC) / Johanna Sepúlveda 12
Ex & RLWE
4 1 11 10
5 5 9 5
3 9 0 10
1 3 3 2
12 7 3 4
6 5 11 4
3 3 5 0
Ring-LWE
3= -10 mod 13
Random - Lattice
11 10 9 12
We do not need to store all the matrix A…just the generator vector
Q(CaSC) / Johanna Sepúlveda 14
Section 3a
OPERATIONS:
ADDITION AND MULTIPLICATION
Identify Operations
Polynomial Multiplication
Polynomial Addition Schoolbook NTT
Karatsuba Toom–Cook
Next
Lecture
Discrete Sampling
Polynomial Addition
Parameters: q=5
n=4
= (4,2,0,1) 4 2 0 1
= (2,1,4,0)
2 1 4 0
6 3 4 1
1 3 4 1
= (4,2,0,1)
= (2,1,4,0)
0 0 0 0 0 0 0 0
16 8 0 4 8 0 4 -16
4 2 0 1 0 1 -4 -2
8 4 0 2 2 -8 -4 0
8 8 18 10 1 4 0 10 -7 -4 -18
-8 -8 -18
0 3 1 2 0 3 1 2
Q(CaSC) / Johanna Sepúlveda 18
Operation:+*
The multiplication is
= (4,2,0,1) a = 42
b = 01
= (2,1,4,0) c = 21
d = 40
The multiplication is
Butterfly
Operation
Update Twiddle
Factor
Q(CaSC) / Johanna Sepúlveda 22
Operation:+*
NTT friendly
Multiplication should be implemented in a secure way to avoid the leak of information
Q(CaSC)(sensitive
/ Johanna Sepúlveda
factors) 25
Section 3b
OPERATIONS:
RANDOM SAMPLERS
Random Samplers
❑ Different PQC schemes have different parameters of the random
distributions (shape/type, size, mean, fixed/changing, statistical
distance)
▪ Type: Uniform, Gaussian, Binomial
▪ Operations (floating point)
▪ Memory
▪ Execution time
Challenges
Knuth-Yao
Rejection
Sampling
SHAKE
Inversion
SHA-3
Cumulative
Keccak Distribution
Ziggurat Table (CDT)
SHA-3 SHAKE
Capacity
Rejection Sampling
Discrete Ziggurat
Terminal node
(Integer label)
Q(CaSC) / Johanna Sepúlveda 33
Section 5
PK (X25519)
KEM Encapsulation
❑ Layered approach
❑ X25519: 128-bits security Elliptic curve (ECDH)
❑ PQ algorithm
SIKE
Small key size
NTRU-HRSS Large computational
Larger key size cost
Small computational
cost
https://ieeexplore.ieee.org/document/8741027
Answer Quiz
Additional Links
Samplers
https://www.sav.sk/journals/uploads/0212094402follat.pdf
https://www.youtube.com/watch?v=DOC8aamM57M
Next Lecture
Third Block
Linear Codes
Code-based Cryptography
Traditional Security
Today traditional cryptography
is considered secure
Factoring large integers Computing discrete logarithms
Traditional Cryptography
(RSA, ECC)
Cryptoanalysis
Side-Channel
Attacker
Post-Quantum Cryptography
Distribute Key
Post-Quantum Cryptography Encrypt
Decrypt
Classical Network Sign
Verify
Algorithms used to secure messages on a classical computer and that are resistant to
traditional computers attacks AND quantum computers attacks
PQC: Comparison
First NIST
18 3 9 2 32
Round
Second NIST
7 2 4 1 12
Round
• Generated by a basis
ℬ = 𝑏1 , … , 𝑏𝑛 Rank
ℬ𝑚𝑥𝑛
• ℒ = 𝑛𝑖=1(ℤ ⋅ 𝑏𝑖 )
𝑏2 Scary Basis: Long
ℒ(ℬ) = 𝑩𝒙 | 𝒙 ∈ ℤ𝑛 𝑏1 vectors
V´
𝑠 c c
4 1 11 10 6 0 4
5 5 9 5 9 -1 7
3 9 0 10 11 1 2
x + =
1 3 3 2 11 1 11
12 7 3 4 1 5
6 5 11 4 0 12
3 3 5 0 1 8
7𝑥4
ℤ13
4 1 11 10
5 5 9 5
3 9 0 10
1 3 3 2
12 7 3 4
6 5 11 4
3 3 5 0
Ring-LWE
3= -10 mod 13
Random - Lattice
7𝑥4
ℤ13
Implements ring structure
11 10 9 12
We do not need to store all the matrix A…just the generator vector
Q(CaSC) / Johanna Sepúlveda 13
Summary
Identify Operations
Polynomial Multiplication
Polynomial Addition Schoolbook NTT
Karatsuba Toom–Cook
Discrete Sampling
Gaussian Trinary
Polynomial Addition
𝒗+𝒌=𝒄
Polynomial Addition
ℤ𝑞 𝑥
Parameters: q=5 𝑅= 𝑛
𝑥 +1
n=4
𝒗 = 4𝑥 3 + 2𝑥 2 + 1 = (4,2,0,1) 4 2 0 1
𝒌 = 2𝑥 3 + 𝑥 2 + 4𝑥 = (2,1,4,0)
2 1 4 0
6 3 4 1
𝑚𝑜𝑑 5
𝒄=𝒗+𝒌 1 3 4 1
𝒄 = 𝑥 3 + 3𝑥 2 + 4𝑥 + 1 = (𝟏, 𝟑, 𝟒, 𝟏)
0 0 0 0 0 0 0 0
16 8 0 4 8 0 4 -16
4 2 0 1 0 1 -4 -2
8 4 0 2 2 -8 -4 0
8 8 18 10 1 4 0 10 -7 -4 -18
𝑚𝑜𝑑 5
-8 -8 -18
𝑚𝑜𝑑 𝑥 𝑛 + 1
0 3 1 2 0 3 1 2
l = 3𝑥 2 + 𝑥 +Q(CaSC)
𝟐 =/ Johanna
(𝟎, 𝟑, 𝟏, 𝟐)
Sepúlveda 16
Summary
Polynomial
Multiplication
Number Theoretic Transform (NTT) ℤ𝑞 𝑥
𝑅= 𝑛
𝑥 +1
Discrete Fourier Transform (DFT) defined over a
finite field or ring
Bit Reversal
Cooley-Tukey
Q(CaSC) / Johanna Sepúlveda 19
Summary
𝑛−1
𝑖𝑗
𝑎𝑖 = 𝜔𝑛 ∙ 𝑎𝑗
𝑗=0 Butterfly
Operation
Knuth-Yao
Rejection
Sampling
SHAKE
Inversion
SHA-3
Cumulative
Keccak Distribution
Ziggurat Table (CDT)
PK (X25519)
KEM Encapsulation
Layered approach
X25519: 128-bits security Elliptic curve (ECDH)
PQ algorithm
QTesla
Frodo Round5
ThreeBears Crystals-
Dilithium
Post-Quantum
Cryptography
Main Principles
Families and Types
Standard
Main Components
Secure implementation
Use cases
I love We are
over!
you!
Unreliable/Noisy Channel
Repeat Imperfect
materials
Inefficient
Use unmistakable
words
NATO phonetic alphabet
Valid
codeword
Decoding Scheme
Message
Correction rules
Invalid
codeword
Codespace
Q(CaSC) / Johanna Sepúlveda 33
ECC
Generator
(Transformation)
Repetition Codes
Repeat Repeat Repeat
Can Bob correct the received message if there is
moreUnreliable/Noisy
than 1 error? Channel
Repetition Codes
Repeat Repeat Repeat
Unreliable/Noisy Channel
00101
(Transformation)
000 000 111 000 111
0 000 Valid
codeword
1 111
error
Parity Codes
Parity bit: Makes even
Repeat
the number of 1s
Repeat
Unreliable/Noisy Channel
Odd number of 1s elucidates an error
Generator: Alice will
Corrector: Bob uses
send 2 times the error the number of ones
information
Hamming Codes
Analog to NATO approach
In general:
Unreliable/Noisy Channel
Detect: k-errors when HD ≥ k+1
Correct: k-errors when HD ≥ 2k+1
Hamming Distance (HD): Number of bits that are different between
two bit string
String 1: 1101010
HD= 2
String 2: 1111000
Example:
Detect: 1A error B C D
000 011 101 110
HD= 2 HD= 2 HD= 2
Correct: Depends on HD
(010): A, B or D Q(CaSC) / Johanna Sepúlveda 38
ECC
Hamming Codes
Hamming Codeword: All bit positions that are power of 2 are
parity (P) bits (1,2,4,8,…), others are data (D) bits
Example: Use the Hamming code to encode the following bit string
10011010
1. Identify the parity and the data positions
P P D P D D D P D D D D
1 2 3 4 5 6 7 8 9 10 11 12
1 0 0 1 1 0 1 0
Hamming Codes
3. Calculate the parity bit. Position gives the check/skip positions
Parity 1: Check 1 bit, skip 1 bit, check 1 bit,.. (1,3,5,7,9,11 = ?,1,0,1,1,1= 0)
Parity 2: Check 2 bits, skip 2 bits, check 2 bits,.. (2,3,6,7,10,11 = ?,1,0,1,0,1= 1)
Parity 4: Check 4 bits, skip 4 bits, check 4 bits,.. (4,5,6,7,12 = ?,0,0,1,0= 1)
Parity 8: Check 8 bits, skip 8 bits, check 8 bits,.. (8,9,10,11,12 = ?,1,0,1,0= 0)
0 Number of 1s is even
1 Number of 1s is odd
P P D P D D D P D D D D
1 2 3 4 5 6 7 8 9 10 11 12
0 1 1 1 0 0 1 0 1 0 1 0
1 2 3 4 5 6 7 8 9 10 11 12
0 1 1 1 0 0 1 0 1 1 1 0
1. Calculate the parity bit and compare with the embedded value in the codeword
Calculate Parity 1: 1,3,5,7,9,11 = ?,1,0,1,1,1= 0 = Parity 1 in the codeword
Calculate Parity 2: 2,3,6,7,10,11 = ?,1,0,1,1,1= 0; Parity 2 in the codeword = 1
Calculate Parity 4: 4,5,6,7,12 = ?,0,0,1,0= 1 = Parity 4 in the codeword
Calculate Parity 8: 8,9,10,11,12 = ?,1,1,1,0= 1; Parity 8 in the codeword = 0
LINEAR CODES
Generator Matrix
𝑤 = 𝑚𝐺
Codeword
(high dimension)
Message vector
(low dimension)
Parity Matrix
0 = 𝑤𝑇 𝐻
Syndrome
0: Valid codeword
Otherwise: invalid codeword
Codeword transponse
(column)
Message abcd
Parity bits xyz
P P D P D D D
1 2 3 4 5 6 7
x y a z b c d
𝑥 = 𝒂⨁𝒃⨁𝒅
𝑦 = 𝒂⨁𝒄⨁𝒅
𝑧 = 𝒃⨁𝒄⨁𝒅
Q(CaSC) / Johanna Sepúlveda 45
Linear Codes
Matrix G
x y z
1 0 0 0 1 1 0
𝑤 = 𝒂𝒃𝒄𝒅 0 1 0 0 1 0 1
0 0 1 0 0 1 1
0 0 0 1 1 1 1
𝑥 = 𝒂⨁𝒃⨁𝒅
Identity Matrix 𝑦 = 𝒂⨁𝒄⨁𝒅
𝑧 = 𝒃⨁𝒄⨁𝒅
Q(CaSC) / Johanna Sepúlveda 46
Linear Codes
𝐻= 0 1 1 0 0 1 1
0 0 0 1 1 1 1
Number of rows = a b c d x y z
Number parity bits (3)
1 1 0 1 1 0 0
Systematic 1 0 1 1 0 1 0
representation 0 1 1 1 0 0 1
[I] Q(CaSC) / Johanna Sepúlveda 47
Linear Codes
b) Decode 1100010
c) Decode 1110010
d) Decode 1011101
(Decisional Problem)
In 2013, it was showed that “high rate” binary Goppa codes can be
distinguished from random linear codes. However it does not work at
Code-Based Cryptosystems
Codes
McEliece Niederreiter
Quasi-cyclic
Quasi-cyclic (QC)
Low Desity Parity Check
codes
(QC-LDPC) Q(CaSC) / Johanna Sepúlveda 54
Crypto
Code-Based Cryptosystems
Classic McEliece
Goppa BIKE
Short Hamming (MDPC)
NTS-KEM HQC
Goppa Short Hamming
LEDACrypt
Short Hamming (LDPC)
Rollo
LowLow Rank
Rank (LRPC)
RQC
Low Rank
Identify Operations
Polynomial Multiplication
Polynomial square/
square root
Discrete Sampling
Gaussian Trinary
McEliece Encryption
https://arxiv.org/pdf/1907.12754.pdf
Answer Quiz
ONLY Section 5 (pages 26-32) with the description of the protocol and the example.
Additional Links
Matrix calculator
https://www.mathsisfun.com/algebra/matrix-calculator.html
Implementation Codes
Code-based Cryptography: Implementing the McEliece Scheme on
Recongurable Hardware (Pages 37 - 48)
https://www.emsec.ruhr-uni-
bochum.de/media/crypto/attachments/files/2010/04/da_heyse.pdf
Next Lecture
Third Block
Hash
Hash-based Construction
PQC: Comparison
Valid
codeword
Decoding Scheme
Message
Correction rules
Invalid
codeword
Codespace
Q(CaSC) / Johanna Sepúlveda 5
Summary
Generator Matrix
Codeword
(high dimension)
Message vector
(low dimension)
Parity Matrix
Syndrome
0: Valid codeword
Otherwise: invalid codeword
Codeword transponse
(column)
(Decisional Problem)
In 2013, it was showed that “high rate” binary Goppa codes can be
distinguished from random linear codes. However it does not work at
Code-Based Cryptosystems
Codes
McEliece Niederreiter
(Signatures, Fast)
Quasi-cyclic
Quasi-cyclic (QC)
Low Desity Parity Check
codes
(QC-LDPC) Q(CaSC) / Johanna Sepúlveda 10
Summary
Code-Based Cryptosystems
Classic McEliece
Goppa BIKE
Short Hamming (MDPC)
NTS-KEM HQC
Goppa Short Hamming
LEDACrypt
Short Hamming (LDPC)
Rollo
LowLow Rank
Rank (LRPC)
RQC
Low Rank
Identify Operations
Polynomial Multiplication
Polynomial square/
square root
Discrete Sampling
Gaussian Trinary
Post-Quantum
Cryptography
Main Principles
Families and Types
Standard
Main Components
Secure implementation
Use cases
HASH
Hash Function
1 1 0 1 1 1 0
1 0 0 1 1 0 1 1 0 0
1 0 1 1 0 1 1 0 0
1 0 1 1 1 1 1 1 1
Q(CaSC) / Johanna Sepúlveda 15
Hash
Properties/Security bounds:
Collision resistance: It is computationally infeasible to find
any two distinct inputs that map to the same output
f Collision Resistance
D f
R
y
x
f
z
f -1
Preimage Resistance f -1
Second
Preimage Resistance
Collision Resistance
Assumptions
Security
Second
Preimage Resistance
Weaker Harder
to break
Q(CaSC) / Johanna Sepúlveda 18
Section 3
HASH-BASED CONSTRUCTION
Traditional Signatures
Factoring, discrete
logarithmic, SVP, ..
Digital Signature
Message
(plaintext)
Hashed
Function
Encryption Message
Secret
(key)
x y
h(x) h(y)
Winternitz OTS
Private key x
h(x)
Public key
h(h(h(x)))
Many key pairs are needed to sign lots of messages, and therefore some kind of key
management is required. A solution to cope with this situation was proposed by
Ralph Merkle in 1979
Q(CaSC) / Johanna Sepúlveda 23
Hash PQC
Parent
Child Siblings
Level 1
Level 1
L=1 Level 2
N=1
V=1 L=2
N=3
V=2
Level 1
Level 2
L=?
Level 3
N=?
V=?
In the MSS verification keys are hashed and build the leaves of
the tree
The root of the tree represents the public key of the scheme
M01= M23=
Hash function H(M0+M1)
Nodes H(M2+M3)
Leaf Nodes M0= H(m0) M1= H(m1) M2= H(m2) M3= H(m3)
Data m0 m1 m2 m3
Root
Hash M0 M1 M2 M3 M4 M5 M6 M7
Data m0 m1 m2 m3 m4 m5 m6 m7
My data is not
tampered!
Alice Bob
Q(CaSC) / Johanna Sepúlveda 29
Hash PQC
Alice Bob
Hash m2
Appends other hashes (7)
Calculate root (calculated)
Compare root (calculated, received)
M07
M03 M47
M0 M1 M2 M3 M4 M5 M6 M7
m0 m1 m2 m3 m4 m5 m6 m7
Alice Bob
Key Generation:
Generate N private, public key pairs (Xi, Yi)
Alice Bob
Hash m2
Appends other hashes
Calculate root (calculated)
Compare root (calculated, received)
Alice Bob
p air
y re
ke atu
w
Ne r sig
n Stateful hash-based Stateless hash-based
pe signature Q(CaSC) / Johanna Sepúlveda signature 34
Hash PQC
MSS Considerations
For each new signature generated the next key pair must be used
MSS is a stateful scheme: the index of the used key pair (respectively
leaf) of the MSS tree must be stored
XMSS
Winternitz OTS
Q(CaSC) / Johanna Sepúlveda 36
Hash PQC
XMSS Implementation
Based on publicly
verifiable index selection
Select FTS
Sign message with FTS
Build parent tree
Use tree to sign the pk
First NIST
18 3 9 2 32
Round
Second NIST
7 2 4 1 12
Round
Third NIST
Round 1 - 1 - 5
(Finalists)
Third NIST
Round 2 1 2 1 2
(Alternate)
NIST Competition
PQC Taxonomy
Stateless
hash-based
signature
Next Lecture
Third Block
Post-Quantum
Cryptography
Summary / Q&A (PQC)
Main Principles
Families and Types
Main Components
Standard
Secure implementation
Use cases