public void DecryptBlockDecryptsBlockBackToOriginalPlainText() { const string originalMessage = "This is my message to encrypt."; string encrypted = BlockEncrypter.EncryptBlock(originalMessage, Encoding.ASCII.GetBytes("Pa55w0rd")); string decrypted = BlockEncrypter.DecryptBlock(encrypted, Encoding.ASCII.GetBytes("Pa55w0rd")); Assert.AreEqual(originalMessage, decrypted); }
private void EncryptText() { SetPasswordAndStatusBar(false); try { encryptedText.Text = BlockEncrypter.EncryptBlock(textToEncrypt.Text, _passwordEntry.Password.CombinedPasswords); } catch (Exception) { encryptedText.Text = ""; MessageBox.Show(Resources.TextShredderMainForm_EncryptText_There_was_an_error_encrypting_the_message_, Resources.TextShredderMainForm_EncryptText_Encryption_Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
public void EncryptBlockThrowsArgumentNullExceptionIfPasswordIsNull() { BlockEncrypter.EncryptBlock("blah blah blah blah blah blah", null); }
public void EncryptBlockEncryptsTextWithAPasswordAndResultIsNotNull() { string encrypted = BlockEncrypter.EncryptBlock("This is my message to encrypt.", Encoding.ASCII.GetBytes("Pa55w0rd")); Assert.IsNotNull(encrypted); }
public void EncryptBlockThrowsArgumentNullExceptionIfTextToEncryptIsNull() { BlockEncrypter.EncryptBlock(null, null); }