Hi,
how can I implement AES encryption with hexadecimal output?
You can do it in two steps:
CryptoAPI_AES_Encrypt
PlainText
Password
Key
Salt
IV
Iterations
BinaryData\Base64ToBinary
Example (server action flow):
PlainText (Text) → CryptoAPI_AES_Encrypt → EncryptedBinary (Binary)
If the encrypt action returns text (Base64):
PlainText → CryptoAPI_AES_Encrypt (returns Base64Text) → Base64ToBinary(Base64Text) = EncryptedBinary
Use the BinaryData extension:
BinaryToHex
[0-9A-F]
Example (continuing the flow):
EncryptedBinary → BinaryToHex → EncryptedHex (Text)
Now EncryptedHex is your AES-encrypted value in hexadecimal format (no special characters).
EncryptedHex
To decrypt, reverse the process:
HexToBinary(EncryptedHex)
CryptoAPI_AES_Decrypt
EncryptedHex (Text) → HexToBinary = EncryptedBinary (Binary) → CryptoAPI_AES_Decrypt(EncryptedBinary, Password/Key, …) → PlainText (Text)
This pattern is aligned with how AES + hex is usually suggested in OutSystems (encrypt with AES, then format with Hex instead of Base64). SH1 Encrypt with key
You can find the BinaryData extension (system component) documentation and download page here:
BinaryData (System Components): https://www.outsystems.com/forge/component-overview/4511/binarydata BinaryData
After you add it from Forge to your environment, open your module in Service Studio, go to Logic > Dependencies, search for BinaryData, and add it so you can use actions like BinaryDataToHex. BinaryData API
BinaryDataToHex
Hi @Andrew Mahfouz
Is this issue resolved? If not, shall I share an OML to help you?
Thanks,
Sudip
Can you share oml
Hey @Andrew Mahfouz
Try the below OML and let me know if you need some help. But before that you need to install the below component from Forge