Issue with decrypting self-coded AES
But the &quot;PBKDF2 generated key&quot; seems to be 64 byte long

Sounds like the algorithm is actually PBKDF2-SHA512 or some other 512-bit has function, as PBKDF2 does NOT use AES as its PRF. Generally this is truncated down to 256 bits to use with your block cipher. I would check what you are using as the PRF, try replicating the master key by choosing different 512-bit hash functions until you get a match, then work onto decryption after.