MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old June 25th, 2000, 07:07 PM
RyanP
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
What is the best way to store and retrieve encrypted passwords in mySQL with Perl DBI?


Thanks,
Ryan

Reply With Quote
  #2  
Old July 3rd, 2000, 04:39 PM
deviant deviant is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 27 deviant User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
To store password -->

When setting the value in the query add the password() statement to the value...ie

$query = "INSERT INTO yourtable (yourfield, otherfields) VALUES (password('$yourfield'), $otherfields)"

To retrieve password -->

There is no way to retrieve an encrypted password from the MySQL database (that I'm aware of..)
To check that a password entered matches a password in the database you can encrypt the entered password and check that string against the encrypted password in the table.

See "MySQL password verification" posting in Perl Forum......

Hope that helps some.......

Reply With Quote
  #3  
Old July 3rd, 2000, 04:48 PM
RyanP
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Hi Deviant, thanks for responding. This is somewhat what I'm looking for, one thing that I'd like to do though is allow users who have forgotten their password have to have it automatically emailed to them when they submit a "Lost password" form (why I would like to be able to decrypt the password) .... do you know how so many other sites are able to do this? (including this forum, for example)

Thanks,
Ryan

Reply With Quote
  #4  
Old July 5th, 2000, 09:03 AM
ads
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I have solved this problem by entering password in two different fields as follows.
$query = "INSERT INTO yourtable (yourfield, otherfields, yourfield_1) VALUES (password('$yourfield'), $otherfields, yourfield_1)";

password('$yourfield') will be checked for user password and in case if user forgot his password "yourfield_1" will be mailed to him.
I do not know whether this correct. Tell me if there is any better way.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > What's the best way to store and retrieve encrypted passwords in mySQL with Perl DBI?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway