Esempio n. 1
0
        public static string Encipher(string PlainText, Key key)
        {
            char[] PlainTextChars = PlainText.ToCharArray();
            for (int i = 0; i < PlainTextChars.Length; i++)
            {
                PlainTextChars[i] = (char)ModulMath.FastExp((Int32)PlainTextChars[i], key.x, key.n);
            }
            string CipherText = new string(PlainTextChars);

            return(CipherText);
        }
Esempio n. 2
0
 public static int Encipher(int number, Key key)
 {
     return((char)ModulMath.FastExp(number, key.x, key.n));
 }