cancel
Showing results for 
Search instead for 
Did you mean: 

BadPaddingException: Invalid PKCS#5 padding: not all padding bytes are equal!

Former Member
0 Kudos

Hi,

  I am trying to decrypt an encrypted customer record that has Last Name, First Name and Middle Name(All these 3 fields come encrypted).

I am getting this exception while decrypting the middle name. Tried sending trimmed encrypted value to the decryption module and also non-trimmed encrypted value to the decryption module but didn't yield any furitful result.

com.triversity.security.service.GeneralTWSecurityException: com.triversity.security.service.GeneralTWSecurityException: javax.crypto.BadPaddingException: Invalid PKCS#5 padding: not all padding bytes are equal!

I am using TW Security libraries for decryption provided by SAP.

Any pointers to this issue is truly appreciated.

Thanks,

Sarat

Accepted Solutions (0)

Answers (2)

Answers (2)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Sarat,

               Did you try to decrypt the data outside PI ? Please check if the module code works in NWDS or eclipse. 

Regards

Anupam

Former Member
0 Kudos

Hi Sarat,

My reply might not give you the solution to your current problem but I think it's good to mention that I also went through similar problems when trying to decrypt payload in PI. We were using external decryption java api's implemented within an adapter module called from PI's adapter engine.

Encrypting functionality went fine but decryption caused a lot of issues. Finally and after many tests we decided to temporary move the decryption functionality outside PI until SAP can provide us with a solution/patch for the problem. During the tests we noticed that whenever we tested the same logic outside PI it worked, even under the same OS and Server using JVM did work.

Regards, Roberto Viana