dbTalk Databases Forums  

DB Cryptography: How can I make sure the user entered a wrong password in my application?

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


Discuss DB Cryptography: How can I make sure the user entered a wrong password in my application? in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
MorningStar
 
Posts: n/a

Default DB Cryptography: How can I make sure the user entered a wrong password in my application? - 11-24-2005 , 05:09 AM






I have played with the cryptography of BDB, only found that when being
given a wrong password, the DB->open method just returns -1, which
means: "Unknown Error".
Then I want to know is there any other mechanism to let me know it's
the wrong password that makes the opening failure instead of all other
possibilies. Or at least let me know it's some kind of format error or
checksum error rather than others.


Reply With Quote
  #2  
Old   
clayne@anodized.com
 
Posts: n/a

Default Re: DB Cryptography: How can I make sure the user entered a wrong password in my application? - 11-26-2005 , 03:43 AM






Are you checking the return value of db->set_encrypt() ?

Parameters
flags
The flags parameter must be set to 0 or the following value:
DB_ENCRYPT_AES
Use the Rijndael/AES (also known as the Advanced Encryption Standard
and Federal Information Processing Standard (FIPS) 197) algorithm for
encryption or decryption.
passwd
The passwd parameter is the password used to perform encryption and
decryption.
Errors

The DB_ENV->set_encrypt method may fail and return one of the following
non-zero errors:
EINVAL
If the method was called after DB_ENV->open was called; or if an
invalid flag value or parameter was specified.
EOPNOTSUPP
Cryptography is not available in this Berkeley DB release.


Reply With Quote
  #3  
Old   
Susan LoVerso
 
Posts: n/a

Default Re: DB Cryptography: How can I make sure the user entered a wrong password in my application? - 11-28-2005 , 01:52 PM




MorningStar wrote:
Quote:
I have played with the cryptography of BDB, only found that when being
given a wrong password, the DB->open method just returns -1, which
means: "Unknown Error".
Then I want to know is there any other mechanism to let me know it's
the wrong password that makes the opening failure instead of all other
possibilies. Or at least let me know it's some kind of format error or
checksum error rather than others.
You need to enable informational error messages and it will give you
additional
output to tell you what the problem it detect was. See
docs/api_c/env_set_errfile.html or env_set_errpfx.html in your
documentation set.

DB will detect bad passwords, no passwd in an encrypted env, etc.

Sue LoVerso
Sleepycat Software



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.