Md5盐密码php [英] Md5 salt password php

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

问题描述

我知道有关这个问题的问题很多,但我真的需要问这个问题。



今天我一直在使用md5加密密码。 / p>

所以我做了什么。



我有4种盐。 (它们根据用户值而变化)


  1. 从电子邮件id和substr然后md5他们

  2. 从电子邮件和id substr其他位置

  3. 一个长字符串,substr它然后md5它

  4. 另一个长字符串,substr它然后md5它

然后我md5 salt1和3以及salt 2和salt4的密码



此后,我必须自动更改密码,只要用户更改电子邮件或更改其ID。



你们有什么想法?

解决方案

没有任何东西



MD5坏了, p>

使用mailaddress作为salt是一个好主意。但是使用md5不是。使用bcrypt,scrypt或pbkdf2。



不要发明自己的ecryption,除非你真的知道你在做什么,相信我,你不会/ p>

I know that there are alots of questions about this subject but i really need to ask this.

Today I've been working on encrypting passwords with md5.

So what I've done is.

I got 4 salts. (they changes depending on user values)

  1. from email id and substr then md5 them
  2. from email and id substr other positions
  3. a long string, substr it and then md5 it
  4. another long string, substr it and then md5 it

Then i md5 salt1 and 3 and the password with salt 2 and salt4

After this I have to change the password automatically whenever a user changes his email or his id getting changed.

What do you guys think about this?

解决方案

Nothing.

MD5 is broken and bad.

Using the mailaddress as salt is a good idea. But using md5 is not. Use instead bcrypt, scrypt or pbkdf2.

Don't invent your own ecryption, unless you really know what you are doing, and trust me, you don't

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

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