Esempio n. 1
0
 /// <summary>
 /// 解密方法
 /// </summary>
 /// <param name="Source">待解密的串</param>
 /// <returns>经过解密的串</returns>
 public string DecryptoByte(string Source)
 {
     try
     {
         if (EncryptString.DiscryptSilmoonBinary(Source) == "")
         {
             return("");
         }
         byte[]       bytIn = Convert.FromBase64String(EncryptString.DiscryptSilmoonBinary(Source));
         MemoryStream ms    = new MemoryStream(bytIn, 0, bytIn.Length);
         mobjCryptoService.Key = GetLegalKey();
         mobjCryptoService.IV  = GetLegalIV();
         ICryptoTransform encrypto = mobjCryptoService.CreateDecryptor();
         CryptoStream     cs       = new CryptoStream(ms, encrypto, CryptoStreamMode.Read);
         StreamReader     sr       = new StreamReader(cs);
         return(sr.ReadToEnd());
     }
     catch { return(""); }
 }