Exemplo n.º 1
0
 public virtual string Decrypt(string base64Text)
 {
     if (!this._encryptionOptions.Encrypt)
     {
         return(base64Text);
     }
     return(CryptographyUtils.Decrypt(this._algorithm, base64Text, this._encryptionOptions.InternalKey));
 }
Exemplo n.º 2
0
 public virtual string Encrypt(string plaintext)
 {
     if (!this._encryptionOptions.Encrypt)
     {
         return(plaintext);
     }
     return(CryptographyUtils.Encrypt(this._algorithm, plaintext, this._encryptionOptions.InternalKey));
 }
Exemplo n.º 3
0
 public string Encrypt(string plaintext)
 {
     if (!this._encryptionOptions.Encrypt)
     {
         return(plaintext);
     }
     return(CryptographyUtils.Encrypt(this._algorithm, plaintext));
 }
Exemplo n.º 4
0
        public static bool IsHashMatch(HashAlgorithm hashAlgorithm, string hashedText, string unhashedText)
        {
            string strB = CryptographyUtils.Encrypt(hashAlgorithm, unhashedText);

            return(string.Compare(hashedText, strB, false) == 0);
        }
Exemplo n.º 5
0
 public CryptoSym(string key)
 {
     this._encryptionOptions = new CryptoConfig(true, key);
     this._algorithm         = CryptographyUtils.CreateSymmAlgoTripleDes();
 }
Exemplo n.º 6
0
 public CryptoHash()
 {
     this._encryptionOptions = new CryptoConfig();
     this._algorithm         = CryptographyUtils.CreateHashAlgoMd5();
 }