{
login("jduke", "secret".toCharArray());
System.out.println("Logged into server");
byte[] kbytes = client.getSessionKey();
System.out.println("Session key size = "+kbytes.length);
SecretKeySpec clientKey = new SecretKeySpec(kbytes, "Blowfish");
System.out.println("clientKey");
Cipher cipher = Cipher.getInstance("Blowfish");
cipher.init(Cipher.ENCRYPT_MODE, clientKey);
SealedObject msg = new SealedObject("This is a secret", cipher);
// Now use the server key to decrypt the msg
byte[] skbytes = server.session.getSessionKey();
SecretKeySpec serverKey = new SecretKeySpec(skbytes, "Blowfish");
Cipher scipher = Cipher.getInstance("Blowfish");
scipher.init(Cipher.DECRYPT_MODE, serverKey);
String theMsg = (String) msg.getObject(scipher);
System.out.println("Decrypted: "+theMsg);