Günter Greschenz wrote:
hi,

i implemented crypting for values:

insert into test (x, y, z) values(encrypt('this is a test', 'pwd'), 'foo', 'bar') insert into test (x, y, z) values(encrypt('this is test 2', 'pwd'), 'foo2', 'bar2')
   ...
select decrypt(x, 'pwd') x, y, z from test where decrypt(x, 'pwd') like 'this%'

but setting the password each time is quiet time-expensive.
so i want to set the password only once:
   pragma password='pwd'
   insert into test values(encrypt('this is a test'), 'foo', 'bar')
   insert into test values(encrypt('this is test 2'), 'foo2', 'bar2')
   ...
   select decrypt(x) x, y, z from test where decrypt(x) like 'this%'



Igor Tandetnik schrieb:
Günter Greschenz <[EMAIL PROTECTED]> wrote:
i'm using "sqlite3_create_function()" to create own functions in my
database.
this is a really nice possibility to extend the database with powerful
functions.
but i did not find a way to create own pragmas like "pragma foo=bar"
to pass some global information to my application.

Pass global information from where? Why would your application use such
a roundabout way to pass global information to itself? If you need to
store some global settings in the database, why not just create a table
for them?

Gunter,

Igor is right, you should store your password in a table. If you are concerned about the password being saved in the database, then you could use a temporary table, or even attach a :memory: database to hold the table that contains the password. In any case the saved password is available to your encrypt and decrypt functions.

HTH
Dennis Cote

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to