Score:6

Does symmetric key cryptography usually include hash function?

in flag

This may be a very basic question.

I know that symmetric key algorithms use the same key to encrypt and decrypt plaintext and ciphertext.

However, it seems that hash functions are often classified as symmetric key cryptography.

Even though the key is not used in the hash function, from what point of view can it be classified as symmetric key cryptography?

Marc Ilunga avatar
tr flag
If the question is not restricted to collision resistant hashing, then there are primitives like universal hashes that are often used as keyed primitives (e.g.: building a message authentication code scheme from a polynomial hash).
Score:13
ng flag

From what point of view can hash functions be classified as symmetric key cryptography?

  1. Hash functions do not use public/private key pairs, thus are not asymmetric cryptography (though they are historically motivated by asymmetric cryptography). So they belong either to symmetric cryptography, or to another kind.
  2. Many hash functions, including some of the first ones, are built on top of a (specialized) block cipher, turned into a one-way compression function by some fixed construction (e.g. Davies–Meyer), then used to form a hash per some iterated construction (e.g. Merkle–Damgård). Block ciphers are part of symmetric cryptography.
  3. The above combination Davies–Meyer + Merkle–Damgård is the basis of e.g. MD5, SHA-1, SHA-256. In this, the plaintext acts as the key of the block cipher. A first-preimage attack against the hash is akin to trying to find a key that matches the hash/ciphertext, and the known Merkle–Damgård IV/plaintext. That analogy works even better if we fix the length of the ciphertext such that there's a single round. So this attack is close to a key recovery attack in a known message setup, which is a classic of symmetric cryptography.
  4. More generally, the attacks on common hash functions, especially those built from a block cipher, use techniques (e.g. differential cryptanalysis) similar to those on ciphers of symmetric cryptography.
Sam Jaques avatar
us flag
You can also turn any hash function into a symmetric key encryption with a Feistel network, right? So there's a fairly tight equivalence also.
Score:3
ml flag

I don't think hash functions alone are considered symmetric cryptography, but you can use hash function in HMAC construction (keyed hash) and in that case, you use same key for computing HMAC tag and for verifing them. But hashes are used to provide integrity where as MACs are for authenticity (related but distinct), so it functions as symmetric cryptography in a way.

Sammitch avatar
us flag
So, hypothetically, give a key, a plaintext, and a cipher what is the correct application of a hash and an HMAC? HMAC of the plaintext, hash of the ciphertext?
Score:-3
us flag

During the SHA-3 competition the so-called Sponge Mode was invented which permits to construct hash functions with an arbitrary length input and output. Also, the Sponge designers have proven that a Sponge instantiated with a random permutation is indistinguishable from a random oracle up to a certain number of calls, see this paper.

Nowadays, sponge mode has become the preferred way to construct new hash functions. Unfortunately, it is impossible to construct a true random permutation. As remedy, one usually constructs a cryptographically secure symmetric keyed permutation and instantiates it in sponge mode.

cn flag
How does this answer the question?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.