MASH-1

From testwiki
Jump to navigation Jump to search

Template:Short description Template:About Template:Multiple issues For a cryptographic hash function (a mathematical algorithm), a MASH-1 (Modular Arithmetic Secure Hash) is a hash function based on modular arithmetic.

History

Despite many proposals, few hash functions based on modular arithmetic have withstood attack, and most that have tend to be relatively inefficient. MASH-1 evolved from a long line of related proposals successively broken and repaired.

Standard

Committee Draft ISO/IEC 10118-4 (Nov 95)

Description

MASH-1 involves use of an RSA-like modulus N, whose bitlength affects the security. N is a product of two prime numbers and should be difficult to factor, and for N of unknown factorization, the security is based in part on the difficulty of extracting modular roots.

Let L be the length of a message block in bit. N is chosen to have a binary representation a few bits longer than L, typically L<|N|L+16.

The message is padded by appending the message length and is separated into blocks D1,,Dq of length L/2. From each of these blocks Di, an enlarged block Bi of length L is created by placing four bits from Di in the lower half of each byte and four bits of value 1 in the higher half. These blocks are processed iteratively by a compression function:

H0=IV
Hi=f(Bi,Hi1)=((((BiHi1)E)emodN)mod2L)Hi1;i=1,,q

Where E=152L4 and e=2. denotes the bitwise OR and the bitwise XOR.

From Hq are now calculated more data blocks Dq+1,,Dq+8 by linear operations (where denotes concatenation):

Hq=Y1Y3Y0Y2;|Yi|=L/4
Yi=Yi1Yi4;i=4,,15
Dq+i=Y2i2Y2i1;i=1,,8

These data blocks are now enlarged to Bq+1,,Bq+8 like above, and with these the compression process continues with eight more steps:

Hi=f(Bi,Hi1);i=q+1,,q+8

Finally the hash value is Hq+8modp, where p is a prime number with 72L/23<p<2L/2.[1]

MASH-2

There is a newer version of the algorithm called MASH-2 with a different exponent. The original e=2 is replaced by e=28+1. This is the only difference between these versions.

References

Template:Reflist

Template:Cryptography navbox