Message authentication codes (MACs) and cryptographic hashes can be used to authenticate messages. MACs use a secret key and cryptographic hash function to produce an authenticator value for a message. Cryptographic hashes map messages of arbitrary length to fixed-length hash values. Both MACs and hashes allow a recipient to verify that a message was not altered by reproducing the authenticator value, but hashes do not provide a digital signature as they do not involve a secret key. MACs and hashes are useful for authenticating messages without encryption when confidentiality is not required.