dbTalk Databases Forums  

Need encryption help

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss Need encryption help in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
melvin12harmon@yahoo.com
 
Posts: n/a

Default Need encryption help - 01-18-2006 , 10:14 PM






Hi,

I am using the Java wrappers with version 4.2 (fully patched).

I am trying to get AES encryption to work but when I inspect my
databases with a hex editor I can see all my data is unencrypted.

I open my DbEnv as follows:
int envFlags = Db.DB_INIT_TXN | Db.DB_INIT_LOG | Db.DB_CREATE |
Db.DB_INIT_LOCK |
Db.DB_INIT_MPOOL | Db.DB_LOG_AUTOREMOVE;
env = new DbEnv(0);
env.setEncrypted("password", Db.DB_ENCRYPT_AES);
env.open(homeDir, envFlags, 0);

And I open my Db with the following flags:
Db.DB_CREATE | Db.DB_AUTO_COMMIT | Db.DB_ENCRYPT

BDb seems to think my environment is encrypted:
Quote:
# db_dump test_db
db_dump: Encrypted environment: no encryption key supplied
But I can see all the data in my databases is not encrypted.

Can anyone suggest some flags to check to make sure I am setting
everything correctly?

thanks,
-m



Reply With Quote
  #2  
Old   
Michael Cahill
 
Posts: n/a

Default Re: Need encryption help - 01-19-2006 , 12:49 AM






Hi,

You'll need to call Db.setFlags(Db.DB_ENCRYPT) on each database to be
encrypted, in addition to configuring the environment for encryption.

Regards,
Michael.


Reply With Quote
  #3  
Old   
Michael Cahill
 
Posts: n/a

Default Re: Need encryption help - 01-19-2006 , 12:52 AM



Quote:
And I open my Db with the following flags:
Db.DB_CREATE | Db.DB_AUTO_COMMIT | Db.DB_ENCRYPT
Also, the DB_ENCRYPT flag can't be passed to Db.open (the value happens
to match another flag that is valid, which is why you aren't seeing an
error message).

Michael.



Reply With Quote
  #4  
Old   
melvin12harmon@yahoo.com
 
Posts: n/a

Default Re: Need encryption help - 01-19-2006 , 07:17 AM




Calling Db.setFlags makes everything work as expected.

thanks for bdb,
-m


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.