Please provide apex code examples to encrypt and decrypt a string using all of the supported encryption algorithms (AES128, AES192, and AES256). I searched for clear and concise code examples on this site, but found none (if you know of an answer with all said examples, please point me that way). I have tried to encrypt a String with the Crypto class, but was unsuccessful. Instead of debugging my code, I think it will be more helpful to look at some working examples.
Thanks 😀
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_crypto.htm
Best Answer
The below wiki gives good set of examples for crypto classes
http://wiki.developerforce.com/page/Apex_Crypto_Class
A sample scenario from above article
Here is below blog that points a use case of how to store once we encrypt data in sfdc
http://cloudyworlds.blogspot.in/2014/01/encrypting-xml-response-from-external.html
Basically there are two versions