Guest User

Untitled

a guest
Dec 14th, 2022
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. // Decompiled with JetBrains decompiler
  2.  
  3.  
  4. using System;
  5. using System.Text;
  6.  
  7.  
  8. #nullable enable
  9. namespace NaughtyListManager
  10. {
  11. internal class Program
  12. {
  13. private static void Main(string[] args)
  14. {
  15. for (int index = 0; index < 3; ++index)
  16. {
  17. Console.WriteLine("Enter password: ");
  18. if (Program.ValidatePassword(Console.ReadLine()))
  19. {
  20. Console.WriteLine("Correct password");
  21. Console.ReadKey();
  22. break;
  23. }
  24. Console.WriteLine("Wrong password");
  25. }
  26. }
  27.  
  28. private static bool ValidatePassword(string? p)
  29. {
  30. if (string.IsNullOrEmpty(p))
  31. return false;
  32. string str1 = "JB1SNB1kaXodMEQo";
  33. string str2 = "GqfAnI9NnC3L3yx1gNMn";
  34. char[] chArray = new char[p.Length];
  35. for (int index = 0; index < p.Length; ++index)
  36. chArray[index] = (char) ((uint) p[index] ^ (uint) str2[index % str2.Length]);
  37. string base64String = Convert.ToBase64String(Encoding.UTF8.GetBytes(chArray));
  38. return str1 == base64String;
  39. }
  40. }
  41. }
  42.  
Add Comment
Please, Sign In to add comment