How to check integrity of a encypted string then converted to Base64?
<p>I encrypt and decrypt a string with a private key and following functions.
so I encrypt a string with Encrypt function and decrypt the encrypted string with decrypt function.
If someone can change the encrypted string and then it decrypts with decrypt function, the decrypted string isn't equal to plain text before encrypting.
I want to know how can I check is decrypted string equals to plain text before encrypting?</p>

<pre><code> public string Encrypt(string plainText, string password)
    {
        GenerateKey(password);
        return Encrypt(plainText);
    }
    public string Encrypt(string plainText)
    {
        if (Key == null)
        {
            throw new InvalidOperationException("Password must be provided or set.");
        }
        byte[] data = new UnicodeEncoding().GetBytes(plainText);
        RijndaelManaged crypto = new RijndaelManaged();
        ICryptoTransform encryptor = crypto.CreateEncryptor(Key, Vector);
        MemoryStream memoryStream = new MemoryStream();
        CryptoStream crptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write);
        crptoStream.Write(data, 0, data.Length);
        crptoStream.FlushFinalBlock();
        crptoStream.Close();
        memoryStream.Close();
        return Convert.ToBase64String(memoryStream.ToArray());
    }
    public string Decrypt(string encryptedText, string password)
    {
        GenerateKey(password);
        return Decrypt(encryptedText);
    }
    public string Decrypt(string encryptedText)
    {

        if (Key == null)
        {

            throw new InvalidOperationException("Password must be provided or set.");
        }
        byte[] cipher = Convert.FromBase64String(encryptedText);
        RijndaelManaged crypto = new RijndaelManaged();
        ICryptoTransform encryptor = crypto.CreateDecryptor(Key, Vector);
        MemoryStream memoryStream = new MemoryStream(cipher);
        CryptoStream crptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Read);
        byte[] data = new byte[cipher.Length];
        int dataLength = crptoStream.Read(data, 0, data.Length);
        memoryStream.Close();
        crptoStream.Close();
        return (new UnicodeEncoding()).GetString(data, 0, dataLength);
    }
</code></pre>
