public void EncryptDecrypt_String_ResultIsEqual(string text) { string cipherText = _cryptoTest.Encrypt(text, _standardPassword); string decryptedText = _cryptoTest.Decrypt(cipherText, _standardPassword); Assert.AreEqual(text, decryptedText); }
public string DecodeMessageFromImage(Bitmap coverImage, string decryptionKey, string stegoSeed, bool decrypt = true, bool decompress = true) { try { byte[] byteMessage = _stegoMethod.Decode(coverImage, stegoSeed); if (decompress) { byteMessage = _compressMethod.Decompress(byteMessage); } string message = Encoding.UTF8.GetString(byteMessage); if (decrypt) { message = _cryptoMethod.Decrypt(message, decryptionKey); } return(message); } catch (NotifyUserException) { throw; } catch (AbortActionException) { throw; } }