wood burning stoves 2.0*
The moose likes Security and the fly likes program that uses Bouncycastle throws an exception of illegal key size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "program that uses Bouncycastle throws an exception of illegal key size" Watch "program that uses Bouncycastle throws an exception of illegal key size" New topic
Author

program that uses Bouncycastle throws an exception of illegal key size

Rob Lee
Greenhorn

Joined: Jun 03, 2012
Posts: 12

Hello mates,


the output is included in the topic.
Thank you all
Rob Lee
Greenhorn

Joined: Jun 03, 2012
Posts: 12
Hello everyone,

Well I found a solution for this but its problem that it uses less secure transformation algorithm

The output when using (PBEWITHSHA256AND128BITAES-CBC-BC) through an exception of illegal key size. However, when I have changed it to (PBEWithMD5AndDES) it worked just fine

the thing that I do not understand is Bouncycastle support (PBEWITHSHA256AND128BITAES-CBC-BC) but the program report the above exception. Any explanation(with code) would be much appreciated.

at last please help me in finding a solution for the below two topics:

PBE decryption does not work

Sorry about spamming the board with questions! But here another question about PBE encryption

Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1836
    
    7

If you're sure you haven't violated the key size restriction, you might need to install the unlimited strength policy files for the Java Crptography Extension (JCE).
A United States export restriction prevents Oracle from shipping the JDK with unlimited strength cryptograhpy, so maybe your key strength violates the standard policy.
You can download the unlimited strength policy files seperately from the Oracle website, at the same place you downoad the JDK, at the bottom of this page.


Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Rob Lee
Greenhorn

Joined: Jun 03, 2012
Posts: 12
Hello Jelle Klap,

First of all Thank you for your reply. At the Oracle download page I found "Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 7" which has two executable jar files and "Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 6" which has the same number of jars as well. As being a noob I have Tried to add all of those Jars (I know how to add them properly), I tried 1 jar at the time ,two jars and four jars, well all of the possibilities to be honest. But Still got the same exception of illegal key size. Anyway that should not be a problem as with using (PBEWithMD5AndDES) and a random salt am pretty much protected from rainbow-tables attacks I assume.

Kindly, Can you help me in solving the small problem below:



The problem basically is I want to convert the Slealedobject str to a Hex String by using Apache Base64 or any simpler way and then display it with (System.out.println(TheNameOfThestringDerivedFromThe SlealedObject);)

I have tried many ways but with no success. the output has been for the desired string in the below format with just a change in the the numbers in the output

javax.crypto.SealedObject@1d5550d

help by code is much appreciated for a noob like me

Thank you

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: program that uses Bouncycastle throws an exception of illegal key size