Skip to content

Commit 30f451e

Browse files
committed
docs: Add fixme to use random nonce
1 parent 80c31a6 commit 30f451e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/secret-contracts-scripts/src/functions/secretpath/encryptPayload.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ export async function encryptPayload(
5959
nextNonceNum: any,
6060
) {
6161

62+
// FIXME: generate a nonce for ChaCha20-Poly1305 encryption. stream cipher encryptions are only secure with a random nonce
63+
// Reference: https://docs.scrt.network/secret-network-documentation/confidential-computing-layer/ethereum-evm-developer-toolkit/usecases/vrf/using-encrypted-payloads-for-vrf#signing-the-payload-with-metamask
6264
let nextNonceUint8Array: Uint8Array = numToUint8Array(nextNonceNum);
6365
console.log("nextNonceUint8Array: ", nextNonceUint8Array);
6466
console.log("uint8ArrayToNumV2: ", uint8ArrayToNumV2(nextNonceUint8Array));

0 commit comments

Comments
 (0)