Variables #
$p=$ prime $q=$ other prime $n=p q $e=$ private key $d=$ public key #
encrypted message: $m = 2000_{dec}$
private key: $d = 13_{dec} = 1101_{bin}$
Decomposing binary into it significant digits $d_i$. Least significamt digit $d_0$ is the right most.
$$d = (2^31) + (2^21) + (2^10) + (2^01)$$ $$d = \sum_{i=0}^{n-1} {d_i*2^i}$$
Where $d_i$ is the $i^{th}$ significant digit. 0 is least significant (LSD 🌀), right to left
https://en.wikipedia.org/wiki/Modular_exponentiation
Encrypting a message #
$$c = m^e mod(n)$$
Decrypting a message (m) with private key (p) #
$$t = c^d*mod(n)$$
last updated: