using System; using System.Security.Cryptography; public class Test { public static void Main() { Console.WriteLine(CriptSha1("teste")); } public static string CriptSha1(string secret) { string result = ""; byte[] key = System.Text.Encoding.UTF8.GetBytes(secret); SHA1 sha1 = SHA1Managed.Create(); byte[] hash = sha1.ComputeHash(key); foreach (byte b in hash) { result += b.ToString("X2"); } return result; } }