[問題] 請問這樣的SHA246加密對嗎?

看板C_Sharp (C#)作者 (tomex)時間21年前 (2004/01/11 01:26), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/3 (看更多)
不曉得大家是否用過一個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
文章代碼(AID): #1003MvZg (C_Sharp)
文章代碼(AID): #1003MvZg (C_Sharp)