I need to be able to compare another password submitted against the
one in that field. How would I go about doing that? What functions are
available in web2py for this.

db.define_table('pass',
SQLField("password", 'password', readable=False, label='Password',
requires=CRYPT()))

I.e. I have just submitted a form that contains a
request.get_vars.password
how do I compare that password against the one in db.






On Sep 18, 1:34 pm, Jonathan Lundell <jlund...@pobox.com> wrote:
> On Sep 18, 2009, at 1:06 PM, waTR wrote:
>
> > Related question though... how can one check if password entered
> > matches password stored in DB for that user? When I retrieve the
> > stored password via select(), it is encrypted. How does Auth decrypt?
> > Where can I find that code (what file)?
>
> Briefly, you don't decrypt the stored password. Actually, you can't,  
> because it's not encrypted; it's hashed.
>
> You check it by hashing the login password and comparing the hashes.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to