在MySQL中编码密码 [英] Encoding passwords in MySQL

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

问题描述

我正在开发一个数据库应用程序,其中存储用户名和

密码。当然我想以加密的形式存储密码。

但是,就像你在许多网络应用程序中看到的那样,我希望能够将b / b
通过电子邮件发回给用户密码对他们来说,他们应该忘记他们旧的

密码。


我看了如何在MySQL中存储密码数据,他们建议

使用MD5或SHA。这两种似乎都是单向加密

例程。 IOW一旦我加密并存储用户密码,就没有

的方式来解密它。


如何在我的SQL数据库中存储密码以便我可以转换

用户请求时返回纯文本?

-

我昨晚去散步,我的孩子问我我要走多久了。

我说,整个时间。

I am developing a database application in which I store usernames and
passwords. Naturally I want to store the passwords in an encrypted form.
However, just like you see in many web applications, I want to be able
to email the users password back to them should they forget their old
password.

I looked at how to store the password data in MySQL and they recommend
using MD5 or SHA. Both of these appear to be one way encryption
routines. IOW once I encrypt and store the users password there is no
way to unencrypt it.

How can I store passwords in my SQL database such that I can convert
them back to plain text when the user requests them?
--
I went for a walk last night and my kids asked me how long I''d be gone.
I said, "The whole time."

推荐答案

如果你想保存加密的密码并想要解密它,你应该使用一个函数,它有一些用户。用它输入。

你不能使用像rot13这样的东西,因为这几乎是标准的用于此目的的带有PHP的
和任何拥有加密密码的人都可以解密

一样容易。

这是你的选择,但最好的方法就像MD5一样,如果有人输了它b / b $ b $,只需将新密码邮寄到数据库中的邮件地址,并让

用户在下次登录时将其替换。


" Andrew DeFaria" <安**** @ DeFaria.com> schreef in bericht

news:23 ************************** @ msgid.meganewsse rvers.com ...
If you want to save password encrypted and want to decrypt it, you should
use a function for it which has some "user" input with it.
You cant use something like rot13 simply because this is almost standard
with PHP for this purpose and anyone with the encrypted password can decrypt
just as easily.
It''s your choice but the best way is something like MD5 and if someone loses
it, just mail a new password to the mail-adress in the database and have the
user replace it with the next login.

"Andrew DeFaria" <An****@DeFaria.com> schreef in bericht
news:23**************************@msgid.meganewsse rvers.com...
我正在开发一个数据库应用程序,我在其中存储用户名和密码。当然,我想以加密的形式存储密码。
但是,就像你在许多网络应用程序中看到的那样,我希望能够将用户的密码通过电子邮件发回给他们,如果他们忘记了旧的<密码。

我看了如何在MySQL中存储密码数据,他们建议使用MD5或SHA。这两种似乎都是单向加密的例程。 IOW一旦我加密并存储用户密码,就没有办法解密它。

如何在我的SQL数据库中存储密码,以便我可以将它们转换回来用户请求时的纯文本?
-
我昨晚去散步,我的孩子们问我要走了多长时间。
我说,整个时间。
I am developing a database application in which I store usernames and
passwords. Naturally I want to store the passwords in an encrypted form.
However, just like you see in many web applications, I want to be able
to email the users password back to them should they forget their old
password.

I looked at how to store the password data in MySQL and they recommend
using MD5 or SHA. Both of these appear to be one way encryption
routines. IOW once I encrypt and store the users password there is no
way to unencrypt it.

How can I store passwords in my SQL database such that I can convert
them back to plain text when the user requests them?
--
I went for a walk last night and my kids asked me how long I''d be gone.
I said, "The whole time."



Too Sexy写道:
Too Sexy wrote:
如果你想保存加密密码并想要解密它,你应该使用一个具有一些用户的功能。输入它。


喜欢?

你不能使用像rot13这样的东西,因为这几乎是用于此目的的PHP标准和任何加密的人密码可以轻松解密。


我没有使用PHP。

这是你的选择


我有哪些选择?有?我没有收到你的任何消息。

但是最好的方式就像MD5一样,如果有人输了它,只需将新密码邮寄到数据库中的邮件地址,让
用户在下次登录时更换它。
If you want to save password encrypted and want to decrypt it, you
should use a function for it which has some "user" input with it.
Like?
You cant use something like rot13 simply because this is almost
standard with PHP for this purpose and anyone with the encrypted
password can decrypt just as easily.
I''m not using PHP.
It''s your choice
What choices do I have? I haven''t heard any from you.
but the best way is something like MD5 and if someone loses it, just
mail a new password to the mail-adress in the database and have the
user replace it with the next login.




是的但是其他网站怎么做呢?没有通过电子邮件回复

新密码但网站通过电子邮件回复您的旧密码的网站?


-

你的孩子可能是一名荣誉学生,但你仍然是个白痴。



Yeah but how do other sites do it? Sites that do not email you back a
new password but sites who email you back your old password?

--
Your child may be an honor student but you''re still an idiot.


如果你想保存加密密码并想要解密,你应该

使用一个函数,它有一些用户用它输入。

你不能使用像rot13这样的东西,因为这几乎是标准的用于此目的的带有PHP的
和任何拥有加密密码的人都可以解密

一样容易。

这是你的选择,但最好的方法就像MD5一样,如果有人输了它b / b $ b $,只需将新密码邮寄到数据库中的邮件地址,并让

用户在下次登录时将其替换。


" Andrew DeFaria" <安**** @ DeFaria.com> schreef in bericht

news:23 ************************** @ msgid.meganewsse rvers.com ...
If you want to save password encrypted and want to decrypt it, you should
use a function for it which has some "user" input with it.
You cant use something like rot13 simply because this is almost standard
with PHP for this purpose and anyone with the encrypted password can decrypt
just as easily.
It''s your choice but the best way is something like MD5 and if someone loses
it, just mail a new password to the mail-adress in the database and have the
user replace it with the next login.

"Andrew DeFaria" <An****@DeFaria.com> schreef in bericht
news:23**************************@msgid.meganewsse rvers.com...
我正在开发一个数据库应用程序,我在其中存储用户名和密码。当然,我想以加密的形式存储密码。
但是,就像你在许多网络应用程序中看到的那样,我希望能够将用户的密码通过电子邮件发回给他们,如果他们忘记了旧的<密码。

我看了如何在MySQL中存储密码数据,他们建议使用MD5或SHA。这两种似乎都是单向加密的例程。 IOW一旦我加密并存储用户密码,就没有办法解密它。

如何在我的SQL数据库中存储密码,以便我可以将它们转换回来用户请求时的纯文本?
-
我昨晚去散步,我的孩子们问我要走了多长时间。
我说,整个时间。
I am developing a database application in which I store usernames and
passwords. Naturally I want to store the passwords in an encrypted form.
However, just like you see in many web applications, I want to be able
to email the users password back to them should they forget their old
password.

I looked at how to store the password data in MySQL and they recommend
using MD5 or SHA. Both of these appear to be one way encryption
routines. IOW once I encrypt and store the users password there is no
way to unencrypt it.

How can I store passwords in my SQL database such that I can convert
them back to plain text when the user requests them?
--
I went for a walk last night and my kids asked me how long I''d be gone.
I said, "The whole time."



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

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