RSA encryption

     

Scenario:

Create a RSA public/private key for parties to communicate securely.

Solution:



Example: If Ram and Shyam wants to share messages securely they would use below algorithm RSA
  1. Generate Keys

  2. --It uses 3 numbers. 
    
    -p: which is a large prime number
    
    -q: which is a large prime number. 
    
    -e: An exponent, which is small, odd and coprime (1<e<(p-1)*(q-1)).
    Steps: 1. N = p * q. This is half public key 2. e = 1 <e <(p-1)*(q-1). It could be 3. This is other half of public key 3. d (mod inverse) = (d * e) % N = 1. The d is the private key. 4. The receiver will distribute, #1 and #2 and keep 3 secret.
    Ex: Ram will select p and q to start with. p = 11 q = 17 N = p * q = 11 * 17 = 187. e = 1 < e < (11-1) * (17-1) = 170 = 3 d = 321 = 1(160) = 107 Public Key = (3, 187) - This is shared with Shyam. Private Key = (107,187) - This is stored secretly by Ram.

No comments:

Post a Comment

Move Github Sub Repository back to main repo

 -- delete .gitmodules git rm --cached MyProject/Core git commit -m 'Remove myproject_core submodule' rm -rf MyProject/Core git remo...