Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Decompiled with JetBrains decompiler
- // Type: Encryption_Code.Class1
- // Assembly: Encryption_Code, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
- // MVID: EB48BD7A-14EC-43DA-A31C-9BDD719EF0E4
- // Assembly location: C:\Users\ACER\Downloads\0F29D137-F310-469A-AED9-AABEC102CD0F\Encryption_Code.dll
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace Encryption_Code
- {
- public class Class1
- {
- public int[,] key { get; set; }
- public string CreatetheCipher(string plainText, int rowsize, int colsize)
- {
- char[] chArray1 = plainText.ToCharArray();
- int[,] numArray = new int[3, 3];
- int num1 = 0;
- int index1 = 0;
- int num2 = Enumerable.Count<char>((IEnumerable<char>) chArray1);
- for (int index2 = 0; index2 < rowsize; ++index2)
- {
- for (int index3 = 0; index3 < colsize; ++index3)
- {
- if (index1 < num2)
- {
- if (char.IsUpper(chArray1[index1]))
- num1 = Convert.ToInt32((int) chArray1[index1] - 65);
- numArray[index2, index3] = num1;
- ++index1;
- }
- else
- numArray[index2, index3] = 0;
- }
- }
- int num3 = 0;
- char[,] chArray2 = new char[3, 3];
- for (int index2 = 0; index2 < rowsize; ++index2)
- {
- for (int index3 = 0; index3 < colsize; ++index3)
- {
- for (int index4 = 0; index4 < 3; ++index4)
- num3 += this.key[index2, index4] * numArray[index4, index3];
- char ch = (char) num3;
- chArray2[index2, index3] = ch;
- num3 = 0;
- }
- }
- string str = string.Empty;
- for (int index2 = 0; index2 < 3; ++index2)
- {
- for (int index3 = 0; index3 < 3; ++index3)
- str += (string) (object) chArray2[index2, index3];
- }
- return str;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement