Abir encrypts using Bechir's public key
Bechir decrypts using his private key
How does that work
What the heck is phi(n)?
That's the euler totient
How does it work?
Euler proved that:
Ok.. How to generate keys ?
Choose two large prime numbers p and q.
And calculate N
Calculate the euler totient
Choose randomly the public exponent e such that:
Calculate d such that
Fifth step profit
Publish your publish key:
And keep your private key on your computer:
All this is fine how to do this?
if you find p and q you can:
- Calculate phi(n)
- Calculate d
If you determine phi(n) you can calculate d.
You can decrypt messages then, welp..
Determine messages directly
You can determine messages sharing a common public exponent quite easily
If N is small
Use a fast a factorization algorithm :)
If N is big ~ > 512 bits
Compute it using shor's algorithm on quantum computer, shrug …
What if p and q are close?
Use fermat theorem for factorizing.
What if d is small
Use wiener attack
This only works if:
What if recipients share a common modulus
Diffie Hellman Key exchange
A and B are exchanged
Wut? How does this work
And Bechir does:
How to attack this?
To solve DHP you have to solve DLP (which is hard).
But methods exist.