Encrypt and decrypt a string in C#? [closed]

EDIT 2013-Oct: Although I’ve edited this answer over time to address shortcomings, please see jbtule’s answer for a more robust, informed solution. https://stackoverflow.com/a/10366194/188474 Original Answer: Here’s a working example derived from the “RijndaelManaged Class” documentation and the MCTS Training Kit. EDIT 2012-April: This answer was edited to pre-pend the IV per jbtule’s suggestion and as … Read more