Advertisement
Guest User

Untitled

a guest
Nov 16th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. public class SecurityManager
  2. {
  3. public static void CreateUser()
  4. {
  5. Console.WriteLine("Enter a username");
  6. var username = Console.ReadLine();
  7. Console.WriteLine("Enter your full name");
  8. var fullName = Console.ReadLine();
  9. Console.WriteLine("Enter your password");
  10. var password = Console.ReadLine();
  11. Console.WriteLine("Re-enter your password");
  12. var confirmPassword = Console.ReadLine();
  13.  
  14. if (password != confirmPassword)
  15. {
  16. Console.WriteLine("The passwords don't match");
  17. return;
  18. }
  19.  
  20. if (password.Length < 8)
  21. {
  22. Console.WriteLine("Password must be at least 8 characters in length");
  23. return;
  24. }
  25.  
  26. // Encrypt the password (just reverse it, should be secure)
  27. char[] array = password.ToCharArray();
  28. Array.Reverse(array);
  29.  
  30. Console.Write(String.Format("Saving Details for User ({0}, {1}, {2})\n",
  31. username,
  32. fullName,
  33. new string(array)));
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement