When I try to decrypt a cipher text using the wrong key, CCCrypt returns kCCDecodeError.
Question is, does it do so reliably (eg. am I guaranteed that if it returns success, my input key was the key used to encrypt the plain text, and am I also guaranteed that my output data is my original plain text) and how can it even know whether my key is correct or not?
As far as I understood crypto, the engine cannot predict whether the key is valid and should just give me random noise as output data and a successful return code.