opensshKeyCrypt function
Implementation
Uint8List opensshKeyCrypt(bool forEncryption, Uint8List password,
Uint8List salt, int rounds, Uint8List input, int cipherAlgo) {
int keySize = Cipher.keySize(cipherAlgo),
blockSize = Cipher.blockSize(cipherAlgo);
Uint8List key = bcryptPbkdf(password, salt, keySize + blockSize, rounds);
BlockCipher cipher = Cipher.cipher(cipherAlgo);
cipher.init(
forEncryption,
ParametersWithIV(KeyParameter(viewUint8List(key, 0, keySize)),
viewUint8List(key, keySize, blockSize)));
return applyBlockCipher(cipher, input);
}