Are you looking to encrypt all data (including references) or specific
text/string fields). In the latter case you can create a validator to
do it

remember that a validator is a two-way filter (in and out):

class IS_SECURE:
   def __init__(self,encryption_key):
       self.key=encryption_key
   def __call__(self,plaintext):
       ciphertext = encrypt(self.key,plaintext)
       return (ciphertext,None)
   def fomatter(self,ciphertext):
       plaintext = decrypt(self.key, ciphertext)
       return plaintext

Then you simply use this validator for the fields you want to encrypt
and everything will be automatic. If you need other validators, make a
list and make sure this is the last one. This will only work for
string and text validators. It assumes you have encrypt/decrypt
functions.

On Jan 6, 6:30 pm, NeonGoby <[email protected]> wrote:
> I would like to encrypt form data that will be stored into the
> database, not crypting the login password.
>
> I can think of two ways:
> 1.  use dbio=False, or
> 2.  use onvalidation function to
>
> encrypt the form data.
>
> But I'll need to declare the field as a blob in order to store the
> resulting binary data, and blob data won't be displayed in the SQLFORM
> as a text field.
>
> What is the proper procedure to take advantage of web2py feature,
> while still be able to encrypt the form data?
-- 
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