Advertisement
Guest User

Untitled

a guest
Jan 31st, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 1.88 KB | None | 0 0
  1. // Decompiled with JetBrains decompiler
  2. // Type: Encryption_Code.Class1
  3. // Assembly: Encryption_Code, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
  4. // MVID: EB48BD7A-14EC-43DA-A31C-9BDD719EF0E4
  5. // Assembly location: C:\Users\ACER\Downloads\0F29D137-F310-469A-AED9-AABEC102CD0F\Encryption_Code.dll
  6.  
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10.  
  11. namespace Encryption_Code
  12. {
  13.   public class Class1
  14.   {
  15.     public int[,] key { get; set; }
  16.  
  17.     public string CreatetheCipher(string plainText, int rowsize, int colsize)
  18.     {
  19.       char[] chArray1 = plainText.ToCharArray();
  20.       int[,] numArray = new int[3, 3];
  21.       int num1 = 0;
  22.       int index1 = 0;
  23.       int num2 = Enumerable.Count<char>((IEnumerable<char>) chArray1);
  24.       for (int index2 = 0; index2 < rowsize; ++index2)
  25.       {
  26.         for (int index3 = 0; index3 < colsize; ++index3)
  27.         {
  28.           if (index1 < num2)
  29.           {
  30.             if (char.IsUpper(chArray1[index1]))
  31.               num1 = Convert.ToInt32((int) chArray1[index1] - 65);
  32.             numArray[index2, index3] = num1;
  33.             ++index1;
  34.           }
  35.           else
  36.             numArray[index2, index3] = 0;
  37.         }
  38.       }
  39.       int num3 = 0;
  40.       char[,] chArray2 = new char[3, 3];
  41.       for (int index2 = 0; index2 < rowsize; ++index2)
  42.       {
  43.         for (int index3 = 0; index3 < colsize; ++index3)
  44.         {
  45.           for (int index4 = 0; index4 < 3; ++index4)
  46.             num3 += this.key[index2, index4] * numArray[index4, index3];
  47.           char ch = (char) num3;
  48.           chArray2[index2, index3] = ch;
  49.           num3 = 0;
  50.         }
  51.       }
  52.       string str = string.Empty;
  53.       for (int index2 = 0; index2 < 3; ++index2)
  54.       {
  55.         for (int index3 = 0; index3 < 3; ++index3)
  56.           str += (string) (object) chArray2[index2, index3];
  57.       }
  58.       return str;
  59.     }
  60.   }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement