Forum Stats

  • 3,838,747 Users
  • 2,262,397 Discussions
  • 7,900,747 Comments

Discussions

password decryption issue - PBEWithMD5AndDES

IBM SDK 1.7 on zOS platform throws IOException during encoding (at algParams.init(paramsBytes); ) and same code works fine on LINUX platform with SUN JDK 1.7.  

Tried byte[] paramsBytes = Base64.decodeBase64(paramStr.getBytes("IBM-1047")) and getting same issue on zOS platform.

We do not see any issue during encoding and it uses Apache commons codec for Base64 encoding/decoding.

   AlgorithmParameters algParams = AlgorithmParameters.getInstance("PBEWithMD5AndDES");

    byte[] paramsBytes = Base64.decodeBase64(paramStr.getBytes());

    algParams.init(paramsBytes);

java.io.IOException: extra data given to DerValue constructor

        at com.ibm.security.util.DerValue.init(DerValue.java:392)

        at com.ibm.security.util.DerValue.<init>(DerValue.java:291)

        at com.ibm.crypto.provider.PBEParameters.engineInit(Unknown Source)

        at java.security.AlgorithmParameters.init(AlgorithmParameters.java:304)

This discussion has been closed.