Using this hook, I’m sending order information along with credit card details from my WordPress site. To comply with PCI DSS, we are encrypting credit card information using PHP. However, I am not sure how to decrypt the encrypted data, including the card number, CVV, and expiration date, and then use that decrypted data in the z-credit module.
In short, after receiving the data, I want to decrypt specific values ( only related credit card info those are also coming as encrypted using openssl_random_pseudo_bytes ) from the data and then use those decrypted values in the z-credit module.
I’m the person who actually encrypting those data but as I mention i’m not aware how to decrypt when make.com receive those data. is there any module or way to decrypt my encrypted text?
Looking at the decryptions code in your Github gist there are a few suggestions I can make as to equivalent Make modules:
// Function to decrypt credit card information
function decryptCreditCard($encryptedCreditCard, $encryptionKey)
{
// Decode the base64-encoded string
$decodedData = base64_decode($encryptedCreditCard);
This will require 2 Make string functions to decode the base64 encrypted value first
// Decrypt the credit card number using AES-256-CBC algorithm
$decryptedCreditCard = openssl_decrypt(
$encryptedCreditCardData,
'aes-256-cbc',
$encryptionKey,
0, // Options
$iv
);
return $decryptedCreditCard;
}
And now that you have the decoded IV you can pass this to the Encrypt module to decrypt the key with your encryption key that you setup in the key configuration at the top of this module.
I put together a little scenario that encrypts/decrypts a sample credit card with a 128 bit key – you’re going to have to create the key once before you run it and select it in the first and last module. I generate a 16 byte IV by using the letters A through P in random order in the first module. blueprint (23).json (14.1 KB)