Skip to content

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

Description

@Amealsuraj

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions