Skip to content

Instantly share code, notes, and snippets.

View SidShetye's full-sized avatar

Sid Shetye SidShetye

View GitHub Profile
@jbtule
jbtule / AESGCM.cs
Last active October 21, 2024 22:04
I have two code examples that I wrote for best practices encrypting a string in c#. They are both using authenticated encryption. http://stackoverflow.com/a/10366194/637783
/*
* This work (Modern Encryption of a String C#, by James Tuley),
* identified by James Tuley, is free of known copyright restrictions.
* https://gist.github.com/4336842
* http://creativecommons.org/publicdomain/mark/1.0/
*/
using System;
using System.IO;
using System.Text;