Elliptic curve cryptography
What is an elliptic curve?*
*there are other types
Weierstrass form
No singular curves
What is an elliptic curve?
Point addition
Back to real life. Finite fields
Division
Curve equation
Point scalar multiplication
How to find the number of points on the curve?
How to find the number of points on the curve?
Schoof’s algorithm
What is an elliptic curve system? 2.0
It is a cyclic subgroup defined over some elliptic curve.
Its order is n.
It has a base point G, also called generator.
Cofactor h=N/n is always integer.
Cyclic subgroup
If we add P to itself multiple times, we will eventually result in zero (infinity) element.
P(3,6) - subgroup base point or generator
k = order of this subgroup or order of P
Order of P is the smallest integer n <= N such as n*P=0
How to generate subgroup?
Summary
ECC algorithms work on a cyclic subgroup of an elliptic curve over a finite field.
Needed parameters:
Tasks time!
Imagine Q=n*P
How can we calculate n from Q?🤔
Imagine Q=n*P
How can we calculate n from Q?🤔 == discrete logarithm problem
Solutions
Solutions
Solutions
Pollard’s rho
Pollard’s rho
Tortoise and hare algorithm
Real stuff
ECDH — elliptic curve Diffie-Hellman
ECDH, problems
ECDHE
ECDHE == ECDH Ephemeral
Each party generates new key pair every time they want to exchange keys.
Preferred way to exchange keys, used in TLS
ECDSA — elliptic curve digital signature algorithm
0. z = HA = hash(message) mod n
The pair (r, s) is the signature
ECDSA — verification
If r == xP mod n, then signature is valid
If k is the same
If k is the same
If k is the same
If k is the same
Tasks time!
Other curve formats
Not today/other interesting stuff
How to solve ECC/crypto tasks on CTFs?
PRNGs
Pseudo Random Number Generators
What is a PRNG?
PRNG :)
seed
number/byte
LCG — Linear Congruential Generator
Breaking LCG
Breaking LCG
Case 1: everything known
Case 2: unknown increment
Case 3: unknown increment and multiplier
Case 4: everything unknown
😢🔮
Case 4: everything unknown
There is a high probability that gcd(m*n) == m
Case 4: everything unknown🤔
Case 4: everything unknown🤔
LFSR — Linear Feedback Shift Register
Mersenne twister
MT19937
MT19937 — period is 2^19937-1
=> Need to observe 624 values to recover seed
we did it🔫
References