[ http://issues.apache.org/jira/browse/DERBY-1740?page=comments#action_12430991 ] Kristian Waagan commented on DERBY-1740: ----------------------------------------
I think my previous comment is incorrect. Can anyone help my out here? It seems the concepts of 'bootPassword' and 'encryptionKey' are pretty much unrelated [in Derby]. If you create the database with a boot password, you must always boot the database with a boot password. You cannot specify a "corresponding" encryption key to boot it. The same goes for encryptionKey, you cannot boot it using a corresponding boot password. Is my understanding correct? Further, it seems code handling these two concepts are co-located in the same classes/methods, and often a single error message is used for error-situations for both concepts. For instance, if I create an encrypted database using the encryptionKey attribute and try to boot it using an incorrect encryptionKey, or by using the bootPassword attribute, I get: ERROR XBM06: Startup failed. An encrypted database cannot be accessed without the correct boot password. Also, specifying both attributes gives the same exception/SQLState as above. Thus it seems this Jira is only one of several related problems/inaccuracies related to creating/booting encrypted databases. Can anyone with more knowledge comment on this? > Change error message to indicate encryptionkey length to be atleast 16 > characters instead of 8 characters > --------------------------------------------------------------------------------------------------------- > > Key: DERBY-1740 > URL: http://issues.apache.org/jira/browse/DERBY-1740 > Project: Derby > Issue Type: Bug > Affects Versions: 10.0.2.0 > Environment: Any > Reporter: Rajesh Kartha > Priority: Minor > Fix For: 10.2.1.0 > > Attachments: derby-1740-1a.diff > > > While attempting to create a encrypted database with even key length of 14 > characters, it fails with the error message indicating the key length should > be atleast 8 characters. > -- > -- Attempt to encrypt using key of lenght 14 > -- > ij> connect > 'jdbc:derby:adb;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=11223344556677'; > ERROR XJ041: Failed to create database 'adb', see the next exception for > details. > ERROR XBM01: Startup failed due to an exception. See next exception for > details. > ERROR XBCX2: Initializing cipher with a boot password that is too short. The > password must be at least 8 characters long. > -- > --Requires 16 characters for the encryptionKey > -- > ij> connect > 'jdbc:derby:adb;create=true;dataEncryption=true;encryptionAlgorithm=DES/CBC/NoPadding;encryptionKey=1122334455667788'; > ij> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira