private static final String cryptoKey = ‘1234567890123456’;
public static String encryptedData(String s) {
Blob encryptedData = Crypto.encryptWithManagedIV(‘AES128’, Blob.valueOf(cryptoKey), Blob.valueOf(s));
return EncodingUtil.base64Encode(encryptedData);
}
public static String decryptedData(String s) {
Blob decryptedData = Crypto.decryptWithManagedIV(‘AES128’, Blob.valueOf(cryptoKey), EncodingUtil.base64Decode(s));
return decryptedData.toString();
}