static void DecryptFile(string path) { var pwd = PromptPassword("Password:"); var crypto = new PasswordEncryptionProvider(pwd); crypto.DecryptFileAsync(path, CancellationToken.None).GetAwaiter().GetResult(); }
static void EncryptFile(string path) { var pwd = PromptPassword("Password:"******"Confirm Password:"******"passwords do not match"); throw new InvalidPasswordException(); } var crypto = new PasswordEncryptionProvider(pwd); crypto.EncryptFileAsync(path, CancellationToken.None).GetAwaiter().GetResult(); }