在 powershell 中使用盐编码的 SHA512

问题描述 投票:0回答:1

我正在尝试在 powershell 中使用盐编码生成 SHA512 哈希密码字符串..

我找到了下面的 python 并检查工作正常

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

powershell中有类似的东西吗...??

powershell sha512
1个回答
0
投票

它的价值(几年后):我做了一些测试来添加 filezilla 用户并偶然发现了这一点:

Install-Module -Name ShaCrypt

然后你可以这样做:

$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
© www.soinside.com 2019 - 2024. All rights reserved.