db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rajesh Kartha (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-1740) Change error message to indicate encryptionkey length to be atleast 16 characters instead of 8 characters
Date Tue, 22 Aug 2006 19:08:14 GMT
    [ http://issues.apache.org/jira/browse/DERBY-1740?page=comments#action_12429781 ] 
            
Rajesh Kartha commented on DERBY-1740:
--------------------------------------

The issue is only when the 'encryptionKey' paramater is used and is of length less than 16.
For example:

connect 'jdbc:derby:adb;create=true;dataEncryption=true;encryptionKey=11223344556677';
 the error  message is:
ERROR XBCX2: Initializing cipher with a boot password that is too short, must be at least
8 characters long

Two issues here are:
1) the length should mention 'atleast 16 characters long'
2) the message indicates 'boot password' shouldn't that be made 'encryption key'

Note: In this case I am not using any specific security provider. For the 'bootPassword' parameter
the message and behaviour is consistent.


Stack Trace:
===========
Here is the stack trace from the sane build of trunk:
C:\derby\trunk\TEST>java -Dij.exceptionTrace=true org.apache.derby.tools.ij
ij version 10.3
ij> connect 'jdbc:derby:adb;create=true;dataEncryption=true;encryptionKey=11223344556677';
ERROR XJ041: Failed to create database 'adb', see the next exception for details
.
java.sql.SQLException: Failed to create database 'adb', see the next exception for details.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:89)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:95)
        at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:174)

        at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(EmbedConnection.java:1985)
        at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(EmbedConnection.java:1600)
        at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:250)
        at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(EmbedConnection30.java:73)
        at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Driver30.java:74)
        at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:210)
        at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:117)
        at java.sql.DriverManager.getConnection(DriverManager.java:525)
        at java.sql.DriverManager.getConnection(DriverManager.java:140)
        at org.apache.derby.impl.tools.ij.ij.dynamicConnection(ij.java:1109)
        at org.apache.derby.impl.tools.ij.ij.ConnectStatement(ij.java:959)
        at org.apache.derby.impl.tools.ij.ij.ijStatement(ij.java:787)
        at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:327)
        at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:249)
        at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
        at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
        at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
        at org.apache.derby.tools.ij.main(ij.java:70)
ERROR XBM01: Startup failed due to an exception. See next exception for details.
ERROR XBM01: Startup failed due to an exception. See next exception for details.
        at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:298)
        at org.apache.derby.iapi.services.monitor.Monitor.exceptionStartingModule(Monitor.java:669)
        at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1850)
        at org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(BaseMonitor.java:1014)
        at org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Monitor.java:588)
        at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(EmbedConnection.java:1593)
        at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:250)
        at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(EmbedConnection30.java:73)
        at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Driver30.java:74)
        at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:210)

        at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:117)
        at java.sql.DriverManager.getConnection(DriverManager.java:525)
        at java.sql.DriverManager.getConnection(DriverManager.java:140)
        at org.apache.derby.impl.tools.ij.ij.dynamicConnection(ij.java:1109)
        at org.apache.derby.impl.tools.ij.ij.ConnectStatement(ij.java:959)
        at org.apache.derby.impl.tools.ij.ij.ijStatement(ij.java:787)
        at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:327)
        at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:249)
        at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
        at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
        at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
        at org.apache.derby.tools.ij.main(ij.java:70)
ERROR XBCX2: Initializing cipher with a boot password that is too short. The password must
be at least 8 characters long.
ERROR XBCX2: Initializing cipher with a boot password that is too short. The password must
be at least 8 characters long.
        at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:305)
        at org.apache.derby.impl.services.jce.JCECipherFactory.generateKey(JCECipherFactory.java:308)
        at org.apache.derby.impl.services.jce.JCECipherFactory.init(JCECipherFactory.java:610)
        at org.apache.derby.impl.services.jce.JCECipherFactory.<init>(JCECipherFactory.java:136)
        at org.apache.derby.impl.services.jce.JCECipherFactoryBuilder.createCipherFactory(JCECipherFactoryBuilder.java:60)
        at org.apache.derby.impl.store.raw.RawStore.setupEncryptionEngines(RawStore.java:1186)
        at org.apache.derby.impl.store.raw.RawStore.boot(RawStore.java:203)       
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1997)
        at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:291)
        at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:543)
        at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:419)
        at org.apache.derby.impl.store.access.RAMAccessManager.boot(RAMAccessManager.java:988)
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1997)
        at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:291)
        at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:543)
        at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:419)
        at org.apache.derby.impl.db.BasicDatabase.bootStore(BasicDatabase.java:739)
        at org.apache.derby.impl.db.BasicDatabase.boot(BasicDatabase.java:179)
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1997)
        at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:291)
        at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1832)
        at org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(BaseMonitor.java:1014)
        at org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Monitor.java:588)
        at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(EmbedConnection.java:1593)
        at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:250)
        at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(EmbedConnection30.java:73)
        at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Driver30.java:74)
        at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:210)
        at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:117)
        at java.sql.DriverManager.getConnection(DriverManager.java:525)
        at java.sql.DriverManager.getConnection(DriverManager.java:140)
        at org.apache.derby.impl.tools.ij.ij.dynamicConnection(ij.java:1109)
        at org.apache.derby.impl.tools.ij.ij.ConnectStatement(ij.java:959)
        at org.apache.derby.impl.tools.ij.ij.ijStatement(ij.java:787)
        at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:327)
        at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:249)
        at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
        at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
        at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
        at org.apache.derby.tools.ij.main(ij.java:70)
ij>

Java:
====
The Java version I am using is:

java version "1.5.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode)


10.0
====
The earliest version I had was: 10.0.2.2.349072

C:\POINTREL\10.0.2.2.349072>java org.apache.derby.tools.ij
ij version 10.0
--
--encryptionKey of 14 characters
--
ij> connect 'jdbc:derby:adb;create=true;dataEncryption=true;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, must be at least
8 characters long
--
--bootPassword of 6 characters, error message is correct, ERROR XBM07
--
ij> connect 'jdbc:derby:adb;create=true;dataEncryption=true;bootPassword=112233';
ERROR XJ041: Failed to create database 'adb', see the next exception for details.
ERROR XBM07: Startup failed, boot password must be at least 8 bytes long.
--
--bootPassword of 8 characters, as expected - passes
--
ij> connect 'jdbc:derby:adb;create=true;dataEncryption=true;bootPassword=11223344';
--
--encryptionKey of 16 characters, passes fine
--
ij> connect 'jdbc:derby:bdb;create=true;dataEncryption=true;encryptionKey=1122334455667788';
ij(CONNECTION1)>

Hope I answered all the questions.

> 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
>
>
> 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

        

Mime
View raw message