Posts

Showing posts with the label How to Encrypt and Decrypt Data Using c#

Encryption / Decryption in C#

Image
Introduction: As as web Developer some times you need encryption and Decryption in c#. for this purpose a quick code snap is given below. Solution: C# Encryption Function: public static string Encrypt( string textToEncrypt, int key)     {         StringBuilder inSb = new StringBuilder (textToEncrypt);         StringBuilder outSb = new StringBuilder (textToEncrypt.Length);         char c;         for ( int i = 0; i < textToEncrypt.Length; i++)         {             c = inSb[i];                    if (c <= 32)             {     ...