Пример #1
0
 /// <summary>
 /// SHA1
 /// </summary>
 /// <returns>Mensagem encriptada</returns>
 public static string CreateHash(string mensagemoriginal)
 {
     return(Cryptographer.CreateHash("SHA1Managed", mensagemoriginal));
 }
Пример #2
0
 public static byte[] SHACreateHash(byte[] plainText)
 {
     return(Cryptographer.CreateHash(SHAProviderName, plainText));
 }
Пример #3
0
        public static string HashEncrypt(string input)
        {
            string hashed = Cryptographer.CreateHash(HashKey, input);

            return(hashed);
        }
Пример #4
0
 /// <summary>
 /// 创建HASH方式加密字符串
 /// </summary>
 /// <param name="hashName">HASH加密方式</param>
 /// <param name="encrytData">需要加密的字符串</param>
 /// <returns>加密字符串</returns>
 public static string CreateHash(string hashName, string encrytData)
 {
     return(Cryptographer.CreateHash(hashName, encrytData));
 }
Пример #5
0
 public static string SHACreateHash(string plainText)
 {
     return(Cryptographer.CreateHash(SHAProviderName, plainText));
 }
        public void CompareHashWithZeroLengthInstanceStringThrows()
        {
            string hash = Cryptographer.CreateHash(hashInstance, plainTextString);

            Cryptographer.CompareHash(string.Empty, plainTextString, hash);
        }
Пример #7
0
 public string CreateHashOnMD5Cng(string plainValue)
 {
     return(Cryptographer.CreateHash("MD5CngCrypto", plainValue));
 }
Пример #8
0
 public void CreateHashWithZeroLengthInstanceStringThrows()
 {
     Cryptographer.CreateHash(string.Empty, plainTextString);
 }
Пример #9
0
 public void CompareHashWithNullInstanceThrows()
 {
     byte[] hash = Cryptographer.CreateHash(hashInstance, plainTextBytes);
     Cryptographer.CompareHash(null, plainTextBytes, hash);
 }
Пример #10
0
 public void CreateHashWithNullInstanceThrows()
 {
     Cryptographer.CreateHash(null, plainTextBytes);
 }
Пример #11
0
 public void CreateHashWithNullInstanceStringThrows()
 {
     Cryptographer.CreateHash(null, plainTextString);
 }
Пример #12
0
        public static string CreateHash(string texto)
        {
            string textoHash = Cryptographer.CreateHash(HashProviderName, texto);

            return(textoHash);
        }
Пример #13
0
 public string CreateHash(string value)
 {
     return(Cryptographer.CreateHash("HashProvider", value, this.ConfigurationContext));
 }
Пример #14
0
 public byte[] CreateHash(byte[] value)
 {
     return(Cryptographer.CreateHash("HashProvider", value, this.ConfigurationContext));
 }
 public void CompareHashWithZeroLengthInstanceThrows()
 {
     byte[] hash = Cryptographer.CreateHash(hashInstance, plainTextBytes);
     Cryptographer.CompareHash(string.Empty, plainTextBytes, hash);
 }
Пример #16
0
 public void CreateHashBytes()
 {
     byte[] hash = Cryptographer.CreateHash(hashInstance, plainTextBytes, context);
     Assert.IsFalse(CryptographyUtility.CompareBytes(plainTextBytes, hash));
 }
        public void CompareHashWithNullInstanceStringThrows()
        {
            string hash = Cryptographer.CreateHash(hashInstance, plainTextString);

            Cryptographer.CompareHash(null, plainTextString, hash);
        }
Пример #18
0
        public void CreateHashString()
        {
            string hashString = Cryptographer.CreateHash(hashInstance, plainTextString, context);

            Assert.IsFalse(plainTextString == hashString);
        }
 public void CreateHashWithInvalidInstanceThrows()
 {
     Cryptographer.CreateHash("invalid instance", plainTextString);
 }
Пример #20
0
 /// <summary>
 /// Cria o hash SHA1Managed.
 /// </summary>
 /// <param name="plaintext"></param>
 /// <returns></returns>
 public static string CreateHash(string plaintext)
 {
     return(Cryptographer.CreateHash("SHA1Managed", plaintext.ToLower()));
 }