コード例 #1
0
ファイル: CipherTool.cs プロジェクト: HTestOrg/TestRepo
        public static string DecryptString(string Input, bool EncodeURL = true)
        {
            if (Input != null)
            {
                string Key    = string.Empty;
                string Result = string.Empty;
                //string DecodedInput = string.Empty;
                CipherTool objAESCryptography = new CipherTool();

                //if (EncodeURL)
                //    DecodedInput = HttpContext.Current.Server.UrlDecode(Input);
                //else
                //    DecodedInput = Input;

                try
                {
                    Result = objAESCryptography.DecryptData(cipherText: Input, encodedURL: EncodeURL);
                }
                catch (Exception ex)
                {
                    Result = objAESCryptography.DecryptData(cipherText: Input, encodedURL: EncodeURL);
                    throw ex;
                }

                return(Result);
            }
            else
            {
                return(null);
            }
        }
コード例 #2
0
ファイル: CipherTool.cs プロジェクト: HTestOrg/TestRepo
        public static string EncryptString(string Input, bool EncodeURL = true)
        {
            if (Input != null)
            {
                string     Key                = string.Empty;
                string     Result             = string.Empty;
                CipherTool objAESCryptography = new CipherTool();

                Result = objAESCryptography.EncryptData(plainText: Input, encodeURL: EncodeURL);

                //if (EncodeURL)
                //    Result = HttpContext.Current.Server.UrlEncode(Result);

                return(Result);
            }
            else
            {
                return(null);
            }
        }