[web2py] Re: Using CRYPT()

2018-10-16 Thread Константин Комков
e -- 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 unsu

[web2py] Re: Using CRYPT()

2018-10-16 Thread Константин Комков
If i got form.vars.password. Can I get salt and hash like variables? Now I do that: aList = str(form.vars.password).split('$') salt=aList[1] hash=aList[2] суббота, 13 октября 2018 г., 0:11:16 UTC+3 пользователь Anthony написал: > > >> if >> form.process(formname='form',onvalidation=check_ag

[web2py] Re: Using CRYPT()

2018-10-15 Thread Константин Комков
Anthony, thank you! суббота, 13 октября 2018 г., 0:11:16 UTC+3 пользователь Anthony написал: > > >> if >> form.process(formname='form',onvalidation=check_agreement).accepted: >> #How can I get hash and maybe random salt HERE??? >> > > request.vars.password is the raw data sent from the br

[web2py] Re: Using CRYPT()

2018-10-12 Thread Anthony
> > > if form.process(formname='form',onvalidation=check_agreement).accepted: > #How can I get hash and maybe random salt HERE??? > request.vars.password is the raw data sent from the browser. After form processing, the transformed value will be in form.vars.password. Anthony -- Resou

[web2py] Re: Using CRYPT()

2018-10-12 Thread Dave S
On Friday, October 12, 2018 at 3:29:54 AM UTC-7, Константин Комков wrote: Dave S, thank you, I think also. But how can I get hash on server? > my controller: > [...] > if form.process(formname='form',onvalidation=check_agreement).accepted: > #How can I get hash and maybe random salt HERE

[web2py] Re: Using CRYPT()

2018-10-12 Thread Константин Комков
Dave S, thank you, I think also. But how can I get hash on server? my controller: form = FORM( DIV( DIV( LABEL( 'Пароль:', _for='abit_pass', _style='font-weight: 400;' ),

[web2py] Re: Using CRYPT()

2018-10-12 Thread Dave S
On Thursday, October 11, 2018 at 11:59:26 PM UTC-7, Константин Комков wrote: > > I thought that after using CRYPT() and pushing submit button I have had > hash in variable request.vars.password, but I received my password. > crypt() runs on the server, AIUI, so the POST would not have the hash.

[web2py] Re: Using CRYPT()

2018-10-12 Thread Константин Комков
I thought that after using CRYPT() and pushing submit button I have had hash in variable request.vars.password, but I received my password. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2p

[web2py] Re: using CRYPT in SQLFORM.factory doesn't work?

2011-05-12 Thread niknok
Ok, here's a quote for you: “Confusion is the welcome mat at the door of creativity.” ;) On May 13, 2:26 am, pbreit wrote: > I suppose it's personal preference but the comma placement at the beginning > of the line is really confusing.

[web2py] Re: using CRYPT in SQLFORM.factory doesn't work?

2011-05-12 Thread pbreit
I suppose it's personal preference but the comma placement at the beginning of the line is really confusing.

[web2py] Re: using CRYPT in SQLFORM.factory doesn't work?

2011-05-12 Thread niknok
Nice catch Anthony! Thanks a bunch. That's the second time I got bitten by a misplaced comma in an SQLFORM ... On May 12, 12:23 pm, Anthony wrote: > I think you've got a simple typo in you code -- in SQLFORM.factory, you have > a ')' at the end of the Field line, so your 'requires' ends up being

[web2py] Re: using CRYPT in SQLFORM.factory doesn't work?

2011-05-11 Thread Anthony
I think you've got a simple typo in you code -- in SQLFORM.factory, you have a ')' at the end of the Field line, so your 'requires' ends up being a SQLFORM.factory argument instead of a Field argument. It should be: form=SQLFORM.factory( Field('card_number','string',comment='with da

[web2py] Re: using CRYPT in SQLFORM.factory doesn't work?

2011-05-11 Thread niknok
here's the code I used. http://pastie.org/1891534 what's weird is that I know that CRYPT works in my other apps, it's just in this particular controller that it isn't working right. And in my case, my logical test is "==" and not "!=". My problem is the unecrypted variable... On May 10, 10:54 

[web2py] Re: using CRYPT in SQLFORM.factory doesn't work?

2011-05-10 Thread Anthony
On Tuesday, May 10, 2011 2:10:07 AM UTC-4, niknok wrote: > > Anthony, sorry for the typo. I meant calling onvalidation=, and not > onaccept > > That is the behavior I'm expecting, since I've seen that work like so > before. Here's a stripped-down version of the function: > > def cnv(): >

[web2py] Re: using CRYPT in SQLFORM.factory doesn't work?

2011-05-10 Thread pbreit
OK, I guess it does work. This worked for me: def crypt(): form = SQLFORM.factory( Field('test', requires=CRYPT(auth.settings.hmac_key))) if form.accepts(request.vars, session): return dict(data=form.vars.test) return dict(form=form)

[web2py] Re: using CRYPT in SQLFORM.factory doesn't work?

2011-05-09 Thread niknok
Anthony, sorry for the typo. I meant calling onvalidation=, and not onaccept That is the behavior I'm expecting, since I've seen that work like so before. Here's a stripped-down version of the function: def cnv(): c_hash=request.args(0) form=SQLFORM.factory( Field('card_number','s

[web2py] Re: using CRYPT in SQLFORM.factory doesn't work?

2011-05-09 Thread Anthony
On Monday, May 9, 2011 10:59:46 PM UTC-4, pbreit wrote: > > Do filters work with SQLFORM.factory? I'm not sure CRYPT returns an > encrypted string so much as it causes the string to be encrypted when > SQLFORM puts it in the DB. I could be wrong. When I create a SQLFORM.factory with a require

[web2py] Re: using CRYPT in SQLFORM.factory doesn't work?

2011-05-09 Thread Anthony
On Monday, May 9, 2011 10:32:13 PM UTC-4, niknok wrote: > > I was trying to process it inside onvalidation= ... Note sure I understand. Can you show your full code (including where/how you are finding form.vars.card_number unencrypted)?

[web2py] Re: using CRYPT in SQLFORM.factory doesn't work?

2011-05-09 Thread pbreit
Do filters work with SQLFORM.factory? I'm not sure CRYPT returns an encrypted string so much as it causes the string to be encrypted when SQLFORM puts it in the DB. I could be wrong.

[web2py] Re: using CRYPT in SQLFORM.factory doesn't work?

2011-05-09 Thread niknok
I was trying to process it inside onvalidation= ... On May 9, 10:53 pm, Anthony wrote: > On Monday, May 9, 2011 10:37:02 AM UTC-4, niknok wrote: > > > I tried: > > >     form=SQLFORM.factory( > >         Field('card_number','string' > >                 ,label='Enter a card number to verify' > >  

[web2py] Re: using CRYPT in SQLFORM.factory doesn't work?

2011-05-09 Thread Anthony
On Monday, May 9, 2011 10:37:02 AM UTC-4, niknok wrote: > > I tried: > > form=SQLFORM.factory( > Field('card_number','string' > ,label='Enter a card number to verify' > ,requires=CRYPT(auth.settings.hmac_key)) > > But instead I found form.vars.card_numb