Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Decompiled with JetBrains decompiler
- using System;
- using System.Text;
- #nullable enable
- namespace NaughtyListManager
- {
- internal class Program
- {
- private static void Main(string[] args)
- {
- for (int index = 0; index < 3; ++index)
- {
- Console.WriteLine("Enter password: ");
- if (Program.ValidatePassword(Console.ReadLine()))
- {
- Console.WriteLine("Correct password");
- Console.ReadKey();
- break;
- }
- Console.WriteLine("Wrong password");
- }
- }
- private static bool ValidatePassword(string? p)
- {
- if (string.IsNullOrEmpty(p))
- return false;
- string str1 = "JB1SNB1kaXodMEQo";
- string str2 = "GqfAnI9NnC3L3yx1gNMn";
- char[] chArray = new char[p.Length];
- for (int index = 0; index < p.Length; ++index)
- chArray[index] = (char) ((uint) p[index] ^ (uint) str2[index % str2.Length]);
- string base64String = Convert.ToBase64String(Encoding.UTF8.GetBytes(chArray));
- return str1 == base64String;
- }
- }
- }
Add Comment
Please, Sign In to add comment