コード例 #1
0
        static string GetConfigurationValue(string key, bool cryptMe)
        {
            // Read values from configuration
            string setting = ConfigurationManager.AppSettings[key];

            if (setting == "")
            {
                return("Error");
            }
            else
            {
                if (crypt == true & cryptMe == true)
                {
                    return(BlockEncrypter.DecryptStringBlock(setting, Encoding.ASCII.GetBytes("Pa55w0rd")));
                }
                else
                {
                    return(setting);
                }
            }
        }
コード例 #2
0
ファイル: Cryptography.cs プロジェクト: rheldt/AssetCoda
 /// <summary>
 /// Decrypt a ciphertext string using the BlockEncrypter library.
 /// </summary>
 /// <param name="ciphertext"></param>
 /// <returns></returns>
 public static string Decrypt(string ciphertext)
 {
     return(BlockEncrypter.DecryptStringBlock(ciphertext, Encoding.ASCII.GetBytes(ApplicationSettings.EncryptionKey)));
 }