Unix Technical Forum

oracle 10g cryptography problem

This is a discussion on oracle 10g cryptography problem within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Hi, I have a java stored procedure for oracle 10g (running jdk1.4) that uses the javax.crypto package and the ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 01:06 PM
Pouria
 
Posts: n/a
Default oracle 10g cryptography problem

Hi,

I have a java stored procedure for oracle 10g (running jdk1.4) that
uses the javax.crypto package and the bouncy castle provider for RSA
decryption. Here is a snippet of the code in the procedure:

Security.addProvider(new
org.bouncycastle.jce.provider.BouncyCastleProvider ());

Cipher rsaCipher = Cipher.getInstance("RSA");
RSAPrivateKey key = (RSAPrivateKey)
MSPrivKeytoJKey.getPrivateKey(aKey);
rsaCipher.init(Cipher.DECRYPT_MODE, key);
rsaCipher.doFinal(encryptedByteArray);

This works fine on my own machine running jdk1.4. However, when I load
my stored procedure into the database and run it, I get the following
exception after the line

Cipher rsaCipher = Cipher.getInstance("RSA");

tries to execute:

java.security.NoSuchAlgorithmException: Cannot find any provider
supporting RSA

I have tried the following (based on information gathered from various
forums):

- ran
loadjava -u username/pass@DB -v bcprov-jdk14-137.jar

- added the following line to java.security
security.provider.4=org.bouncycastle.jce.provider. BouncyCastleProvider

but i still get the same error.

I am reaching out desperately to all you experts for help

Pouria

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 01:06 PM
DA Morgan
 
Posts: n/a
Default Re: oracle 10g cryptography problem

Pouria wrote:
>
> Cipher rsaCipher = Cipher.getInstance("RSA");
>
> tries to execute:
>
> java.security.NoSuchAlgorithmException: Cannot find any provider
> supporting RSA


Which part of the message don't you understand?

And no version of Oracle named.

Put away the RSA and use the built-in tools. Obfuscation toolkit if
9i and DBMS_CRYPTO if 10g.
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-08-2008, 01:06 PM
Pouria
 
Posts: n/a
Default Re: oracle 10g cryptography problem

i understand the message, what i don't understand is why it can't find
an RSA provider when i'm purposely supplying it with one (bouncy
castle).

secondly i need to use an asymmetric cryptographic algorithm:
Obfuscation toolkit and DBMS_CRYPTO do not support these to the best
of my knowledge (please correct me if i'm wrong).

Pouria

On Jun 26, 6:27 pm, DA Morgan <damor...@psoug.org> wrote:
> Pouria wrote:
>
> > Cipher rsaCipher = Cipher.getInstance("RSA");

>
> > tries to execute:

>
> > java.security.NoSuchAlgorithmException: Cannot find any provider
> > supporting RSA

>
> Which part of the message don't you understand?
>
> And no version of Oracle named.
>
> Put away the RSA and use the built-in tools. Obfuscation toolkit if
> 9i and DBMS_CRYPTO if 10g.
> --
> Daniel A. Morgan
> University of Washington
> damor...@x.washington.edu (replace x with u to respond)
> Puget Sound Oracle Users Groupwww.psoug.org



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-08-2008, 01:06 PM
Pouria
 
Posts: n/a
Default Re: oracle 10g cryptography problem

by the way, my oracle version is 10.2.0.1 for windows xp.

On Jun 26, 6:27 pm, DA Morgan <damor...@psoug.org> wrote:
> Pouria wrote:
>
> > Cipher rsaCipher = Cipher.getInstance("RSA");

>
> > tries to execute:

>
> > java.security.NoSuchAlgorithmException: Cannot find any provider
> > supporting RSA

>
> Which part of the message don't you understand?
>
> And no version of Oracle named.
>
> Put away the RSA and use the built-in tools. Obfuscation toolkit if
> 9i and DBMS_CRYPTO if 10g.
> --
> Daniel A. Morgan
> University of Washington
> damor...@x.washington.edu (replace x with u to respond)
> Puget Sound Oracle Users Groupwww.psoug.org



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-08-2008, 01:07 PM
DA Morgan
 
Posts: n/a
Default Re: oracle 10g cryptography problem

Pouria wrote:
> i understand the message, what i don't understand is why it can't find
> an RSA provider when i'm purposely supplying it with one (bouncy
> castle).
>
> secondly i need to use an asymmetric cryptographic algorithm:
> Obfuscation toolkit and DBMS_CRYPTO do not support these to the best
> of my knowledge (please correct me if i'm wrong).
>
> Pouria
>
> On Jun 26, 6:27 pm, DA Morgan <damor...@psoug.org> wrote:
>> Pouria wrote:
>>
>>> Cipher rsaCipher = Cipher.getInstance("RSA");
>>> tries to execute:
>>> java.security.NoSuchAlgorithmException: Cannot find any provider
>>> supporting RSA

>> Which part of the message don't you understand?
>>
>> And no version of Oracle named.
>>
>> Put away the RSA and use the built-in tools. Obfuscation toolkit if
>> 9i and DBMS_CRYPTO if 10g.
>> --
>> Daniel A. Morgan
>> University of Washington
>> damor...@x.washington.edu (replace x with u to respond)
>> Puget Sound Oracle Users Groupwww.psoug.org


I may be incorrect on this but I believe AES is asymmetric.
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-08-2008, 01:07 PM
Vladimir M. Zakharychev
 
Posts: n/a
Default Re: oracle 10g cryptography problem

On Jun 27, 7:21 am, DA Morgan <damor...@psoug.org> wrote:
> Pouria wrote:
> > i understand the message, what i don't understand is why it can't find
> > an RSA provider when i'm purposely supplying it with one (bouncy
> > castle).

