public static void Main()
string text = "Dgv@dmin@123";
string encText = additiveCipher(text, key);
string decText = decryptAdditiveCipher(encText, key);
Console.WriteLine("PT: {0} - ET: {1} - DT: {2}",text, encText, decText);
public static string additiveCipher(string text, int key)
string CipherText = null;
Console.WriteLine("Character : {0} - ASCII : {1} - EncryptedASCII : {2} - EncryptedChar : {3}", c, ASCII, ASCII + key, (char)(ASCII + key));
CipherText += ((char)(ASCII + key)).ToString();
public static string decryptAdditiveCipher(string text, int key)
string Decryptedtext = null;
Console.WriteLine("Character : {0} - ASCII : {1} - decryptedASCII : {2} - decryptedChar : {3}", c, ASCII, ASCII - key, (char)(ASCII - key));
Decryptedtext += ((char)(ASCII - key)).ToString();