How can I be certain the same key that was used for encryption? I have an encrypted payload. I use a key and the decryption algorithm to decipher it.
I understand data will be returned whether the key is correct (i.e. it was used for encryption) or not. Is this true of all or any algorithms?
At this point, how can the returned data be verified to be the original plaintext? The padding might already give some idea if present. I imagine some sort of hash (present in the encrypted payload) could also verify this. Are there standard or more creative methods to achieve this?