我在visual studio 2010中构建了crypto++ 8.4,并编写了一些测试代码。它在Win32|Debug中运行良好,但在Win32|Release中hash.CalculateDigest抛出异常。 string source = "I am a programmer.";
CryptoPP::SHA512 hash;
CryptoPP::byte digest[CryptoPP::SHA512::DIGESTSIZE];
hash.CalculateDigest(digest, (const Cry
可能重复:
我有一个数据库如下:
create table user (id int primary key auto increment,
username varchar(64),
password varchar(128), # sha512 hash of password
password_salt varchar(128) # sha512 hash of a random number used as salt
)
这是一个用盐来确保密码安全的好主意吗?盐要多长时间?我想,吃128位(SHA-512)盐不会有什么害处,但我以前就错了。
我希望添加使用useradd的用户,并使用-p标志指定加密的密码。我了解到,我所在的unix系统使用SHA512哈希将密码存储在/etc/影子文件中。当我查看/etc/pam.d/公共密码时,它说:
# Explanation of pam_unix options:
#
# The "sha512" option enables salted SHA512 passwords. Without this option,
# the default is Unix crypt. Prior releases used the option "md5".
#
我有一个通过sha512发送的zip文件夹,我想要做的是用包含校验和值的单独的.sha512扩展名文件中的校验和值检查这个zip文件的校验和值。
到目前为止,我这样做是为了检查zip的校验和值是否与.sha512文件中的校验和值匹配:
if [[ file.zip -ne file.sha512 ]]; then
echo "Checksum values do not match"
exit -1;
fi
log "info" "Checksum values match"
done
(谢谢