Last active
August 7, 2024 10:35
-
-
Save lennybacon/9fcce97f84d1b760e8da0e9d0738536a to your computer and use it in GitHub Desktop.
Generate a new AES 256 Key with PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$random = [System.Security.Cryptography.RandomNumberGenerator]::Create(); | |
$buffer = New-Object byte[] 32; | |
$random.GetBytes($buffer); | |
[BitConverter]::ToString($buffer).Replace("-", [string]::Empty); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The output is the Hexadecimal representation of the key - by definition this is only 0-9 and a-f. Special characters are encoded in the same way.