Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
226 views
in Technique[技术] by (71.8m points)

Unlimited Security (Jasypt/WebSphere)

I am trying to encrypt a few password in a properties file using an Ant script. When I run the Ant script I get:

java.lang.RuntimeException: Security Error in doEncrypt: org.jasypt.exceptions.EncryptionInitializationException: java.security.NoSuchAlgorithmException: PBEWithHMACSHA512AndAES_256 SecretKeyFactory not available

this is with org.jasypt.util.text.AES256TextEncryptor. So I tried to move to PooledPBEStringEncryptor and that throws org.jasypt.exceptions.EncryptionOperationNotPossibleException

I have this in the code for the latter:

Security.setProperty("crypto.policy", "unlimited");

pooledPBEStringEncryptor = new PooledPBEStringEncryptor();

pooledPBEStringEncryptor.setPassword(encryptionKey);
pooledPBEStringEncryptor.setAlgorithm("PBEWITHHMACSHA512AND256BITAES");
pooledPBEStringEncryptor.setPoolSize(4);
pooledPBEStringEncryptor.setSaltGenerator(new RandomSaltGenerator());

This is how I initialize the object.

I am on WebSphere 8.5.5.10 and JAVA8 on a Unix system. My JDK version is:

java version "1.8.0"
Java(TM) SE Runtime Environment (build pxa6480sr3ifix-20160713_01(SR3+IX90174+IV85763))
IBM J9 VM (build 2.8, JRE 1.8.0 Linux amd64-64 Compressed References 20160713_311397 (JIT enabled, AOT enabled)
J9VM - R28_Java8_SR3_20160713_0915_B311397
JIT  - tr.r14.java.green_20160329_114288
GC   - R28_Java8_SR3_20160713_0915_B311397_CMPRSS
J9CL - 20160713_311397)
JCL - 20160421_01 based on Oracle jdk8u91-b14

Any advise would be nice. I searched for IBM WebSpehre forums, but couldn't find any. Thanks in advance.

question from:https://stackoverflow.com/questions/65829827/unlimited-security-jasypt-websphere

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This may help:

  1. How to verify the Unlimited Strength Jurisdiction Policy Files used on local_policy.jar & US_export_policy.jar and also How to check the list of ciphers used by IBM Java?

https://www.ibm.com/support/pages/node/1171564


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...