encrypting password using php -


I need to encrypt passwords and store it in DB. I've added a code "$ newpass = md5 ($ pass_word);" In php file but still it is not working

   Enter the name 'S; } If (trim ($ address1) == "") {$ errormsg = "& lt; br> sign in address 1"; // resonant $ errormsg; } If (trim ($ address2) == "") {$ errormsg = "& lt; br> sign in address 2"; // resonant $ errormsg; } If (trim ($ pass_word) == "") {$ errormsg = "& lt; br> sign in password"; // resonant $ errormsg; } If (trim ($ email) == "") {$ errormsg = "& lt; br>, enter email s"; // resonant $ errormsg; } $ Message = "Your username is". $ User_name "Your passcode is". $ Pass_word; If (strlen ($ errormsg) == 0) {mysql_query ( "INSERT IN 'xxx` (` Aidi`, Nam` `` know 1`, `know 2`,` Pasward`, `Imel`) Value (' ',' $ User_name ',' $ address1 ',' $ address2 ',' $ newpass', '$ email')) or die (mysql_error ());; copy $ newpass; echo "you have successfully registered"; } mail ($ email, $ subject, $ message);}? & Gt;  

this is my php page.

Something is wrong with your input because the syntax is correct. Although MD5 hashing is not a bad practice, it is relatively inefficient Damage is. To add a little extra layer of security, I usually do something like this ():

  & lt ;? Php function md5_salted ($ string, $ salt) { return md5 (md5 ($ string). md5 ($ salt));} $ salt = "wQfChpLYWFtiQV8d9Cao"; echo md5 ( 'user password'); // 221068207e125b97beb4e2d062e888b1 echo md5_salted ( 'userPassword', $ salt); / / 07d9ffd0115e61fb22f857b7d252339c? & Gt;  

Noteworthy: as others have said, it is hashing, encryption. If you are interested in encryption, check it out.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -