示例#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()));
 }