密码的Javascript加密 [英] Javascript encryption of password

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

问题描述

Hi EveryOne,



我有一个注册页面,如它接受用户名,密码,电子邮件等,关于密码的blur()事件,它生成哈希代码并替换密码文本框值。然后存储在数据库中。用户注册成功后。现在,用户使用用户名和密码登录,再次登录blur()事件时,将再次为相同的密码生成新的哈希码。现在要在服务器端解密它。

我已经尝试但是密码不匹配,我的老人为他们提供的代码它正在工作,但对我来说它不起作用。

或者你有其他任何代码样本....



我的问题是这样的:

使用JQuery进行客户端Hashing [ ^ ]



但是现在我需要在服务器端使用相同的密码...

Hi EveryOne,

I have a page for registration like it accepts username,password ,email etc , on blur() event of password , it is generating hash code and replacing the password textbox value. and then storing in database. After successful registration of the user. Now user logs in with username and password, again while logging in on blur() event again new hash code will be generated for the same password. Now to decrypt it in the server side.
I 've tried but passwords are not matching, The code gave by my seniors for them it is working but for me it's not working .
Or do you have any other code samples ....

My problem is something like this:
Client Side Hashing using JQuery[^]

But now i need the same password on server side...

推荐答案

首先,没有必要在客户端进行此操作。这种类型的操作是在服务器端执行的。



第二件事是,你应该使用本质上不可逆转的算法,即解密的值不能被还原回到原来的形式。我们的一位有价值的会员OriginalGriff为此提供了精彩的文章。



密码存储:怎么做。 [ ^ ]



此外,没有需要使用onBlur()等事件,因为你将有登录按钮而不是在那里执行所需的操作。请参阅下面的链接。



如何:使用MD5和SHA1散列数据 [ ^ ]



初学者教程,用于理解和实现密码哈希和腌制 [ ^ ]



The Art&存储密码科学 [ ^ ]



问候......:笑:
First of all,theres no need to make this at client side. This type of operations are performed at server side.

Second thing is that,you should make use of algorithm that are irreversible in nature,that is decrypted value cant be reverted back to its original form.Theres wonderful article available for this by one of our valuable member OriginalGriff.

Password Storage: How to do it.[^]

Further,theres no need to make use of onBlur() etc. event,as you will have login button than perform the desired operations there only.Refer to below links.

How To: Hash Data Using MD5 and SHA1[^]

A Beginner's Tutorial for Understanding and Implementing Password Hashing and Salting[^]

The Art & Science of Storing Passwords[^]

Regards.. :laugh:


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

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