so I have a backup from client 0.4 of my wallet. I tried to decrypt my wallet but end up having the following error
EXCEPTION: 9key_error
CKey::SetSecret() : secret must be 32 bytes
You are entering the wrong password. There was (now fixed in GIT but not in any released version) a somewhat tricky bug where a small fraction of incorrect passwords caused a crash rather than the wrong password notice.
The log message of "secret must be 32 bytes" is a very strong and clear indication of this.
Unfortunately this behavior seems to convince the afflicted user that they actually have the right password, making it unlikely that they'll keep trying and get the right not.
Here is the related pull request: https://github.com/bitcoin/bitcoin/pull/1039