• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

program that uses Bouncycastle throws an exception of illegal key size

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hello mates,


the output is included in the topic.
Thank you all
 
Rob Lee
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rob Lee
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

reply
    Bookmark Topic Watch Topic
  • New Topic