Katy Moe
intro to crypto
the RSA algorithm
mathematical concepts
key generation
signing, encryption/decryption
THIS IS A SECRET MESSAGE TO BE XORED WITH A SECRET KEY TO PRODUCE A CIPHERTEXT. THIS IS CALLED ENCRYPTION.
plaintext
HSD0472B1VX8V5BLR02010DHCV8B6W25N6KGBJV9SYS9C6 5BOG98383BY398Y98FR9GBBV2964783NHJFIFNJB90N7480
9GFGJFHGD76FVB2C1SD1SA2P408G00ZXBVB302479DHFJHAA83T1VSNXYBV8B9CBVA7F5395GKVBQ9X8GK2N1V49V09
+
=
key
ciphertext
Bob wants to send a box to Alice.
Alice and Bob each have a distinct padlock and key (i.e. Alice has key which fits only her padlock, and Bob has a key which only fits his). Bob wants to lock a box and send it to Alice, but doesn't want Eve (who can intercept the package) to be able to open it. Eve has no padlocks or keys.
Alice and Bob can send messages to each other, as well as padlocks, keys, and boxes. A box is locked by attaching a padlock to it - the key is only required for unlocking. How can Bob send the box to Alice without Eve getting access to the contents?
Alice
Eve
Bob
H487SBFK593OSFH0N8BLSK4278SBTOB9P
Bob
Alice
+ Alice's public key
+ Alice's private key
Hello, Alice!
Hello, Alice!
2, 3, 5, 7, 11, 13, 17, 19, 23, 29...
12 = 3 x 2 x 2
330 = 11 x 5 x 3 x 2
12 = 3 x 2 x 2
35 = 7 x 5
17 ≡ 5 (mod 12)
125 ≡ 5 (mod 12)
ϕ(4) = 2
ϕ(7) = 6
ϕ(2) = 1
a ≡ 1 (mod p)
p - 1
Large Primes: Generate two large prime numbers, p and q.
For message m and key k:
F(m,k)= m (mod n)
k
Alice encrypts the ciphertext with her own private key and sends this along with the ciphertext to Bob.
Bob decrypts the signature with Alice's public key and checks whether it matches the ciphertext.
Resources
Encryption in JavaScript
RSA