Search code examples
javaencryptionrsaencryption-asymmetricsecret-key

how does RSA distribute keys to the sender and receiver?


I'm working on a cryptography project that involes using RSA encryption algorithm, i have implemented the RSA algorithm and understand it, but how can i securely send the private key to the receiver?


Solution

  • When using asymmetric encryption you NEVER send the private key to the receiver. The receiver has your public key to decrypt your message encrypted with your private key.

    Other way could be that you encrypt with the receivers public key and only he can decrypt the message with his private key.

    So asymmetric encryption means to NEVER give your private key of hand.