Generating #rsa Private and Public Keys
▻https://hackernoon.com/generating-rsa-private-and-public-keys-b82a06db6d1c?source=rss----3a8144
We use SSH, HTTPS, etc., on a daily basis. These programs depend on RSA asymmetric key encryption and decryption for providing #security.Asymmetric key encryption involves two keys, public key and private key. Public key is used for encrypting the message and Private key is used for decrypting the message.In this post, we will look into how a public key and private key pair are generated using simple mathematics.We will use small numbers for simplicity.Public Key ( e, n )Public key is made up of two numbers called e and n.Generation of nGenerate two prime numbers.Prime number 1, p = 7Prime number 2, q = 17n = p x qn = 7 x 17 = 119Thus n = 119Generation of eCompute totient of n, ϕ(n) = ( p -1) x (q -1)Choose a random prime number that has a greatest common divisor (gcd) of 1 with ϕ(n)ϕ(n) = ( 7 — 1 (...)