Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections.Generic;
- internal struct Account
- {
- private const string key = "ZhugeLiang10041812308234ZhugeLiang10041812308234ZhugeLiang10041812308234ZhugeLiang10041812308234";
- public string username;
- public string password;
- private HashSet<int> st;
- public string passwordDecrypted
- {
- get
- {
- try
- {
- return tryToDecrypt(password);
- }
- catch
- {
- return "123456";
- }
- }
- }
- public Account(string s)
- {
- string[] array = s.Split(';');
- username = array[0];
- password = array[1];
- st = new HashSet<int>();
- createSet();
- }
- private void createSet()
- {
- List<int> list = new List<int>();
- list.Add(1);
- list.Add(1);
- st.Add(1);
- for (int i = 2; i < "ZhugeLiang10041812308234ZhugeLiang10041812308234ZhugeLiang10041812308234ZhugeLiang10041812308234".Length; i++)
- {
- list.Add(list[i - 1] + list[i - 2]);
- st.Add(list[i]);
- }
- }
- private string tryToDecrypt(string s)
- {
- string text = s;
- string text2 = "ZhugeLiang";
- for (int i = 0; i < 6; i++)
- {
- text = decrypt(text);
- string text3 = text.Substring(0, text.Length - text2.Length);
- string a = text.Substring(text.Length - text2.Length, text2.Length);
- if (a == text2)
- {
- text = text3;
- break;
- }
- }
- return text;
- }
- private string decrypt(string s)
- {
- char[] array = new char[0];
- array = s.ToCharArray();
- string text = "";
- int num = 0;
- while (num < array.Length)
- {
- if (st.Contains(text.Length))
- {
- char c = array[num + 1];
- c = (char)(c - (ushort)text.Length);
- c = (char)(c - "ZhugeLiang10041812308234ZhugeLiang10041812308234ZhugeLiang10041812308234ZhugeLiang10041812308234"[text.Length]);
- text += c;
- num += 2;
- }
- else
- {
- char c2 = array[num];
- c2 = (char)(c2 - (ushort)text.Length);
- c2 = (char)(c2 - "ZhugeLiang10041812308234ZhugeLiang10041812308234ZhugeLiang10041812308234ZhugeLiang10041812308234"[text.Length]);
- text += c2;
- num++;
- }
- }
- return text;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement