哈希和盐串 [英] Hash and salt to string

查看:120
本文介绍了哈希和盐串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  string  password = hash + salt 
byte [] hashsalt = hashing.ComputeHash(Encoding.UTF8.GetBytes(password));





如果要转换,代码是什么

  byte  [] hashsalt = hashing.ComputeHash(Encoding.UTF8.GetBytes(password)); 

到一个字符串变量

解决方案

你好,



  var  str = System.Text.Encoding.UTF8.GetString([Your  Byte  Array]); 



链接了解更多详情:

http://msdn.microsoft.com/en-us/library/744y86tc(v = vs.110)的.aspx [<一个href =http://msdn.microsoft.com/en-us/library/744y86tc(v=vs.110).aspx\"target =_ blanktitle =New Window> ^ ]


哈希,更准确地说,加密哈希函数,是不可逆转的。这意味着加密不可行从其散列中获取原始数据。这是整个目的!在密码学中是否需要使用这样的功能才能进行反向操作?试想一下。



另见: http:// en。 wikipedia.org/wiki/Cryptographic_hash_function [ ^ ]。



你收到了吗?



用法是:从用户那里获取密码的哈希值并存储它。你永远不会知道密码本身;你没有权利知道它,你永远不需要它进行身份验证。对于身份验证,您将获得用户的哈希值,并将其与您为此用户帐户存储的哈希值进行比较。



-SA

string password = hash + salt
byte[] hashsalt = hashing.ComputeHash(Encoding.UTF8.GetBytes(password));



what is the code if you want convert from

byte[] hashsalt = hashing.ComputeHash(Encoding.UTF8.GetBytes(password));

to a string variable

解决方案

Hi,

var str=System.Text.Encoding.UTF8.GetString([Your Byte Array]);


Link for More details :
http://msdn.microsoft.com/en-us/library/744y86tc(v=vs.110).aspx[^]


Hash, more exactly, cryptographic hash function, is irreversible. It means it is cryptographically infeasible to obtain original piece of data from its hash. This is the whole purpose! Would would need to use such a function in cryptography is reverse operation was feasible? Just think about it.

See also: http://en.wikipedia.org/wiki/Cryptographic_hash_function[^].

Are you getting it?

The usage is: get a hash of a password from the user and store it. You will never know the password itself; you have no right to know it and you never need it for authentication. For authentication, you get a hash from the user and compare it with the hash you store for this user account.

—SA


这篇关于哈希和盐串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