In 20 words or less, should you hash then encrypt or encrypt then has a message…
- User
In 20 words or less, should you hash then encrypt or encrypt then has a message authentication code and why?
Assistant
Hash then encrypt.
Hashing first ensures the integrity of the data before encryption, so you know the encrypted data has not been modified. Encrypting an already hashed message would not provide confidentiality to the hash.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.