salsa20Decrypt method

String salsa20Decrypt(
  1. String secretKey,
  2. Encrypted encryptedValue
)

Decrypts encryptedValue using Salsa20 decryption with the provided secretKey.

secretKey is the key used for decryption. encryptedValue is the data to be decrypted. Returns the decrypted value as a string.

Implementation

String salsa20Decrypt(String secretKey, Encrypted encryptedValue) {
  final key = Key.fromLength(32);
  final iv = IV.fromLength(8);
  final encrypter = Encrypter(Salsa20(key));

  return encrypter.decrypt(encryptedValue, iv: iv);
}