DES Key - Client Side

V

v8killah03

Hi,

Can anyone please help me with the following? 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's server. I've started the
program, but am not sure where else to go with it. Any help is greatly
appreciated.

Thanks,
James

Code:
import java.io.*;
import java.net.*;
import java.security.*;
import javax.crypto.*;

public class Cipher
{
public static void 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
}
}
 
R

Roedy Green

Hi,

Can anyone please help me with the following? 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's server. I've started the
program, but am not sure where else to go with it. Any help is greatly
appreciated.

Thanks,
James

Code:
import java.io.*;
import java.net.*;
import java.security.*;
import javax.crypto.*;

public class Cipher
{
public static void 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
}
}

See http://mindprod.com/jgloss/encryption.html

The Feghi book has lots of code examples.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,265
Messages
2,571,069
Members
48,771
Latest member
ElysaD

Latest Threads

Top