public class SubstitutionCipher
public static void Main()
string key = "1qazxsw23edcvfr45tgbnhy67ujm,ki89ol./;p0-[']=~`¥{}QAZXCDEW";
string plainText = "Im a student in Ness program";
string cipherText = Encrypt(plainText, key);
Console.WriteLine("Plain : {0}", plainText);
Console.WriteLine("Encrypted : {0}", cipherText);
static string Encrypt(string plainText, string key)
char[] chars = new char[plainText.Length];
for(int i = 0; i < plainText.Length; i++)
int j = plainText[i] - 65 ;
return new string(chars);