//-------------------------------------------------------------------------
private static byte[] encryptNonce(byte[] key, byte[] nonce) {
byte[] out = new byte[24];
DESEngine d1 = new DESEngine(true, makeDESkey(key, 0));
DESEngine d2 = new DESEngine(true, makeDESkey(key, 7));
DESEngine d3 = new DESEngine(true, makeDESkey(key, 14));
d1.processBlock(nonce, 0, out, 0);
d2.processBlock(nonce, 0, out, 8);
d3.processBlock(nonce, 0, out, 16);
return out;
}