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

Similar Threads

Error with server 3
Python client/server that reads HTML body from server 1
ruby des encrypt 1
Triple DES Perl to Java 6
SSL client program 20
Java socket programming 1
Output confusion 2
Hostname verifier in JAVA 0

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,104
Latest member
LesliVqm09
Top