Add digital signature

This commit is contained in:
Miloslav Ciz 2022-01-14 22:22:28 -06:00
parent 4e4eaff6bc
commit cf9b87dc08
2 changed files with 33 additions and 0 deletions

24
rsa.md Normal file
View file

@ -0,0 +1,24 @@
# RSA
TODO
generating keys:
1. *p := large random prime*
2. *q := large random prime*
3. *n := p * q*
4. *f := (p - 1) * (q - 1)* (this step may differ in other versions)
5. *e := 65537* (most common, other constants exist)
6. *d := solve for x: x * e = 1 mod f*
7. *public key := (n,e)*
8. *private key := d*
message encryption:
1. *m := message encoded as a number < n*
2. *encrypted := m^e mod n*
message decryption:
1. *m := encrypted^d mod n*
2. *decrypted := decode message from number m*