Skip to content

Instantly share code, notes, and snippets.

@dgosbell
Created November 6, 2019 11:11
Show Gist options
  • Save dgosbell/5d652ae2230eba4190beaa04978a6caf to your computer and use it in GitHub Desktop.
Save dgosbell/5d652ae2230eba4190beaa04978a6caf to your computer and use it in GitHub Desktop.
Creates a new random base 64 salt
$SaltByteLength = 64
$rncCsp = new-object System.Security.Cryptography.RNGCryptoServiceProvider
$salt = new-object byte[] $SaltByteLength
$rncCsp.GetBytes($salt);
[System.Convert]::ToBase64String($salt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment