作者tomex (tomex)
看板C_Sharp
标题[问题] 请问这样的SHA246加密对吗?
时间Sun Jan 11 01:32:28 2004
不晓得大家是否用过一个asp论坛,叫做 SnitzForum的
它的密码是使用SHA256加密,用VBScript写的!
因此我去找相关的资料,在.net发现这样的写法:
System.Security.Cryptography.SHA256 hash = System.Security.Cryptography.SHA256.Create();
string s = "123456"; // plain-text
byte[] plainTextBytes = System.Text.Encoding.UTF8.GetBytes(s);
byte[] hashBytes = hash.ComputeHash(plainTextBytes);
string hashString = Convert.ToBase64String(hashBytes);
Console.WriteLine(hashString);
不过产生出来的字串跟它不同!
我不知道到底是谁对,因此要问大家的想法!?
ps.其vbscript的又臭又长,贴上来也没用!
不晓得有公正的程式可验证我所产生的加密文是否符合sha246编码?
--
You're recommended to vist C_Sharp in PTT.
We are the C#, resistance is futile.
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.119.183.211