use of org.spongycastle.crypto.engines.Salsa20Engine in project KeePassDX by Kunzisoft.
the class PwStreamCipherFactory method getSalsa20.
private static StreamCipher getSalsa20(byte[] key) {
// Build stream cipher key
byte[] key32 = CryptoUtil.hashSha256(key);
KeyParameter keyParam = new KeyParameter(key32);
ParametersWithIV ivParam = new ParametersWithIV(keyParam, SALSA_IV);
StreamCipher cipher = new Salsa20Engine();
cipher.init(true, ivParam);
return cipher;
}
Aggregations