fix
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
This commit is contained in:
parent
29fb70149c
commit
bdb8f0aac9
@ -256,13 +256,15 @@ String encryptValue(String value, String password) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final keyHash = sodium.crypto.genericHash(
|
final keyHash = sodium.crypto.genericHash(
|
||||||
outLen: sodium.crypto.aeadChaCha20Poly1305.keyBytes,
|
outLen: sodium.crypto.aeadXChaCha20Poly1305IETF.keyBytes,
|
||||||
message: Uint8List.fromList(password.toCharArray()),
|
message: Uint8List.fromList(password.toCharArray()),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
debugPrint("key: ${base64Encode(keyHash)}");
|
||||||
final crypto = sodium.crypto.aeadXChaCha20Poly1305IETF;
|
final crypto = sodium.crypto.aeadXChaCha20Poly1305IETF;
|
||||||
|
|
||||||
final nonce = sodium.secureRandom(crypto.nonceBytes).extractBytes();
|
final nonce = sodium.secureRandom(crypto.nonceBytes).extractBytes();
|
||||||
|
debugPrint("nonce: ${base64Encode(nonce)}");
|
||||||
final data = crypto.encrypt(
|
final data = crypto.encrypt(
|
||||||
additionalData: Uint8List.fromList('repertory'.toCharArray()),
|
additionalData: Uint8List.fromList('repertory'.toCharArray()),
|
||||||
key: SecureKey.fromList(sodium, keyHash),
|
key: SecureKey.fromList(sodium, keyHash),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user