Advertisement
Guest User

matrix shift v3 Decoding

a guest
Mar 28th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.57 KB | None | 0 0
  1. private static string MatrixDecrypt(string cryptogram, int[] key)
  2.         {
  3.             int[] revKey = new int[key.Length];
  4.  
  5.             for(int i=0; i<key.Length; i++)
  6.             {
  7.                 revKey[i] = (Array.IndexOf(key, i+1)+1);
  8.             }
  9.  
  10.             var decryptionStringList = Split(cryptogram, revKey.Length);
  11.             string plaintext = string.Empty;
  12.             foreach (string portion in decryptionStringList)
  13.             {
  14.                 plaintext += EncryptPortion(portion, revKey);
  15.             }
  16.             return plaintext;
  17.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement