We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I tried to integrate JNCryptor in Play Framework 2.2 application but I get following exception
org.cryptonode.jncryptor.CryptorException: Caught InvalidKeyException. Do you have unlimited strength jurisdiction files installed? at org.cryptonode.jncryptor.AES256JNCryptor.encryptData(AES256JNCryptor.java:334) at org.cryptonode.jncryptor.AES256JNCryptor.encryptData(AES256JNCryptor.java:353) at controllers.Application.crypto(Application.java:24) at Routes$$anonfun$routes$1$$anonfun$applyOrElse$2$$anonfun$apply$2.apply(routes_routing.scala:61) at Routes$$anonfun$routes$1$$anonfun$applyOrElse$2$$anonfun$apply$2.apply(routes_routing.scala:61) at play.core.Router$HandlerInvoker$$anon$7$$anon$2.invocation(Router.scala:183) at play.core.Router$Routes$$anon$1.invocation(Router.scala:377) at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:56) at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:91) at play.core.j.JavaAction$$anon$3.apply(JavaAction.scala:90) at play.core.j.FPromiseHelper$$anonfun$flatMap$1.apply(FPromiseHelper.scala:82) at play.core.j.FPromiseHelper$$anonfun$flatMap$1.apply(FPromiseHelper.scala:82) at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:278) at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:274) at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29) at play.core.j.HttpExecutionContext$$anon$2.run(HttpExecutionContext.scala:37) at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:42) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) Caused by: java.security.InvalidKeyException: Illegal key size at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1024) at javax.crypto.Cipher.implInit(Cipher.java:790) at javax.crypto.Cipher.chooseProvider(Cipher.java:849) at javax.crypto.Cipher.init(Cipher.java:1348) at javax.crypto.Cipher.init(Cipher.java:1282) at org.cryptonode.jncryptor.AES256JNCryptor.encryptData(AES256JNCryptor.java:321) ... 21 more
I use Oracle's 1.7.0 JDK on OS X system. I used exactly your example, so my Application.java file looks like this:
Application.java
package controllers; import play.Logger; import play.mvc.*; import views.html.*; import org.cryptonode.jncryptor.*; public class Application extends Controller { public static Result index() { return ok(index.render("Your new application is ready.")); } public static Result crypto() { JNCryptor cryptor = new AES256JNCryptor(); byte[] plaintext = "Hello, World!".getBytes(); String password = "secretsquirrel"; Logger.debug("password length: " + password.toCharArray().length + "\n"); try { byte[] ciphertext = cryptor.encryptData(plaintext, password.toCharArray()); return ok(new String(ciphertext)); } catch (CryptorException e) { e.printStackTrace(); } return ok("Not encrypted :("); } }
Did anyone try to integrate JNCryptor with Play Framework and Java 1.7 and had similar issue?
The text was updated successfully, but these errors were encountered:
Did you heed the error: "Do you have unlimited strength jurisdiction files installed?"
http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html
http://suhothayan.blogspot.com/2012/05/how-to-install-java-cryptography.html
Sorry, something went wrong.
Thanks, tips from your link http://suhothayan.blogspot.com/2012/05/how-to-install-java-cryptography.html worked. I think you can add it to your readme. Two points are crucial:
jre\lib\security
jdk\lib\security
Thanks again for your help :)
No branches or pull requests
I tried to integrate JNCryptor in Play Framework 2.2 application but I get following exception
I use Oracle's 1.7.0 JDK on OS X system. I used exactly your example, so my
Application.java
file looks like this:Did anyone try to integrate JNCryptor with Play Framework and Java 1.7 and had similar issue?
The text was updated successfully, but these errors were encountered: