dcsimg
How do I encrypt/decrypt a message using Diffie-Hellman Public Keys that have already been created?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Kenji_Hollis
Posted On:   Sunday, August 25, 2002 10:59 PM

How do I encrypt/decrypt a message using Diffie-Hellman Public Keys that have already been created? I have looked through several examples, and have not found results that will work for me. My guess is that one side has to generate a key on the fly for the other side to use, but if this is the case, this will just simply not work at all. I need an example that will do the following: Load in a public/private key from file system Accept the other side's PUBLIC key as a parameter in Base64 format. Encrypt a message with the public key and send it back. The other side then checks the encrypted message, and decrypts it. Both   More>>

How do I encrypt/decrypt a message using Diffie-Hellman Public Keys that have already been created? I have looked through several examples, and have not found results that will work for me.


My guess is that one side has to generate a key on the fly for the other side to use, but if this is the case, this will just simply not work at all.


I need an example that will do the following:


  • Load in a public/private key from file system
  • Accept the other side's PUBLIC key as a parameter in Base64 format.
  • Encrypt a message with the public key and send it back.
  • The other side then checks the encrypted message, and decrypts it.


    Both keys are already generated, and stored on either side. Server has its own public/private key, and the other side has its own public/private key. The server loads in the public and private key, but the server only receives the public key of the other side, and encrypts using that.


    I'm stuck. I'm hopelessly stuck. I've sat at this problem for two days straight (16 hours of coding) and I still cannot figure this out. I even have the Java Cryptography book. I STILL can't figure this out.


    SOMEBODY, PLEASE HELP ME!


    If I can find an example that shows how to encrypt and decrypt data from public keys that are static files on the filesystem, that is what I'm looking for.


    Thank you in advance.

  •    <<Less

    Re: How do I encrypt/decrypt a message using Diffie-Hellman Public Keys that have already been created?

    Posted By:   Christopher_Koenigsberg  
    Posted On:   Monday, August 26, 2002 07:29 AM

    My guess is that one side has to generate a key on the fly for the other side to use, but if this is the case, this will just simply not work at all.



    I do think you are right -- the original Diffie-Hellman algorithm, if I am not mistaken, uses the public/private keys just as a mechanism to solve the problem, of how to securely distribute the shared secret symmetric key (e.g. a one-time password, for DES or whatever), for the session.



    The reason that symmetric encryption/decryption is still used for the actual session content is that it is much faster than any method of using asymmetric (public/private) keys for encryption/decryption.



    I think you will find that PGP/GPG do it this way.

    About | Sitemap | Contact