title: Encryption is not the same using the same method to encrypt the same plaintext
body: <p>Use the same method below to encrypt the same plaintext twice,but the ciphertext are not the same after encryption.Why?</p>
  
  <p>I want to encrypt my password when saving user information to database,and use the encryption method below.But I want to complete the edit-user feature,after inputing the old password and new password,find out the user according to the selected userid, and encrypt the old password,try to validate the old password typed is matched the password stored in database.But they never matched even though I input the right password.So is there any way to encrypt the password and validate if they are the same after using the same method to encrypt the password.</p>
  
  <pre><code>    //encrypt the plainText
      public static string Encrypt(string plainText)
      {
          if (plainText == null || plainText == "")
              throw new ArgumentNullException("plainText");
          var temp = Encoding.UTF8.GetBytes(plainText);
  
          byte[] encrypted = ProtectedData.Protect(temp, null, DataProtectionScope.CurrentUser);
          return Convert.ToBase64String(encrypted);
      }
  </code></pre>