1

I am developing an encryption application but I do not have good ideas about how exchange the private key as securely around the internet. I have some simple ideas like combine some data with client's mac address + minute but I do not mind it will work correctly. Could you guide me?

I need something that is exchanging the keys like Tor.

4

Do not attempt to implement key exchange on your own. You should be using a standard library which makes this easy, such as libsodium. See the documentation on how to do that.

1

The purpose of asymmetric encryption is to eliminate the key exchange problem entirely. With public key crypto, you can publish your public key without concern. However, your private key should remain private and should not be transferred. I would highly recommend getting a grasp on public key cryptography, and as was stated in a previous answer, do not attempt to come up with your own cryptographic algorithm. Use a well-tested solution.

  • 1
    It does not eliminate the key exchange problem, but solves it. When you send encrypted data, it is first encrypted with a symetric encryption algo and a random key, then the symetric key in encrypted with the public key of the recipient. Both the encrypted data (symetric encryption) and the encrypted random key (asymetric encryption) and sent. Then the recipient decrypts the random key with its own private key and at the end decrypts the payload. It may look complex, but asymetric encryption does not suit well with large data. – Serge Ballesta Dec 20 '17 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.