Error in Java program

An error in my Java code with the message "package org.bouncycastle.jce.provider does not exist". Any idea how to fix it ? I'm using Java 8.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sounds like your classpath is wrong and the Bouncy Castle jars are not in it
gskTechnology consultantCommented:
It seems package org.bouncycastle.jce.provider  is missing ,please look for package in your project structure naming
 org.bouncycastle.jce.provider.proper jars should be in the place (in the build path if required dependency)
Put in classpath these two libraries:

Why Diversity in Tech Matters

Kesha Williams, certified professional and software developer, explores the imbalance of diversity in the world of technology -- especially when it comes to hiring women. She showcases ways she's making a difference through the Colors of STEM program.

AXISHKAuthor Commented:
Can't find these jar files, where can I download them ? Thx
AXISHKAuthor Commented:
I have downloaded the JAR File : and put it under the library of my NetBean project. However, another message prompt up.

No such algorithm: DES/CRT/Nopadding. Any idea ?

    private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {                                        
        try {
           Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());

            input = Simple_txt.getText().getBytes();
            SecretKeySpec key = new SecretKeySpec(keyBytes, "DES");
            IvParameterSpec ivSpec = new IvParameterSpec(ivBytes);
            cipher = Cipher.getInstance("DES/CRT/NoPadding", "BC");
            cipher.init(Cipher.ENCRYPT_MODE, key,ivSpec);
            cipherText = new byte[cipher.getOutputSize(input.length)];
           ctLength = cipher.update(input, 0, input.length, cipherText, 0);
           ctLength += cipher.doFinal(cipherText, ctLength);
           Encrypt_txt.setText(new String(cipherText));
           System.out.println("cipher: " + new String(cipherText));
        } catch (Exception ex) {
            JOptionPane.showMessageDialog(null, ex);
gskTechnology consultantCommented:
What I can suggest at the moment that please put the jar in proper build path,secondly please start program in debug bug mode,run as java application in debug mode,press F5 ,F6 (hope you well aware) .Generally if jar is not there then IDE gives red color error in project,please put jars in lib folder(if exists) or in some proper directory.clean the porject.again run as java application,hope its simple java class.

please try and check whether it works.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cipher.getInstance("DES/CRT/NoPadding", "BC");

Open in new window

What code have you got that leads you to believe that algo is possible from that provider and where did you get it?
gskTechnology consultantCommented:
Thanks AXIHSK,it's nice to see its worked for are most welcome.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.