Open aaaaaaanthony opened 3 years ago
@Override
protected StreamCipher createCipher(byte[] iv, boolean encrypt) throws CryptoException {
GCMBlockCipher cipher = new GCMBlockCipher(new AESEngine());
AEADParameters parameters = new AEADParameters(new KeyParameter(mKey), 128, iv, null);
cipher.init(encrypt, parameters);
}
GCMBlockCipher
不继承StreamCipher
...
@Override protected StreamCipher createCipher(byte[] iv, boolean encrypt) throws CryptoException { GCMBlockCipher cipher = new GCMBlockCipher(new AESEngine()); AEADParameters parameters = new AEADParameters(new KeyParameter(mKey), 128, iv, null); cipher.init(encrypt, parameters); }
GCMBlockCipher
不继承StreamCipher
...
嗯嗯,gcm属于认证加密,确实不能简单基于原来的加密方法来扩展了
目前aes只支持了cfb以及ofb两种模式,gcm还不支持,但很容易进行支持,只需要在现有AESCrypto 类上进行简单地扩展即可