Tell me more ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

I want to encrypt my data using the Diffie hellmen key agreement protocol. i have to implement it in java can some one help me with a example programs of how we can implement it in java

share|improve this question
Do you actually want to secure data with it, or is this just an exercise? If you actually want security, then you should use an existing library instead of implementing it yourself. – CodesInChaos Nov 8 '12 at 11:52
ok can you give me an example of how we can do that – user1209 Nov 8 '12 at 12:16
First off, you don't encrypt with Diffie-Hellman. You exchange a key with Diffie-Hellman which can then be used for encryption using say AES or some other symmetric cipher. So, what exactly are you trying to implement? Are you trying to implement Diffie-Hellman or a program that uses a DH library to do key exchange and an AES library to do the encryption? – mikeazo Nov 8 '12 at 12:25
i am trying to generate keys using DH with AES algorithm to encrypt the data can you help with a example – user1209 Nov 8 '12 at 12:41
you cannot generate keys using DH, and correct your question, using DH you cannot encrypt data using key agreement protocol, read about it first , rather than asking arbitrarily. If you are looking for quick code for something which you don't know what it should do this is not the place – sashank Nov 8 '12 at 19:12
show 1 more comment

closed as not a real question by PaĆ­lo Ebermann Nov 8 '12 at 20:25

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

Browse other questions tagged or ask your own question.