samedi 12 septembre 2020

C# i am trying to make simple Encryptor [duplicate]

i have made simple encryptor i need to encrypt words not only one letter and after that how can i decrypt word

        string[] Alpha = new string[]
        {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
        string[][] Encryptor = new string[][]
        {
          new string[] {"4", "/=", "@", "/-"},
          new string[] {"8", "13", "|3", "&" },
          new string[] {"(", "¢", "<", "[", },
          new string[] {"[)", "|>", "|)", "|]"},
          new string[] {"3", "€", "[-", "[=" },
          new string[] {"|=", "ƒ", "/="},
          new string[] {"6", "(_+"},
          new string[] {"#", "/-/", "[-]", "]-[", ")-(", "(-)"},
          new string[] {"1", "!", "|", "][", ":"},
          new string[] {"_|", "_/"},
          new string[] {"|<", "|{"},
          new string[] {"1_", "|_", "[_"},
          new string[] {"|V|", "|V/|"},
          new string[] {"|V", "/v"},
          new string[] {"[]", "0", "()"},
          new string[] {"|*", "|0", "|o" },
          new string[] {"(_,)", "()_", "0_", "O_"},
          new string[] {"2", "|?", "|2"},
          new string[] {"5", "$", "_/~" },
          new string[] {"7", "¯|¯" },
          new string[] {"(_)", "!_!", "|_|"},
          new string[] {"|/", "!/"},
          new string[] {"`//", "\v/", "|_|_/"},
          new string[] {"><", "}{", ")("},
          new string[] {"`/", "!/"},
          new string[] {"≥", "7_", ">_"}
        };
        Random rand = new Random();
        string str = Console.ReadLine();
        int index = Array.IndexOf(Alpha, str);
        string rez = Encryptor[index][rand.Next(Encryptor[index].Length)];

Here i'm Getting Error If Length is More then 1 "Index Is Out Of Range" Console.Write(rez);

        Console.ReadKey();



Aucun commentaire:

Enregistrer un commentaire