Misplaced Pages

MDC-2

Article snapshot taken from[REDACTED] with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Cryptographic hash function
This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "MDC-2" – news · newspapers · books · scholar · JSTOR (February 2019) (Learn how and when to remove this message)

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

For a given message M {\displaystyle M} to hash and a given block cipher encryption function E {\displaystyle E} , the MDC-2 algorithm proceeds as follows. Let n {\displaystyle n} be the block length, A 1 , B 1 {\displaystyle A_{1},B_{1}} two different constants of size n {\displaystyle n} . If M = M 1 | | . . | | M m {\displaystyle M=M_{1}||..||M_{m}} where each M i {\displaystyle M_{i}} has size n {\displaystyle n} , then the hash V m | | W m {\displaystyle V_{m}||W_{m}} of the message is given by:

  • for i = 1 {\displaystyle i=1} to m {\displaystyle m} :
    • V i = M i E ( M i , A i ) {\displaystyle V_{i}=M_{i}\oplus E(M_{i},A_{i})}
    • W i = M i E ( M i , B i ) {\displaystyle W_{i}=M_{i}\oplus E(M_{i},B_{i})}
    • V i L | | V i R = V i {\displaystyle V_{i}^{L}||V_{i}^{R}=V_{i}}
    • W i L | | W i R = W i {\displaystyle W_{i}^{L}||W_{i}^{R}=W_{i}}
    • A i + 1 = V i L | | W i R {\displaystyle A_{i+1}=V_{i}^{L}||W_{i}^{R}}
    • B i + 1 = W i L | | V i R {\displaystyle B_{i+1}=W_{i}^{L}||V_{i}^{R}}
  • return A m + 1 | | B m + 1 {\displaystyle A_{m+1}||B_{m+1}}

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. A 1 {\displaystyle A_{1}} is chosen as the 8-byte string 5252525252525252 and B 1 {\displaystyle B_{1}} is chosen as the 8-byte string 2525252525252525 (written as hexdigits). Additionally, before each iteration the first byte A of A {\displaystyle A} recalculated as (A & 0x9f) ^ 0x40 and the first byte B of B {\displaystyle B} is recalculated as (B & 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

Notes

  1. Steinberger, John (June 23, 2007). "The Collision Intractability of MDC-2 in the Ideal-Cipher Model". Advances in Cryptology – EUROCRYPT 2007. Springer-Verlag. pp. 34–51. doi:10.1007/978-3-540-72540-4_3. Retrieved January 31, 2008.
  2. Cite error: The named reference undefined was invoked but never defined (see the help page).
  3. "USPTO - Patent Maintenance Fees". United States Patent Office. March 13, 2002. Retrieved 2008-01-31. {{cite journal}}: Cite journal requires |journal= (help) (Click on "Bibliographic data".)
Cryptographic hash functions and message authentication codes
Common functions
SHA-3 finalists
Other functions
Password hashing/
key stretching functions
General purpose
key derivation functions
MAC functions
Authenticated
encryption
modes
Attacks
Design
Standardization
Utilization
Cryptography
General
Mathematics
Category:
MDC-2 Add topic