Beispiel #1
0
 public virtual string Decrypt(string base64Text)
 {
     if (!this._encryptionOptions.Encrypt)
     {
         return(base64Text);
     }
     return(CryptographyUtils.Decrypt(this._algorithm, base64Text, this._encryptionOptions.InternalKey));
 }
Beispiel #2
0
 public virtual string Encrypt(string plaintext)
 {
     if (!this._encryptionOptions.Encrypt)
     {
         return(plaintext);
     }
     return(CryptographyUtils.Encrypt(this._algorithm, plaintext, this._encryptionOptions.InternalKey));
 }
Beispiel #3
0
 public string Encrypt(string plaintext)
 {
     if (!this._encryptionOptions.Encrypt)
     {
         return(plaintext);
     }
     return(CryptographyUtils.Encrypt(this._algorithm, plaintext));
 }
Beispiel #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);
        }
Beispiel #5
0
 public CryptoSym(string key)
 {
     this._encryptionOptions = new CryptoConfig(true, key);
     this._algorithm         = CryptographyUtils.CreateSymmAlgoTripleDes();
 }
Beispiel #6
0
 public CryptoHash()
 {
     this._encryptionOptions = new CryptoConfig();
     this._algorithm         = CryptographyUtils.CreateHashAlgoMd5();
 }