title: Check password before decryption
body: <p>I want to decrypt a string, which is working with the right password. I tried to check the password with <code>if(decrypt(Password, encryptedKey).contains(Key)){</code> But if the PW is wrong I get the following exception:</p>
  
  <pre><code>javax.crypto.BadPaddingException: pad block corrupted
  </code></pre>
  
  <p>So is there another way to check the password?</p>
  
  <pre><code>    public static String decrypt(String seed, String encrypted) throws Exception {
      byte[] rawKey = getRawKey(seed.getBytes());
      byte[] enc = toByte(encrypted);
  
      SecretKeySpec Spec = new SecretKeySpec(rawKey, "AES");
      Cipher cipher = Cipher.getInstance("AES");
      cipher.init(Cipher.DECRYPT_MODE, Spec);
  
  
      byte[] result = cipher.doFinal(enc);
  
      return new String(result);
  }
  </code></pre>