Skip to content

Commit 017c3f4

Browse files
committed
#1 | The nonce isn’t being initialized properly
1 parent cb73ce3 commit 017c3f4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Crypto.AES/Public/Protect-Data.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ function Protect-Data {
2121
Write-Verbose "Cmdlet Protect-Data - Process"
2222
if (!$Nonce) {
2323
$Nonce = [byte[]]::new(12)
24+
[System.Security.Cryptography.RandomNumberGenerator]::Fill($Nonce)
2425
}
2526
$cipherOutput = [byte[]]::new($Data.Length)
2627
$tag = [byte[]]::new(16)

0 commit comments

Comments
 (0)