Go Back   CP Web Hosting - reseller hosting > Server Scripting > PHP
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-03-2007, 11:02 AM
Senior Member
 
Join Date: May 2007
Posts: 290
Default encrypt the password

i need to encrypt the password and want to submit in the database so that whenever i am seeing the password it wants should be in the encrypted manner.
How can i do it?
Reply With Quote
  #2 (permalink)  
Old 07-03-2007, 11:06 AM
Senior Member
 
Join Date: Mar 2007
Posts: 274
Default

Quote:
Originally Posted by Dolbz View Post
i need to encrypt the password and want to submit in the database so that whenever i am seeing the password it wants should be in the encrypted manner.
How can i do it?
In PHP use md5($password)
Reply With Quote
  #3 (permalink)  
Old 07-03-2007, 11:08 AM
Senior Member
 
Join Date: Mar 2007
Posts: 193
Default

Depending on the database you're using you could use the built in encryption.
Reply With Quote
  #4 (permalink)  
Old 07-03-2007, 11:09 AM
Senior Member
 
Join Date: May 2007
Posts: 217
Thumbs up

if you're using MySQL try this

Code:
UPDATE users SET password=md5('thepassword') WHERE user='theuser';
Reply With Quote
  #5 (permalink)  
Old 07-03-2007, 11:11 AM
Senior Member
 
Join Date: May 2007
Posts: 267
Default

when your checking against a database to md5 the input aswell.
Reply With Quote
  #6 (permalink)  
Old 07-03-2007, 11:14 AM
Senior Member
 
Join Date: Apr 2007
Posts: 311
Default

I would recommend using PHP md5() function .
Reply With Quote
  #7 (permalink)  
Old 07-03-2007, 11:17 AM
Senior Member
 
Join Date: May 2007
Posts: 329
Default

You can also use base64_encode and base64_decode functions.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:57 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0