>
> > secondly i need to use an asymmetric cryptographic algorithm:
> > Obfuscation toolkit and DBMS_CRYPTO do not support these to the best
> > of my knowledge (please correct me if i'm wrong).

>
> > Pouria

>
> > On Jun 26, 6:27 pm, DA Morgan <damor...@psoug.org> wrote:
> >> Pouria wrote:

>
> >>> Cipher rsaCipher = Cipher.getInstance("RSA");
> >>> tries to execute:
> >>> java.security.NoSuchAlgorithmException: Cannot find any provider
> >>> supporting RSA
> >> Which part of the message don't you understand?

>
> >> And no version of Oracle named.

>
> >> Put away the RSA and use the built-in tools. Obfuscation toolkit if
> >> 9i and DBMS_CRYPTO if 10g.
> >> --
> >> Daniel A. Morgan
> >> University of Washington
> >> damor...@x.washington.edu (replace x with u to respond)
> >> Puget Sound Oracle Users Groupwww.psoug.org

>
> I may be incorrect on this but I believe AES is asymmetric.
> --
> Daniel A. Morgan
> University of Washington
> damor...@x.washington.edu (replace x with u to respond)
> Puget Sound Oracle Users Groupwww.psoug.org


AES is symmetric.

As of the OP's issue, note 369369.1 on MetaLink describes steps to add
and load third-party providers to the Oracle VM. Also, the note states
that there was a bug in 10.2.0.1 (bug #4475814) that prevented third-
party providers from working inside the Oracle VM, which is fixed in
10.2.0.2. In 10.2.0.1, only SunJce is supported. However, since SunJce
supports RSA, I don't see an urgent need to load Bouncy Castle and go
through the bouncing hassle of applying the patchset and then
following the note 369369.1 to make it work...

Regards,
Vladimir M. Zakharychev
N-Networks, makers of Dynamic PSP(tm)
http://www.dynamicpsp.com

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-08-2008, 01:07 PM
Pouria
 
Posts: n/a
Default Re: oracle 10g cryptography problem

Dear Vladimir ,

Unfortunately sunjce only supports RSA in jdk 1.5+ and for jdk 1.4
(used by oracle 10.2.0.1) a third party provider is needed. I have
followed the metalink instructions with no luck and 10.2.0.2 is not
available for 32-bit windows! Its quite the dilemma...

Pouria

> As of the OP's issue, note 369369.1 on MetaLink describes steps to add
> and load third-party providers to the Oracle VM. Also, the note states
> that there was a bug in 10.2.0.1 (bug #4475814) that prevented third-
> party providers from working inside the Oracle VM, which is fixed in
> 10.2.0.2. In 10.2.0.1, only SunJce is supported. However, since SunJce
> supports RSA, I don't see an urgent need to load Bouncy Castle and go
> through the bouncing hassle of applying the patchset and then
> following the note 369369.1 to make it work...



On Jun 28, 1:14 pm, "Vladimir M. Zakharychev"
<vladimir.zakharyc...@gmail.com> wrote:
> On Jun 27, 7:21 am, DA Morgan <damor...@psoug.org> wrote:
>
>
>
> > Pouria wrote:
> > > i understand the message, what i don't understand is why it can't find
> > > an RSA provider when i'm purposely supplying it with one (bouncy
> > > castle).

>
> > > secondly i need to use an asymmetric cryptographic algorithm:
> > > Obfuscation toolkit and DBMS_CRYPTO do not support these to the best
> > > of my knowledge (please correct me if i'm wrong).

>
> > > Pouria

>
> > > On Jun 26, 6:27 pm, DA Morgan <damor...@psoug.org> wrote:
> > >> Pouria wrote:

>
> > >>> Cipher rsaCipher = Cipher.getInstance("RSA");
> > >>> tries to execute:
> > >>> java.security.NoSuchAlgorithmException: Cannot find any provider
> > >>> supporting RSA
> > >> Which part of the message don't you understand?

>
> > >> And no version of Oracle named.

>
> > >> Put away the RSA and use the built-in tools. Obfuscation toolkit if
> > >> 9i and DBMS_CRYPTO if 10g.
> > >> --
> > >> Daniel A. Morgan
> > >> University of Washington
> > >> damor...@x.washington.edu (replace x with u to respond)
> > >> Puget Sound Oracle Users Groupwww.psoug.org

>
> > I may be incorrect on this but I believe AES is asymmetric.
> > --
> > Daniel A. Morgan
> > University of Washington
> > damor...@x.washington.edu (replace x with u to respond)
> > Puget Sound Oracle Users Groupwww.psoug.org

>
> AES is symmetric.
>
> As of the OP's issue, note 369369.1 on MetaLink describes steps to add
> and load third-party providers to the Oracle VM. Also, the note states
> that there was a bug in 10.2.0.1 (bug #4475814) that prevented third-
> party providers from working inside the Oracle VM, which is fixed in
> 10.2.0.2. In 10.2.0.1, only SunJce is supported. However, since SunJce
> supports RSA, I don't see an urgent need to load Bouncy Castle and go
> through the bouncing hassle of applying the patchset and then
> following the note 369369.1 to make it work...
>
> Regards,
> Vladimir M. Zakharychev
> N-Networks, makers of Dynamic PSP(tm)
> http://www.dynamicpsp.com



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-08-2008, 01:07 PM
Vladimir M. Zakharychev
 
Posts: n/a
Default Re: oracle 10g cryptography problem

On Jun 28, 9:18 pm, Pouria <pour...@gmail.com> wrote:

> > As of the OP's issue, note 369369.1 on MetaLink describes steps to add
> > and load third-party providers to the Oracle VM. Also, the note states
> > that there was a bug in 10.2.0.1 (bug #4475814) that prevented third-
> > party providers from working inside the Oracle VM, which is fixed in
> > 10.2.0.2. In 10.2.0.1, only SunJce is supported. However, since SunJce
> > supports RSA, I don't see an urgent need to load Bouncy Castle and go
> > through the bouncing hassle of applying the patchset and then
> > following the note 369369.1 to make it work...

>
> On Jun 28, 1:14 pm, "Vladimir M. Zakharychev"
>
> <vladimir.zakharyc...@gmail.com> wrote:
> > On Jun 27, 7:21 am, DA Morgan <damor...@psoug.org> wrote:

>
> > > Pouria wrote:
> > > > i understand the message, what i don't understand is why it can't find
> > > > an RSA provider when i'm purposely supplying it with one (bouncy
> > > > castle).

>
> > > > secondly i need to use an asymmetric cryptographic algorithm:
> > > > Obfuscation toolkit and DBMS_CRYPTO do not support these to the best
> > > > of my knowledge (please correct me if i'm wrong).

>
> > > > Pouria

>
> > > > On Jun 26, 6:27 pm, DA Morgan <damor...@psoug.org> wrote:
> > > >> Pouria wrote:

>
> > > >>> Cipher rsaCipher = Cipher.getInstance("RSA");
> > > >>> tries to execute:
> > > >>> java.security.NoSuchAlgorithmException: Cannot find any provider
> > > >>> supporting RSA
> > > >> Which part of the message don't you understand?

>
> > > >> And no version of Oracle named.

>
> > > >> Put away the RSA and use the built-in tools. Obfuscation toolkit if
> > > >> 9i and DBMS_CRYPTO if 10g.
> > > >> --
> > > >> Daniel A. Morgan
> > > >> University of Washington
> > > >> damor...@x.washington.edu (replace x with u to respond)
> > > >> Puget Sound Oracle Users Groupwww.psoug.org

>
> > > I may be incorrect on this but I believe AES is asymmetric.
> > > --
> > > Daniel A. Morgan
> > > University of Washington
> > > damor...@x.washington.edu (replace x with u to respond)
> > > Puget Sound Oracle Users Groupwww.psoug.org

>
> > AES is symmetric.

>
> > As of the OP's issue, note 369369.1 on MetaLink describes steps to add
> > and load third-party providers to the Oracle VM. Also, the note states
> > that there was a bug in 10.2.0.1 (bug #4475814) that prevented third-
> > party providers from working inside the Oracle VM, which is fixed in
> > 10.2.0.2. In 10.2.0.1, only SunJce is supported. However, since SunJce
> > supports RSA, I don't see an urgent need to load Bouncy Castle and go
> > through the bouncing hassle of applying the patchset and then
> > following the note 369369.1 to make it work...

>
> > Regards,
> > Vladimir M. Zakharychev
> > N-Networks, makers of Dynamic PSP(tm)
> > http://www.dynamicpsp.com

>
> Dear Vladimir ,
>
> Unfortunately sunjce only supports RSA in jdk 1.5+ and for jdk 1.4
> (used by oracle 10.2.0.1) a third party provider is needed. I have
> followed the metalink instructions with no luck and 10.2.0.2 is not
> available for 32-bit windows! Its quite the dilemma...
>
> Pouria
>

10.2.0.2 is definitely available for Win32 (locate patch 4547817 on
MetaLink through simple search by patch number,) but you can skip it
and patch right to 10.2.0.3 (patch 5337014) - Oracle patchsets are
cumulative. Carefully follow the instructions accompanying the
patchset to apply it. Then follow the instructions in the note
369269.1 and I'm sure that with a little bit of luck it will work.

Regards,
Vladimir M. Zakharychev
N-Networks, makers of Dynamic PSP(tm)
http://www.dynamicpsp.com

p.s. Please, do not top-post.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-08-2008, 01:08 PM
DA Morgan
 
Posts: n/a
Default Re: oracle 10g cryptography problem

Vladimir M. Zakharychev wrote:
> On Jun 27, 7:21 am, DA Morgan <damor...@psoug.org> wrote:
>> Pouria wrote:
>>> i understand the message, what i don't understand is why it can't find
>>> an RSA provider when i'm purposely supplying it with one (bouncy
>>> castle).
>>> secondly i need to use an asymmetric cryptographic algorithm:
>>> Obfuscation toolkit and DBMS_CRYPTO do not support these to the best
>>> of my knowledge (please correct me if i'm wrong).
>>> Pouria
>>> On Jun 26, 6:27 pm, DA Morgan <damor...@psoug.org> wrote:
>>>> Pouria wrote:
>>>>> Cipher rsaCipher = Cipher.getInstance("RSA");
>>>>> tries to execute:
>>>>> java.security.NoSuchAlgorithmException: Cannot find any provider
>>>>> supporting RSA
>>>> Which part of the message don't you understand?
>>>> And no version of Oracle named.
>>>> Put away the RSA and use the built-in tools. Obfuscation toolkit if
>>>> 9i and DBMS_CRYPTO if 10g.
>>>> --
>>>> Daniel A. Morgan
>>>> University of Washington
>>>> damor...@x.washington.edu (replace x with u to respond)
>>>> Puget Sound Oracle Users Groupwww.psoug.org

>> I may be incorrect on this but I believe AES is asymmetric.
>> --
>> Daniel A. Morgan
>> University of Washington
>> damor...@x.washington.edu (replace x with u to respond)
>> Puget Sound Oracle Users Groupwww.psoug.org

>
> AES is symmetric.
>
> As of the OP's issue, note 369369.1 on MetaLink describes steps to add
> and load third-party providers to the Oracle VM. Also, the note states
> that there was a bug in 10.2.0.1 (bug #4475814) that prevented third-
> party providers from working inside the Oracle VM, which is fixed in
> 10.2.0.2. In 10.2.0.1, only SunJce is supported. However, since SunJce
> supports RSA, I don't see an urgent need to load Bouncy Castle and go
> through the bouncing hassle of applying the patchset and then
> following the note 369369.1 to make it work...
>
> Regards,
> Vladimir M. Zakharychev
> N-Networks, makers of Dynamic PSP(tm)
> http://www.dynamicpsp.com
>


Thanks for the correction.
--
Daniel A. Morgan
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:43 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com