Advertisement
lurker69

RSA quickrundown

Apr 5th, 2018
10,408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. p and q are primes that are randomly chosen and used to create public and private key
  2. e1 private key
  3. e2 public key
  4.  
  5. p=7 q=11 generates keys: e1=13 e2=37
  6. n = pq = 77 (gets used at encryption and decryption as [mod n])
  7.  
  8. necessary verification assuring that encryption and decryption will work with this two primes and two keys
  9. (7-1)(11-1)=60 (gets used at verification as [mod 60] that has to be 1)
  10. 13 mod 60 x 37 mod 60 = 481 mod 60 = 1
  11.  
  12. Example:
  13. decrypted message: 2
  14. encrypted message: 30
  15.  
  16. encryption: e1 2^13 = 30 mod 77 = 30
  17. decryption: e2 30^37 = 2 mod 77 = 2
  18.  
  19.  
  20.  
  21. RSA calculator (key creation and encryption)
  22. https://www.cs.drexel.edu/~jpopyack/IntroCS/HW/RSAWorksheet.html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement