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) & 0xff) +(inBytes [ startPos + 1] & 0xff );private void intToBytes ( int inputInt, byte [] outBytes , int startPos) {//字节转换为二进制数组 outBytes[startPos ] = (byte) (inputInt >〉〉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);private int bytesToInt( byte [] inBytes,int startPos)〃二进制数组转换为字节int d = bytesToInt ( inbytes, 6 );int tmp1 = b;int tmp2 = c;c A= a;// (5)b A= d;// ( 6)c = x_multiply_y (c, key[k++ ] ); // ( 7 )b += c;// ( 8)b &= 0xffff;(d, key [k]), outbytes , 6 );private int [ ] encrypt_subkey( byte [] byteKey ){//加密时子密钥产生过程int [ ] key = new int [52];if (byteKey. length 〈 16) {byte [] tmpkey = new byte [16];System. arraycopy (byteKey, 0, tmpkey ,tmpkey. length —byteKey。length , byteKey。length);byteKey = tmpkey;for (int i = 0 ; i=x_multiply_y(a,+= key [ k++ ];&= Oxffff;+= key [ k++];&= Oxffff ;=x_multiply_y< 8 ;key(d,i++ ) { //八轮循环开始[k++]...