Encryption & Decryption Guide for EnKash API Integration
EnKash APIs require AES encryption with ECB mode and PKCS5 padding to secure request payloads. This guide walks you through implementing encryption and decryption in Java before sending and receiving API requests.
To decrypt the API response, implement the following
1
Decryption Function
2
Decrypt API Response
After receiving an encrypted API response, decrypt it using the following:
Do not include double quotes (" ") in input strings. Ensure no trailing whitespaces exist in the encrypted string. Use the same secret key for both encryption and decryption. Always handle exceptions to avoid unexpected failures.