Encrypt String with base 64 encoder - CSharp System

CSharp examples for System:String Base64

Description

Encrypt String with base 64 encoder

Demo Code


using System.Web;
using System.Text.RegularExpressions;
using System.IO;/* www.ja  v a  2  s  .com*/
using System.Security.Cryptography;
using System.Diagnostics;
using System.Collections.Generic;
using System;

public class Main{
        public static string EncryptString(string strEncrypted)
        {
            byte[] b = System.Text.ASCIIEncoding.ASCII.GetBytes(strEncrypted);
            string encryptedConnectionString = Convert.ToBase64String(b);
            return encryptedConnectionString;
        }
}

Related Tutorials