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

            return(hashed);
        }
Beispiel #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));
 }
Beispiel #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);
        }
Beispiel #7
0
 public string CreateHashOnMD5Cng(string plainValue)
 {
     return(Cryptographer.CreateHash("MD5CngCrypto", plainValue));
 }
Beispiel #8
0
 public void CreateHashWithZeroLengthInstanceStringThrows()
 {
     Cryptographer.CreateHash(string.Empty, plainTextString);
 }
Beispiel #9
0
 public void CompareHashWithNullInstanceThrows()
 {
     byte[] hash = Cryptographer.CreateHash(hashInstance, plainTextBytes);
     Cryptographer.CompareHash(null, plainTextBytes, hash);
 }
Beispiel #10
0
 public void CreateHashWithNullInstanceThrows()
 {
     Cryptographer.CreateHash(null, plainTextBytes);
 }
Beispiel #11
0
 public void CreateHashWithNullInstanceStringThrows()
 {
     Cryptographer.CreateHash(null, plainTextString);
 }
Beispiel #12
0
        public static string CreateHash(string texto)
        {
            string textoHash = Cryptographer.CreateHash(HashProviderName, texto);

            return(textoHash);
        }
Beispiel #13
0
 public string CreateHash(string value)
 {
     return(Cryptographer.CreateHash("HashProvider", value, this.ConfigurationContext));
 }
Beispiel #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);
 }
 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);
        }
        public void CreateHashString()
        {
            string hashString = Cryptographer.CreateHash(hashInstance, plainTextString, context);

            Assert.IsFalse(plainTextString == hashString);
        }
 public void CreateHashWithInvalidInstanceThrows()
 {
     Cryptographer.CreateHash("invalid instance", plainTextString);
 }
Beispiel #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()));
 }