Mind you can do:

auth.settings.hmac_key='sha512:9562af3a-c7f5-4582-8322-b0efa4fe307b'

the 'sha512:' is used if no digest_alg is passed to CRYPT.
'sha512:' is there by default in keys generated by admin.

On Nov 27, 12:50 pm, waTR <[email protected]> wrote:
> SOLUTION:
>
> change sha512 -> md5.
>
> Not sure how or why it got set to sha512... Has CRYPT() been changed
> from SHA512 to md5 recently?
>
> REVISED CODE:
> passwd = hmac.new(auth.settings.hmac_key, request.get_vars.password,
> hashlib.md5).hexdigest()
>
> On Nov 27, 10:33 am, waTR <[email protected]> wrote:
>
> > I am trying to get a custome login to work with auth. Here is my code:
> > auth.settings.hmac_key='9562af3a-c7f5-4582-8322-b0efa4fe307b'
> > SQLField("password", 'password', readable=False, label='Password',
> > requires=CRYPT(key=auth.settings.hmac_key)),
> > passwd = hmac.new(auth.settings.hmac_key, request.get_vars.password,
> > hashlib.sha512).hexdigest()
>
> > However, when I register a user and then try to login, the encrypted
> > keys are different, and it won't authenticate... why is it that using
> > the same key the passwords are encrypted differently?
>
>

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to