Skip to content

Instantly share code, notes, and snippets.

View hedazkax's full-sized avatar

alex smith hedazkax

  • Printer Service
  • India
  • Joined Sep 4, 2025
View GitHub Profile
param(
[string]$Password = "MyStrongPassword123"
)
# Derive AES key and IV from password
$PasswordBytes = [System.Text.Encoding]::UTF8.GetBytes($Password)
$sha = [System.Security.Cryptography.SHA256]::Create()
$Key = $sha.ComputeHash($PasswordBytes) # 32 bytes
$IV = $Key[0..15] # first 16 bytes for IV