/// <summary> /// Returns the model for decoding from the web.config /// </summary> /// <returns></returns> internal static EncryptorModel GetEncryptorModel() { var pass = ConfigurationManager.AppSettings["CaptchaPass"]; var salt = ConfigurationManager.AppSettings["CaptchaSalt"]; if ((string.IsNullOrEmpty(pass) || string.IsNullOrEmpty(salt))) { throw new ConfigurationErrorsException("In the web.config file, there are no options for Captcha."); } try { var encryptorModel = new EncryptorModel() { Password = pass, Salt = Convert.FromBase64String(salt) }; return(encryptorModel); } catch (Exception) { throw; } }
public EncryptorViewModel() { Model = new EncryptorModel(); }