Skip to content

Instantly share code, notes, and snippets.

@Megabytemb
Megabytemb / AES.ps1
Last active June 29, 2016 12:10 — forked from complex86/AES.ps1
#AES Key file export location
$KeyFile = "C:\AES.key"
#Generate Key
$Key = New-Object Byte[] 16 # You can use 16, 24, or 32 for AES
[Security.Cryptography.RNGCryptoServiceProvider]::Create().GetBytes($Key)
#write key to file
$Key | out-file $KeyFile