private EmailCredentials UpdateSenderInformation() { Console.Write("Sender email address: "); var senderAddress = Console.ReadLine(); Console.WriteLine(""); Console.Write("Sender email password: "******"Sender.Address", senderAddress); ProjectConfigurationManager.AddOrReplace("Sender.Password", senderPassword); return(new EmailCredentials() { Username = senderAddress, Password = senderPassword }); }
private string UpdateReceivers() { Console.WriteLine("Please enter receiver address or addresses."); Console.WriteLine("You can separate the addresses with ',' e.g. [email protected],[email protected]"); var receivers = Console.ReadLine(); Console.Clear(); ProjectConfigurationManager.AddOrReplace("Receivers", receivers); return(receivers); }
public CryptographyService() { if (string.IsNullOrEmpty(SaltKey) || string.IsNullOrEmpty(VIKey)) { symmetricKey.GenerateIV(); VIKey = Convert.ToBase64String(symmetricKey.IV); ProjectConfigurationManager.AddOrReplace("scr.VIKey", VIKey); symmetricKey.GenerateKey(); SaltKey = Convert.ToBase64String(symmetricKey.Key); ProjectConfigurationManager.AddOrReplace("scr.SaltKey", SaltKey); } if (string.IsNullOrEmpty(PasswordHash)) { Console.WriteLine("Now, please enter a password."); Console.WriteLine("This password will be used for encrypt your information."); PasswordHash = Console.ReadLine(); ProjectConfigurationManager.AddOrReplace("scr.PasswordHash", PasswordHash); } }