Closed phanirithvij closed 4 years ago
Yep we do something like this.
Uint8List enc = await SecretBox.encryptBytes(
await file.readAsBytes(),
nonce,
key,
);
await file.writeAsBytes(<int>[]);
await file.writeAsBytes(enc);
Uint8List decryptedBytes = await SecretBox.decryptBytes(
await file.readAsBytes(),
nonce,
key,
);
I know I can set a custom key but what is nonce could you please clarify?
And what is this line doing?
await file.writeAsBytes(<int>[]);
Please see the official libsodium documentation at https://libsodium.gitbook.io/doc/
Is it possible to encrypt and decrypt files using this package?