[英]Using SHA256 + SHA512 hash for password?
I'm creating a method that I will use to hash password to store in a database. 我正在创建一个方法,我将用于散列密码以存储在数据库中。 I would like to seek advice if my methods in hashing is sufficient or overkill for the task.
如果我的散列方法足够或者过度杀戮,我想寻求建议。
Dim result As Byte()
Dim mixer As String
Try
Dim sha As New SHA512CryptoServiceProvider
mixer = txt_salt.Text.ToUpper + txt_pass.Text.Trim
result = sha.ComputeHash(System.Text.Encoding.ASCII.GetBytes(mixer))
txt_sha.Text = Convert.ToBase64String(result)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Thanks. 谢谢。
It is insufficient. 这是不够的。
As far as "bits" go, SHA1 is perfectly fine with 160 (but it is not fine [by itself] for other reasons). 就“位”而言,SHA1完全没有160(但由于其他原因,它本身并不好)。 Doing both SHA256+SH512 just complicates the matter for zero gain .
同时执行SHA256 + SH512只会使零增益复杂化。 (Actually, it is a very slight net loss due to the extra storage requirements.)
(实际上,由于额外的存储要求,这是一个非常轻微的净损失。)
I suggest using an existing library/system, unless this is an academic project :) 我建议使用现有的图书馆/系统,除非这是一个学术项目:)
Happy coding. 快乐的编码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.