public class IDEA {private )yte [] Encrypt (byte [ ] bytekey, byte [ ] inputBytes, boolean flag) {//每一轮加密函数byte [ ] encryptCode = new byte [8];int [ ] key = get_subkey ( flag, bytekey ) ; // 分解子密钥encrypt (key , inputBytes, encryptCode ) ; // 进行加密操作 return encryptCode; // 返回加密数据}return ( (inBytes[startPos ]〉〉8 );outBytes[startPos + 1] =(byte) inputInt;}private int x_multiply_y( int x, int y ) (//乘法运算 if (x == 0){x = 0x101 —y;} else if (y == 0 ){x = 0x101 —x;} else {int tmp = x * y;y = tmp & 0xffff;x = tmp >〉> 16;x = (y —x ) + ( (y < x)
1 : 0);}return x & 0xffff ;)private void encrypt( int [] key , byte [] inbytes, byte [ ] outbytes) ( //对称算法,加解密用一个函数操作 int k = 0;int a = bytesToInt(inbytes , 0) ; // 将 64 位 明 文 分 为 四 个 子 块 int b = bytesToInt ( inbytes, 2);int c = bytesToInt(inbytes, 4);priv