Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8673709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:31:39+00:00 2026-06-12T19:31:39+00:00

256 but it doesnt seems to be working in GAE.I have download the Java

  • 0

256
but it doesnt seems to be working in GAE.I have download the “Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files” and local_policy.jar,US_export_policy.jar are present in C:\Program Files\Java\jdk1.6.0_29\jre\lib\security location.

here is the code:

import java.security.spec.KeySpec;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.*;

import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.SecretKeySpec;

public class AESEncrypter {

private static final byte[] SALT = {
    (byte) 0xA9, (byte) 0x9B, (byte) 0xC8, (byte) 0x32,
    (byte) 0x56, (byte) 0x35, (byte) 0xE3, (byte) 0x03
};
private static final int ITERATION_COUNT = 65536;
private static final int KEY_LENGTH = 256;
private Cipher ecipher;
private Cipher dcipher;

AESEncrypter(String passPhrase) throws Exception {
    SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
    KeySpec spec = new PBEKeySpec(passPhrase.toCharArray(), SALT, ITERATION_COUNT, KEY_LENGTH);
    SecretKey tmp = factory.generateSecret(spec);
    SecretKey secret = new SecretKeySpec(tmp.getEncoded(), "AES");

    ecipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
    ecipher.init(Cipher.ENCRYPT_MODE, secret);

    dcipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
    byte[] iv = ecipher.getParameters().getParameterSpec(IvParameterSpec.class).getIV();
    dcipher.init(Cipher.DECRYPT_MODE, secret, new IvParameterSpec(iv));
}

public String encrypt(String encrypt) throws Exception {
    byte[] bytes = encrypt.getBytes("UTF8");
    byte[] encrypted = encrypt(bytes);
    return new Base64().encodeBase64String(encrypted);
}

public byte[] encrypt(byte[] plain) throws Exception {
    return ecipher.doFinal(plain);
}

public String decrypt(String encrypt) throws Exception {
    byte[] bytes = new Base64().decodeBase64(encrypt);
    byte[] decrypted = decrypt(bytes);
    return new String(decrypted, "UTF8");
}

public byte[] decrypt(byte[] encrypt) throws Exception {
    return dcipher.doFinal(encrypt);
}

public static void main(String[] args) throws Exception {

    String message = "MESSAGE";
    String password = "PASSWORD";

    AESEncrypter encrypter = new AESEncrypter(password);
    String encrypted = encrypter.encrypt(message);
    String decrypted = encrypter.decrypt(encrypted);

    System.out.println("Encrypt(\"" + message + "\", \"" + password + "\") = \"" + encrypted + "\"");
    System.out.println("Decrypt(\"" + encrypted + "\", \"" + password + "\") = \"" + decrypted + "\"");
}

}

Any help would be appreciated
Thanks!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:31:41+00:00Added an answer on June 12, 2026 at 7:31 pm

    Your exception is definitely caused by missing unlimited strength jurisdiction files.

    You’ve stated that these have been downloaded and stored in your Java 6 JDK. I would ensure you have also stored copies in the lib/security folder of your JRE installation too, if you have one.

    Make sure you know exactly which java command is being invoked when your application is executed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code to download a file in the notification system. But
I have a byte[] in Java which reports its length as 256 bytes which
I am using AES 256 to encrypt/decrypt some plain text. But the algorithm uses
I'm trying to encrypt an array of 256 bytes by using RSACryptoServiceProvider but I'm
I have the string temp[256] and inside it there's a double number, such as
I have some binary data produced as base-256 bytestrings in Python (2.x). I need
I have a large SVG file (approx. 60 MB, 10000x10000 pixels but with the
This is what I have so far, but it doesn't seem to match http://zorc.breitbandkatze.de/crc.html
I have a Google Map that won't show up. The Problem seems to be
I am doing something in CUDA (FFT), but I have no idea why it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.