- import java.io.*;
- import java.net.*;
- public class KarnTestClient {
- BufferedReader in;
- PrintWriter out;
- DiffieHellmanExchange dhe = null;
- // Use Diffie Hellman to create a shared secret
- try {
- dhe = new DiffieHellmanExchange("DHKey");
- }
- try {
- // Connect to the server
- // Build a Karn encryptor from the shared secret
- Karn karn = new Karn(dhe.computeSecret(in, out));
- // Encrypt plaintext from the command line and send it to Server
- out.println(ciphertext);
- // Leave
- }
- }
- }
Raw Paste