J9 + Encrypted Embedded Database

View: New views
5 Messages — Rating Filter:   Alert me  

J9 + Encrypted Embedded Database

by Cuong :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
So far I have an unencrypted embedded database which I can use within an OSGi bundle running inside the Knopflerfish framework.
This database was created using the ij tool (using Java 1.4)
CONNECT 'jdbc:derby:MYDB;create=true;

This all works fine with even when I'm running with J9 (with JSR169.jar).

Now I need to encrypt this database, therefore I had to change by database creation script
CONNECT 'jdbc:derby:MYDB;create=true;
                dataEncryption=true;
                bootPassword=we1come;'

The database will be created successfully, but when I try to 'open' the database (setting the appropriate parameters) I get the following errors

java.sql.SQLException: Encryption algorithm 'DES/CBC/NoPadding' does not exist. Please check that the chosen provider 'default' supports this algorithm.
Using Java 1.4 it will all be fine.

Has anyone successfully created and opened an encrypted database using j9?
There doesn't seem to be a definitive guide on how to do this.

Thanks in advance.

Re: J9 + Encrypted Embedded Database

by George H :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I have no idea about J9 but I have created encrypted derby databases and I think your missing some parameters.

dataEncryption=true;
bootPassword="blabla";
encryptionProvider=com.sun.crypto.provider.SunJCE;
encryptionAlgorithm=DESede/CBC/NoPadding;

The above will get you a somewhat decent encrypted DB.. if you consider DES as decent. You'd need to change the privider and algorithm to apply a strong crypt.

Hope this helps.
--
George H
george.dma@...


On Fri, Jun 19, 2009 at 11:53 AM, Cuong <cuong.luu@...> wrote:

Hi,
So far I have an unencrypted embedded database which I can use within an
OSGi bundle running inside the Knopflerfish framework.
This database was created using the ij tool (using Java 1.4)
CONNECT 'jdbc:derby:MYDB;create=true;

This all works fine with even when I'm running with J9 (with JSR169.jar).

Now I need to encrypt this database, therefore I had to change by database
creation script
CONNECT 'jdbc:derby:MYDB;create=true;
               dataEncryption=true;
               bootPassword=we1come;'

The database will be created successfully, but when I try to 'open' the
database (setting the appropriate parameters) I get the following errors

java.sql.SQLException: Encryption algorithm 'DES/CBC/NoPadding' does not
exist. Please check that the chosen provider 'default' supports this
algorithm.
Using Java 1.4 it will all be fine.

Has anyone successfully created and opened an encrypted database using j9?
There doesn't seem to be a definitive guide on how to do this.

Thanks in advance.
--
View this message in context: http://www.nabble.com/J9-%2B-Encrypted-Embedded-Database-tp24107762p24107762.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.



Re: J9 + Encrypted Embedded Database

by Cuong :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks George, but I already tried something similar to this.
In this instance I get the following error
Caused by: java.sql.SQLException: Encryption algorithm 'DESede/CBC/NoPadding' does not exist
But it will work if using Java1.4

I think the problem is because j9 does not include the classes to decrypt the database.
J9 does have it's own enryption provider (com.ibm.j9.jce.provider.J9JCEProvider) but I'm not sure how to use it.  I tried various things to try and create the database specifying this provider by to no avail.

George H wrote:
Hi,

I have no idea about J9 but I have created encrypted derby databases and I
think your missing some parameters.

dataEncryption=true;
bootPassword="blabla";
encryptionProvider=com.sun.crypto.provider.SunJCE;
encryptionAlgorithm=DESede/CBC/NoPadding;

The above will get you a somewhat decent encrypted DB.. if you consider DES
as decent. You'd need to change the privider and algorithm to apply a strong
crypt.

Hope this helps.
--
George H
george.dma@gmail.com


On Fri, Jun 19, 2009 at 11:53 AM, Cuong <cuong.luu@kirona.com> wrote:

