[web2py] Re: Illegal character in encryption salt

2014-04-18 Thread Louis Amon
The 'framework' used was based on ZOPE but very customized. The encryption procedure was pretty much like this : def hash_password(password) salt = uweb2$#py password = password + salt password = password.encode('utf-8') return hashlib.sha256(password).hexdigest() So what I

[web2py] Re: Illegal character in encryption salt

2014-04-18 Thread Massimo Di Pierro
try this: class MyCrypt(CRYPT): def __call__(self,value): return (str(CRYPT(digest_alg='sha256',salt=web2$#py)(value)[0]).split('$')[-1],None) db.auth_user.password.requires = MyCrypt() On Thursday, 17 April 2014 11:00:57 UTC-5, Louis Amon wrote: The 'framework' used was based

[web2py] Re: Illegal character in encryption salt

2014-04-18 Thread Louis Amon
Worked like a charm ! Thanks a lot On Friday, April 18, 2014 10:05:37 PM UTC+2, Massimo Di Pierro wrote: try this: class MyCrypt(CRYPT): def __call__(self,value): return (str(CRYPT(digest_alg='sha256',salt=web2$#py)(value)[0]).split('$')[-1],None)

[web2py] Re: Illegal character in encryption salt

2014-04-13 Thread Massimo Di Pierro
The problem is not really that you use $ in salt. The probably is that web2py and the framework you moved from must have different conventions for storing the salt. We use 'alg$salt$pwd'. What do they use? What is the framework? If we know we can convert it. On Friday, 11 April 2014 08:38:38