Enkash Developer Portal
Home
Home
Login
Home
Copy Page
Back to home
Gift Card Apis
Key Capabilities
Encryption & Decryption Guide
Authentication
Auth Token
Create Gift Card
POST
Get Card Balance
POST
Get Transaction Details
POST
Home
Home
Login
Home
Copy Page
Authentication
PI Encryption Guidelines
#
All API requests must be encrypted using AES (ECB mode, PKCS5Padding) before transmission.
This page provides the required imports, encryption/decryption utilities, and essential developer tips to ensure proper integration.
Encrypting Request Payloads
#
Use the encrypt method to convert plaintext request data into an AES-encrypted Base64 string.
Encrypt Function
#
Generate SecretKeySpec
#
The following utility converts the provided secret key into a 128-bit AES key using SHA-256 hashing.
Decrypt Function
#
Use the following method to decrypt API responses that return AES-encrypted data.
Encryption Secret Key
#
Use the following secret key for all encryption and decryption:
Developer Tips
#
Remove double quotes from plaintext before encrypting
Avoid trailing whitespaces in the encrypted string
Ensure encrypted payloads are passed in the correct request field (e.g.,
payload
,
requestData
)
Modified at
2025-12-22 18:00:02
Previous
Encryption & Decryption Guide
Next
Auth Token