Decrypt[]
will yield an error if one tries to decrypt a byte array using a different symmetric key than the one used to encrypt:
Decrypt[key2, Encrypt[key1, "foobar"]["Data"]]
> [..] Decrypt: Data could not be decrypted
> $Failed
I want to be able to mathematically perform the decrypt operation on a byte array and get a byte array even if the key doesn't match, for example, in 3DES. How can I force Decrypt
to not yield a message and return the "decrypted" bytes? How does it even know that the decryption is correct or not with no knowledge of the plaintext bytes?