Formulae Flashcards
How to initialize an RSA ?
— choose p, q prime numbers
— compute n = p×q and z = (p-1)×(q-1)
— choose an integer e such that 1<e<z and e, z share no other divisor than 1
— find d such that e×d - 1 mod z = 0
xy mod p = ?
(Useful modulo trick)
xy mod p = [(x mod p)(y mod p)] mod p
Outline the parameters of Diffie-Hellman
Xa, Xb = private keys
Ya, Yb = public keys
Kab = shared secret key
How to initialize a Diffie-Hellman (starting from alpha, q) ?
Each peer chooses their private key (Xa, Xb)
Ya = alphaXa mod q
Yb = alphaXb mod q
Kab = alphaXa×Xb mod q = YaXb mod q = YbXa mod q
How to define and use a Hill cipher ?
Define K, square matrix n × n
q prime number
P = message, or a chunk of the message of length n
C = K × P mod q (as many times as needed to cover all the chunks of the original message)
How to cipher using RSA ?
C = Me mod n
How to decipher using RSA ?
M = Cd mod n