Skip to content

Instantly share code, notes, and snippets.

@countingpine
Created May 18, 2018 11:53
Show Gist options
  • Select an option

  • Save countingpine/cc66607b070fedf4a2a028a4edc34a83 to your computer and use it in GitHub Desktop.

Select an option

Save countingpine/cc66607b070fedf4a2a028a4edc34a83 to your computer and use it in GitHub Desktop.
PowerShell MySQL password hash generator [TESTME]
$pass = Read-Host "Password" -AsSecureString; $passplain = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($pass))
$sha1 = New-Object System.Security.Cryptography.SHA1CryptoServiceProvider
"*" + [BitConverter]::ToString($sha1.ComputeHash($sha1.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($passplain)))) -replace '-'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment