加密密码SH1 [英] encrypting password SH1

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

问题描述

昨天晚上,一个朋友确实问我在我制作的程序中我通常使用什么加密来登录密码.

我的答案=否加密导致我使用登录名编写的大多数程序

但是最近iam仍然开始变得更加着迷,以制作使用MySql之类的外部数据库的程序.

所以我的问题是如何对sh1进行加密

我需要2种方式进行加密

1.当我向数据库注册密码时如何使用它.
2.当我从数据库中读取密码时如何使用它.

(我不需要知道如何与mysql等建立连接,只需加密信息即可).


亲切的问候,
Michael Huijskens

Yesterday night a friend did ask me what encrypting i normally use for my login passwords on the programs i make.

Wel my answer = NO Encryption cause most of programs i write with a login on it as protection is only for local use.

But still lately iam starting to get more intrested to make programs that are using external databases like MySql.

So my Question is how to put sh1 encryption on a password.

i need this in 2 ways

1. how to use it when i register a password to a database.
2. how to use it when i read the password out of the database.

( i dont need to know how to make a connection to mysql or etc. just the info to encrypt.)


Kind Regards,
Michael Huijskens

推荐答案

Miachael,

通常您不会将密码存储在数据库.您只存储密码哈希,如果用户要登录,则再次计算密码哈希,仅检查它是否与存储的哈希匹配.

Hi Miachael,

usually you don`t store the password in the database. You only store the password hash and if a user wants to login then you compute the password hash again and only checks if it matches the stored hash.


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

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