Jump to content
Wikipedia The Free Encyclopedia

MASH-1

From Wikipedia, the free encyclopedia
Cryptographic hash function
This article is about Modular Arithmetic Secure Hash. For MASH-1 gene, see ASCL1.
This article has multiple issues. Please help improve it or discuss these issues on the talk page . (Learn how and when to remove these messages)
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: "MASH-1" – news · newspapers · books · scholar · JSTOR
(April 2011) (Learn how and when to remove this message)
This article includes a list of general references, but it lacks sufficient corresponding inline citations . Please help to improve this article by introducing more precise citations. (April 2011) (Learn how and when to remove this message)
(Learn how and when to remove this message)

For a cryptographic hash function (a mathematical algorithm), a MASH-1 (Modular Arithmetic Secure Hash) is a hash function based on modular arithmetic.

History

[edit ]

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

[edit ]

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

Description

[edit ]

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

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

The message is padded by appending the message length and is separated into blocks D 1 , , D q {\displaystyle D_{1},\cdots ,D_{q}} {\displaystyle D_{1},\cdots ,D_{q}} of length L / 2 {\displaystyle L/2} {\displaystyle L/2}. From each of these blocks D i {\displaystyle D_{i}} {\displaystyle D_{i}}, an enlarged block B i {\displaystyle B_{i}} {\displaystyle B_{i}} of length L {\displaystyle L} {\displaystyle L} is created by placing four bits from D i {\displaystyle D_{i}} {\displaystyle D_{i}} 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:

H 0 = I V {\displaystyle H_{0}=IV} {\displaystyle H_{0}=IV}
H i = f ( B i , H i 1 ) = ( ( ( ( B i H i 1 ) E ) e mod N ) mod 2 L ) H i 1 ; i = 1 , , q {\displaystyle H_{i}=f(B_{i},H_{i-1})=((((B_{i}\oplus H_{i-1})\vee E)^{e}{\bmod {N}}){\bmod {2}}^{L})\oplus H_{i-1};\quad i=1,\cdots ,q} {\displaystyle H_{i}=f(B_{i},H_{i-1})=((((B_{i}\oplus H_{i-1})\vee E)^{e}{\bmod {N}}){\bmod {2}}^{L})\oplus H_{i-1};\quad i=1,\cdots ,q}

Where E = 15 2 L 4 {\displaystyle E=15\cdot 2^{L-4}} {\displaystyle E=15\cdot 2^{L-4}} and e = 2 {\displaystyle e=2} {\displaystyle e=2}. {\displaystyle \vee } {\displaystyle \vee } denotes the bitwise OR and {\displaystyle \oplus } {\displaystyle \oplus } the bitwise XOR.

From H q {\displaystyle H_{q}} {\displaystyle H_{q}} are now calculated more data blocks D q + 1 , , D q + 8 {\displaystyle D_{q+1},\cdots ,D_{q+8}} {\displaystyle D_{q+1},\cdots ,D_{q+8}} by linear operations (where {\displaystyle \|} {\displaystyle \|} denotes concatenation):

H q = Y 1 Y 3 Y 0 Y 2 ; | Y i | = L / 4 {\displaystyle H_{q}=Y_{1},円\|,円Y_{3},円\|,円Y_{0},円\|,円Y_{2};\quad |Y_{i}|=L/4} {\displaystyle H_{q}=Y_{1},円\|,円Y_{3},円\|,円Y_{0},円\|,円Y_{2};\quad |Y_{i}|=L/4}
Y i = Y i 1 Y i 4 ; i = 4 , , 15 {\displaystyle Y_{i}=Y_{i-1}\oplus Y_{i-4};\quad i=4,\cdots ,15} {\displaystyle Y_{i}=Y_{i-1}\oplus Y_{i-4};\quad i=4,\cdots ,15}
D q + i = Y 2 i 2 Y 2 i 1 ; i = 1 , , 8 {\displaystyle D_{q+i}=Y_{2i-2},円\|,円Y_{2i-1};\quad i=1,\cdots ,8} {\displaystyle D_{q+i}=Y_{2i-2},円\|,円Y_{2i-1};\quad i=1,\cdots ,8}

These data blocks are now enlarged to B q + 1 , , B q + 8 {\displaystyle B_{q+1},\cdots ,B_{q+8}} {\displaystyle B_{q+1},\cdots ,B_{q+8}} like above, and with these the compression process continues with eight more steps:

H i = f ( B i , H i 1 ) ; i = q + 1 , , q + 8 {\displaystyle H_{i}=f(B_{i},H_{i-1});\quad i=q+1,\cdots ,q+8} {\displaystyle H_{i}=f(B_{i},H_{i-1});\quad i=q+1,\cdots ,q+8}

Finally the hash value is H q + 8 mod p {\displaystyle H_{q+8}{\bmod {p}}} {\displaystyle H_{q+8}{\bmod {p}}}, where p {\displaystyle p} {\displaystyle p} is a prime number with 7 2 L / 2 3 < p < 2 L / 2 {\displaystyle 7\cdot 2^{L/2-3}<p<2^{L/2}} {\displaystyle 7\cdot 2^{L/2-3}<p<2^{L/2}}.[1]

MASH-2

[edit ]

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

References

[edit ]
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
General
Mathematics

AltStyle によって変換されたページ (->オリジナル) /