Skip to content
New issue

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

nested exception is javax.crypto.BadPaddingException: pad block corrupted #48

Open
Amealsuraj opened this issue Dec 19, 2023 · 0 comments

Comments

@Amealsuraj
Copy link

Amealsuraj commented Dec 19, 2023

https://github.com/ONDC-Official/reference-implementations/blob/fe5ed71ead469271bd1504e9e708cdc28885cf0b/utilities/ondc-crypto-utility-master/src/main/java/org/ondc/crypto/util/CryptoFunctions.java#L235C2-L255C1

I am using the method encryptDecrypt at line number 235 to decrypt the challenge string sent by ONDC.
It gives pad block corrupted error, so I changed the line 249 to
Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding", BouncyCastleProvider.PROVIDER_NAME);

It removes the padding error.
Decrypted challenge string by given code is not matching with expected decrypted string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant