0

I am using Jasypt in a linux bash script where I want to encrypt a text string with the algorithm PBEWithHmacSHA1AndDESede. When running the command:

./encrypt.sh input="This is my message to be encrypted" password=MYPAS_WORD verbose=false algorithm=PBEWITHHMACSHA1ANDDESEDE

I get the error:

ERROR: java.security.NoSuchAlgorithmException: PBEWITHHMACSHA1ANDDESEDE SecretKeyFactory not available

According to this link, PBEWithHmacSHA1AndDESede is included in SunJCE. My assumption is that SunJCE is included in the latest JDK. Is this correct? If not, how can I download the SunJCE jar file?

Daniel
  • 53
  • 2
  • 8
  • Do you have your JDK from Oracle? [Check yourself](http://stackoverflow.com/q/9333504/1816580) if it's there. Maybe you have multiple JRE's. Which is the public JRE? – Artjom B. Mar 20 '16 at 22:11
  • You really shouldn't be using DES (or 3DES) nowadays it's slower and less secure than AES. – Artjom B. Mar 20 '16 at 22:12
  • @artjom-b `java -version` `java version "1.8.0_73"` `Java(TM) SE Runtime Environment (build 1.8.0_73-b02)` `Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)` `javac -version` `javac 1.8.0_73` – Daniel Mar 20 '16 at 22:17
  • @artjom-b I know that DES is no longer secured, unfortunately I need to use this particular algorithm for compatibility with another app. – Daniel Mar 20 '16 at 23:20
  • I've installed BouncyCastle but the only two supported algorithms that start with PBEWITHHMACSHA1 are PBEWITHHMACSHA1ANDAES_128 and PBEWITHHMACSHA1ANDAES_256. – Daniel Mar 21 '16 at 01:06

0 Answers0