Esempio n. 1
0
        /// <summary>
        ///     Formats the encrypted text for embedding.
        /// </summary>
        /// @Precondition none
        /// @Postcondition none
        /// <param name="password">The password.</param>
        /// <param name="text">The text.</param>
        /// <returns>The formatted encrypted text</returns>
        public static string FormatEncryptedTextForEmbedding(string password, string text)
        {
            text = EmbeddingStringFormatter.FormatForEmbedding(text);

            return(password + TextMessageConstants.EndOfEncryptionKeyIndication +
                   TextCryptography.Encrypt(password, text) + TextMessageConstants.EndOfTextFileIndication);
        }
Esempio n. 2
0
        private void handleReachedEndOfMessage(StringBuilder encryptionPassword)
        {
            if (EncryptionUsed)
            {
                DecryptedText = TextCryptography.Decrypt(encryptionPassword.ToString(),
                                                         this.embeddedMessage.ToString());
            }

            ExtractedText = this.embeddedMessage.ToString();
        }