ArticleslgStudy

mathematics

MDC-2

MDC-2 is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand MDC-2 rather than just read about it. In short: In cryptography, MDC-2 (Modification Detection Code 2, sometimes called Meyer–Schilling, standardized in ISO 10118-2) is a cryptographic hash function. MDC-2 is a hash function based on a block cipher with a proof of security in the ideal-cipher model.

Key takeaways

  • MDC-2 belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect MDC-2 to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of MDC-2 from memory before moving on to harder problems.

Reference excerpt

In cryptography, MDC-2 (Modification Detection Code 2, sometimes called Meyer–Schilling, standardized in ISO 10118-2) is a cryptographic hash function. MDC-2 is a hash function based on a block cipher with a proof of security in the ideal-cipher model. The length of the output hash depends on the underlying block cipher used.

Algorithm Let E(p,k) be a block cipher encryption function with inputs p (plaintext) and k (key), each of length n, calculating a ciphertext of length also n. For a given message M to hash, the MDC-2 algorithm proceeds as follows. Let A1,B1 be two different constants of size n. Let M||pad=M1||..||Mm where each Mi has size n, then the hash Vm||Wm of the message is given by:

for i=1 to m: Vi=Mi⊕E(Mi,Ai) Wi=Mi⊕E(Mi,Bi) ViL||ViR=Vi WiL||WiR=Wi Ai+1=ViL||WiR Bi+1=WiL||ViR return Am+1||Bm+1. Here the Vi,Wi are split in halves ViL etc., which have the length n/2.

MDC-2DES hashes When MDC-2 uses the DES block cipher, the 128-bit (16-byte) MDC-2 hashes are typically represented as 32-digit hexadecimal numbers. A1 is chosen as the 8-byte string 5252525252525252 and B1 is chosen as the 8-byte string 2525252525252525 (written as hexdigits). Additionally, before each iteration the first byte A[0] of A recalculated as (A[0] & 0x9f) ^ 0x40 and the first byte B[0] of B is recalculated as (B[0] & 0x9f) ^ 0x20. The following demonstrates a 43-byte ASCII input (which is padded with five zero-bytes so its length is a multiple of the DES block size of 8 bytes) and the corresponding MDC-2 hash:

MDC2("The quick brown fox jumps over the lazy dog") = 000ed54e093d61679aefbeae05bfe33a

Even a small change in the message will (with probability) result in a completely different hash, e.g. changing d to c:

MDC2("The quick brown fox jumps over the lazy cog") = 775f59f8e51aec29c57ac6ab850d58e8

The hash of the zero-length string is:

MDC2("") = 52525252525252522525252525252525

Patent issues MDC-2 was covered by U.S. patent 4,908,861, issued on March 13, 1990 but filed by IBM on August 28, 1987. Because of patent concerns support for MDC-2 has been disabled in OpenSSL on most Linux distributions and is not implemented by many other cryptographic libraries. It is implemented in GPG's libgcrypt. The patent was due to expire on August 28, 2007, twenty years after the filing date. It actually expired in 2002 because IBM did not pay the renewal fee. The Canadian patent was not renewed and no European patent was granted so MDC-2 can now be freely used.

See also One-way compression function

Notes

Worked examples

Example 1 — a first encounter with MDC-2

Start with the simplest possible case. Write down what MDC-2 claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to MDC-2 before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about MDC-2 ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of MDC-2

In research
MDC-2 appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses MDC-2 in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
MDC-2 is common in secondary-school and first-year university syllabi. It links to neighbouring topics Cryptographic hash functions, so understanding it makes those chapters shorter.
In everyday life
Look for MDC-2 outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “MDC-2” →

How to study MDC-2 in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what MDC-2 means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain MDC-2 out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is MDC-2 in simple terms?

In cryptography, MDC-2 (Modification Detection Code 2, sometimes called Meyer–Schilling, standardized in ISO 10118-2) is a cryptographic hash function. MDC-2 is a hash function based on a block cipher with a proof of security in the ideal-cipher model.

Why does MDC-2 matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study MDC-2?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on MDC-2.

Tags

  • Cryptographic hash functions

Keep exploring