MCPcopy Create free account
hub / github.com/TrsstProject/trsst / _cryptBytesAES

Method _cryptBytesAES

src/main/java/com/trsst/Crypto.java:121–127  ·  view source on GitHub ↗
(byte[] input, byte[] key,
            boolean forEncryption)

Source from the content-addressed store, hash-verified

119
120 // h/t Steve Weis, Michael Rogers, and liberationtech
121 private static byte[] _cryptBytesAES(byte[] input, byte[] key,
122 boolean forEncryption) throws InvalidCipherTextException {
123 assert key.length == 32; // 32 bytes == 256 bits
124 return process(input, new PaddedBufferedBlockCipher(new CBCBlockCipher(
125 new AESEngine())), new KeyParameter(key), forEncryption);
126 // note: using zero IV because we generate a new key for every message
127 }
128
129 // h/t Adam Paynter http://stackoverflow.com/users/41619/
130 private static byte[] process(byte[] input,

Callers 2

encryptAESMethod · 0.95
decryptAESMethod · 0.95

Calls 1

processMethod · 0.95

Tested by

no test coverage detected