Update for 31-01-22 14:38

This commit is contained in:
Tyler Perkins 2022-01-31 14:38:26 -05:00
parent 47a05238ac
commit 8fd193d02b
2 changed files with 29 additions and 2 deletions

View File

@ -1 +1,6 @@
= Diffie Helman = = Diffie Helman =
Diffie Helman is a secret sharing algorithm where a shared secret can be
created between two parties via an unsecure channel.

View File

@ -18,12 +18,34 @@ large prime numbers.
* n and e are public keys * n and e are public keys
* n and d are private keys * n and d are private keys
=== encryption ===
`(plaintext value)^e mod N = ciphertext value`
=== decryption ===
`(ciphertext value)^d mod N = plaintext vlaue`
=== example === === example ===
p = 2; q = 7 `p = 2; q = 7`
therefore, therefore,
n = 14; T = 6 `n = 14; T = 6`
Due to restrictions, choose e = 5 Due to restrictions, choose e = 5
Then choose d from pool of canidiates satisfying `(e * d) mod T = 1`
For example then, choose 14 as d
Private key `(11,14)` and public key `(5,14)`
For example Encrypt B
`2^5 mod 14 = 4` or `D`
Decrypt value
`4^11 mod 14 = 2` or our original `B`