Skip to content

Instantly share code, notes, and snippets.

@lennybacon
lennybacon / New-AES256Key.ps1
Last active May 14, 2024 08:11
Generate a new AES 256 Key with PowerShell
$random = [System.Security.Cryptography.RandomNumberGenerator]::Create();
$buffer = New-Object byte[] 32;
$random.GetBytes($buffer);
[BitConverter]::ToString($buffer).Replace("-", [string]::Empty);