DES Key - Client Side

Hi,

I would like to be able to generate a DES key, store it in a file, and use the key to encrypt my message and send it to my friend抯 server. I抳e started the program, but am not sure where else to go with it. It抯 on the next post. Any help is greatly appreciated.

Thanks,

James

import java.io.*;

import java.net.*;

import java.security.*;

import javax.crypto.*;

publicclass Cipher

{

publicstaticvoid main(String[] args)throws Exception

{

String message ="Hi John, here is the first message.";

String host ="xxx.xxx.xxx";

int port = 7999;

Socket s =new Socket(host, port);

//Help here

// DES key.

//Storage of DES key

// Encrypt the message using the key and send it to the server

}

}

[1508 byte] By [Ohio2005a] at [2007-10-2 6:14:07]
«« BigInteger
»» Newbie
# 1
Keystore may be able to help you - although I haven't had any experience with it yet, so let me know how you get on.
_bensmytha at 2007-7-16 13:15:36 > top of Java-index,Security,Cryptography...
# 2
Please excuse my ignorance, but what is keystore?Thanks,James
Ohio2005a at 2007-7-16 13:15:36 > top of Java-index,Security,Cryptography...
# 3
You might to better with the Diffie-Hellman (DH) key exchange or you could just use SSL/TLS .
sabre150a at 2007-7-16 13:15:36 > top of Java-index,Security,Cryptography...
# 4
> Please excuse my ignorance, but what is keystore?Search the web! http://www.unix.org.ua/orelly/java-ent/security/ch11_01.htmI can't really comment, because I have yet to use it.
_bensmytha at 2007-7-16 13:15:36 > top of Java-index,Security,Cryptography...