我正在尝试使用 IGE 解密 AES-256。但我不知道如何使用 256 位密钥。
在代码键中-长度== 32的字节 [] ;四。长度== 32; 块大小== 16
Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding");
cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(key, "AES"));
Xprev = java.util.Arrays.copyOfRange(IV, 0, BlockSize);
Yprev = java.util.Arrays.copyOfRange(IV, BlockSize, IV.length);
Decripted = new byte[0];
for (int i = 0; i < Message.length; i += BlockSize) {
Y = java.util.Arrays.copyOfRange(Message, i, i+BlockSize);
X = XOR(cipher.doFinal(XOR(Y,Xprev)), Yprev);
Xprev = X;
Yprev = Y;
Decripted = sumBytes(Decripted, X);
}