예제 #1
0
 public static string affineEncrypt(int a, int b, string input)
 {
     //E(a,b,x)=a*x+b (mod 26)
     if (CryptographyUtils.gcd(a, CryptographyUtils.AlphabetLength) != 1)
     {
         Console.WriteLine("Niepoprawny klucz do enkrypcji");
         return(null);
     }
     return(CryptographyUtils.encrypt(a, b, input));
 }
예제 #2
0
 public static string caesarEncrypt(int key, string input)
 {
     //E(k,x)=x+k (mod 26)
     return(CryptographyUtils.encrypt(1, key, input));
 }