Hi Fadil,
Three ways come to my mind:
1-Use Encryption module https://marketplace.mendix.com/link/component/1011 and read this https://docs.mendix.com/appstore/modules/encryption/
2- Create a custom Java action which does the same
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
public class EncryptionHelper {
public static String encrypt(String plainText, String key, String iv) throws Exception {
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
SecretKeySpec secretKeySpec = new SecretKeySpec(key.getBytes("UTF-8"), "AES");
IvParameterSpec ivParameterSpec = new IvParameterSpec(iv.getBytes("UTF-8"));
cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivParameterSpec);
byte[] encrypted = cipher.doFinal(plainText.getBytes("UTF-8"));
return new String(Base64.getEncoder().encode(encrypted));
}
}
3- If you know any external service can do this thing you might use REST Service to achieve that
Regards