How did you insert "test" into database? If you use db.tablename.insert(..., deletion_key='test') it will store it plain text because you are bypassing validators.
You should: 1. use .validate_and_insert(...) instead or 2. use .insert(deletion_key=db.tablename.deletion_key.validate('test')) If you use SQLFORM(db.tablename...) it will automatically validate (=hash the password) Marin On Tue, Mar 18, 2014 at 6:04 PM, Encompass solutions <encomp...@gmail.com>wrote: > I am trying to create a model with an encrypted key so it's harder for > someone to maliciously screw over my customers. > I have the following snippet. > Field('public_gram', 'boolean', default=False), > Field('tag_name', 'list:string'), > Field('deletion_key', 'password') > ) > You can see there the "deletion_key" is a feild type "password" which I > understand is hashed out so you can't get the original code. However, when > I try to print it I get this... > test > CRYPT()(gram_details.deletion_key) > (<gluon.validators.LazyCrypt object at 0x7f56b8305c10>, None) > CRYPT()(gram_details.deletion_key) == gram_details.deletion_key > False > Where "test" is print gram_details.deletion_key > If this is the case then my password is not very cryptic. > Am I doing something wrong? > BR, > Jason Brower > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.