예제 #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()));
 }