user10711938
user10711938

Reputation:

SHA512 with salt encoding in powershell

I am trying to generate a SHA512 hash password string with salt encoding in powershell..

I found below python one and checked working fine

python -c 'import crypt; print crypt.crypt("welcome@123", crypt.mksalt(crypt.METHOD_SHA512))'

Is there anything similar in powershell...??

Upvotes: 0

Views: 2218

Answers (1)

Mario Favere
Mario Favere

Reputation: 510

For what it is worth (years later) : I did some testing to add filezilla users and stumbled on this :

Install-Module -Name ShaCrypt

Then you can do this :

$hash = New-ShaPassword -Password Password1       # Hash can be used in /etc/shadow file on Linux

Test-ShaPassword -Password Password1 -Hash $hash  # Returns $true
Test-ShaPassword -Password Password2 -Hash $hash  # Returns $false

# Use SHA-256 instead of SHA-512, custom SALT and custom ROUNDS
$hash = New-ShaPassword -Password Password1 -Sha256 -Salt between8n16chars -Rounds 2000

Upvotes: 0

Related Questions