如何散列或加密Azure SQL中具有密码的列 [英] How to Hash or Encrypt a column in Azure SQL that has passwords

查看:79
本文介绍了如何散列或加密Azure SQL中具有密码的列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找一个关于如何散列或加密我的登录表中用于密码的列的简单解决方案。

I'm trying to find a simple solution on how hash or encrypt a column in my login table which is used for passwords.

感谢任何帮助。

谢谢,

Jeremy

推荐答案

嗨Jeremy,

Hi Jeremy,

据我所知,有两种方法可以处理密码,一种是可逆的(就像你上面说的那样加密) ,另一个是不可逆转的(哈希),当用户忘记它时,如果你使用可逆方法,可以重新找到密码,而
用户只能重新设置新密码使用第二种方法,即用户无法重新找到原始密码,这两种方法都是在后台代码中编写算法。

As far as I know, there are two ways to handle the password, one is reversible(just as you said encrypt above), the other is irreversible(hash), the password can be re-found when the user forgot it if you use the reversible method, and users can only re-set a new password if you use the second method, that means the user can not re-found his original password, these two methods are both writing algorithm in the background code.

用户在第一次,您可以通过算法将密码加密为密文,然后将加密的密文存储在数据库表中,这意味着您只存储加密的密码ters而不是密码本身由用户输入
,而这项工作是通过算法中的代码而不是数据库完成的,数据库本身没有这个功能,你不能指望数据库自动加密  ;当您存储密码时。

Users create a password at the first time then you can encrypt the password into a ciphertext by algorithm, and then store the encrypted ciphertext in the database table, that means you only store encrypted characters instead of the password itself entered by the user, and this work is done through the code in the algorithm instead of the database, the database itself does not have this feature, you can not expect the database to automatically encrypt it when you store your password.

当用户输入尝试登录的密码时,您必须使用相同的算法将此密码转换为密文,然后确定是否密文和 存储在数据库中的密文是相同的,它们是,允许
用户登录,否则不允许。

When the user enters the password trying to log in, you have to convert this password to the ciphertext with the same algorithm, and then determine whether this ciphertext and the ciphertext stored in the database are the same, it they are, the user is allowed to login, otherwise not allowed.

希望这有帮助!

最好的问候,

Stanly


这篇关于如何散列或加密Azure SQL中具有密码的列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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