Ejemplo n.º 1
0
        public void EncryptDecrypt_String_ResultIsEqual(string text)
        {
            string cipherText    = _cryptoTest.Encrypt(text, _standardPassword);
            string decryptedText = _cryptoTest.Decrypt(cipherText, _standardPassword);

            Assert.AreEqual(text, decryptedText);
        }
Ejemplo n.º 2
0
 public Bitmap EncodeMessageInImage(Bitmap coverImage, string message, string encryptionKey, string stegoSeed,
                                    bool encrypt = true, bool compress = true)
 {
     try
     {
         if (encrypt)
         {
             message = _cryptoMethod.Encrypt(message, encryptionKey);
         }
         byte[] byteMessage = Encoding.UTF8.GetBytes(message);
         if (compress)
         {
             byteMessage = _compressMethod.Compress(byteMessage);
         }
         Bitmap stegoObject = _stegoMethod.Encode(coverImage, stegoSeed, byteMessage);
         return(stegoObject);
     }
     catch (NotifyUserException)
     {
         throw;
     }
     catch (AbortActionException)
     {
         throw;
     }
 }