ka.init(privateKey);
ka.doPhase(publicKey, true);
byte[] secret = ka.generateSecret();
MessageDigest sha = MessageDigest.getInstance(DIGEST);
byte[] hash = sha.digest(secret);
byte[] symKey = new byte[keySize / 8];
System.arraycopy(hash, 0, symKey, 0, symKey.length);
return SymmetricCryptor.getSymmectricCryptor(symKey);
} catch (NoSuchAlgorithmException e) {
throw new CryptoException(e);