fix
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit

This commit is contained in:
Scott E. Graves 2025-03-20 13:49:11 -05:00
parent 29fb70149c
commit bdb8f0aac9

View File

@ -256,13 +256,15 @@ String encryptValue(String value, String password) {
}
final keyHash = sodium.crypto.genericHash(
outLen: sodium.crypto.aeadChaCha20Poly1305.keyBytes,
outLen: sodium.crypto.aeadXChaCha20Poly1305IETF.keyBytes,
message: Uint8List.fromList(password.toCharArray()),
);
debugPrint("key: ${base64Encode(keyHash)}");
final crypto = sodium.crypto.aeadXChaCha20Poly1305IETF;
final nonce = sodium.secureRandom(crypto.nonceBytes).extractBytes();
debugPrint("nonce: ${base64Encode(nonce)}");
final data = crypto.encrypt(
additionalData: Uint8List.fromList('repertory'.toCharArray()),
key: SecureKey.fromList(sodium, keyHash),