>
> Hi,
> So far I have an unencrypted embedded database which I can use within an
> OSGi bundle running inside the Knopflerfish framework.
> This database was created using the ij tool (using Java 1.4)
> CONNECT 'jdbc:derby:MYDB;create=true;
>
> This all works fine with even when I'm running with J9 (with JSR169.jar).
>
> Now I need to encrypt this database, therefore I had to change by database
> creation script
> CONNECT 'jdbc:derby:MYDB;create=true;
>                dataEncryption=true;
>                bootPassword=we1come;'
>
> The database will be created successfully, but when I try to 'open' the
> database (setting the appropriate parameters) I get the following errors
>
> java.sql.SQLException: Encryption algorithm 'DES/CBC/NoPadding' does not
> exist. Please check that the chosen provider 'default' supports this
> algorithm.
> Using Java 1.4 it will all be fine.
>
> Has anyone successfully created and opened an encrypted database using j9?
> There doesn't seem to be a definitive guide on how to do this.
>
> Thanks in advance.
> --
> View this message in context:
> http://www.nabble.com/J9-%2B-Encrypted-Embedded-Database-tp24107762p24107762.html
> Sent from the Apache Derby Users mailing list archive at Nabble.com.
>
>

Re: J9 + Encrypted Embedded Database

by George H :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hmm I see.

I think the default algorithm is AES/CBC/NoPadding also I think this thread might help you. http://www.mail-archive.com/derby-user@.../msg04564.html
and perhaps this
--
George H
george.dma@...


On Fri, Jun 19, 2009 at 12:19 PM, Cuong <cuong.luu@...> wrote:

Thanks George, but I already tried something similar to this.
In this instance I get the following error
Caused by: java.sql.SQLException: Encryption algorithm
'DESede/CBC/NoPadding' does not exist
But it will work if using Java1.4

I think the problem is because j9 does not include the classes to decrypt
the database.
J9 does have it's own enryption provider
(com.ibm.j9.jce.provider.J9JCEProvider) but I'm not sure how to use it.  I
tried various things to try and create the database specifying this provider
by to no avail.


George H wrote:
>
> Hi,
>
> I have no idea about J9 but I have created encrypted derby databases and I
> think your missing some parameters.
>
> dataEncryption=true;
> bootPassword="blabla";
> encryptionProvider=com.sun.crypto.provider.SunJCE;
> encryptionAlgorithm=DESede/CBC/NoPadding;
>
> The above will get you a somewhat decent encrypted DB.. if you consider
> DES
> as decent. You'd need to change the privider and algorithm to apply a
> strong
> crypt.
>
> Hope this helps.
> --
> George H
> george.dma@...
>
>
> On Fri, Jun 19, 2009 at 11:53 AM, Cuong <cuong.luu@...> wrote:
>
>>
>> Hi,
>> So far I have an unencrypted embedded database which I can use within an
>> OSGi bundle running inside the Knopflerfish framework.
>> This database was created using the ij tool (using Java 1.4)
>> CONNECT 'jdbc:derby:MYDB;create=true;
>>
>> This all works fine with even when I'm running with J9 (with JSR169.jar).
>>
>> Now I need to encrypt this database, therefore I had to change by
>> database
>> creation script
>> CONNECT 'jdbc:derby:MYDB;create=true;
>>                dataEncryption=true;
>>                bootPassword=we1come;'
>>
>> The database will be created successfully, but when I try to 'open' the
>> database (setting the appropriate parameters) I get the following errors
>>
>> java.sql.SQLException: Encryption algorithm 'DES/CBC/NoPadding' does not
>> exist. Please check that the chosen provider 'default' supports this
>> algorithm.
>> Using Java 1.4 it will all be fine.
>>
>> Has anyone successfully created and opened an encrypted database using
>> j9?
>> There doesn't seem to be a definitive guide on how to do this.
>>
>> Thanks in advance.
>> --
>> View this message in context:
>> http://www.nabble.com/J9-%2B-Encrypted-Embedded-Database-tp24107762p24107762.html
>> Sent from the Apache Derby Users mailing list archive at Nabble.com.
>>
>>
>
>

--
View this message in context: http://www.nabble.com/J9-%2B-Encrypted-Embedded-Database-tp24107762p24108092.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.



Re: J9 + Encrypted Embedded Database

by Cuong :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Already seen this thread and this person seems to be having the same problem as me.  But I can't seem to find an answer anywhere.

It must be possible though....