Does a hash function have a Upper bound on input length?Why does the padding in Merkle–Damgård hash functions like MD5 contain the message length?Is it theoretically possible to construct a string that contains its own hash value?Hash function in PBKDF2Does this guarantee a unique 32 bit Hash?How to choose the reduction function in rainbow tables?Combining secure hashes with insecure hashes?Advantages/disadvantages of using symmetric encryption function as hash function?Why does a Hashing Function produce good Random Numbers if Input is random?Hash length vs Data lengthWhat does “bits” mean in the context of hash functions?Security of a given hash functionHow many bits in the resultant hash will change, if the x bits are changed in its the original input?

Legendre Polynomial Integral over half space

How to get a type of "screech" on guitar

Draw parts of a split rectangle in a dashed/dotted style

Could a US citizen born through "birth tourism" become President?

Why isn't a binary file shown as 0s and 1s?

How can I help our ranger feel special about her beast companion?

Three Subway Escalators

Why did my "seldom" get corrected?

Why don't humans perceive sound waves as twice the frequency they are?

Is encryption still applied if you ignore the SSL certificate warning for self-signed certs?

The most secure way to handle someone forgetting to verify their account?

Will copper pour help on my single-layer PCB?

Align the contents of a numerical matrix when you have minus signs

What image should I install on VirtualBox for practising DevOps?

How important are the Author's mood and feelings for writing a story?

Is it possible to target 2 allies with the Warding Bond spell using the Sorcerer's Twinned Spell metamagic option?

Demographic consequences of closed loop reincarnation

Locked-up DOS computer beeped on keypress. What mechanism caused that?

I have found a mistake on someone's code published online: what is the protocol?

When will the last unambiguous evidence of mankind disappear?

Why do space operations use "nominal" to mean "working correctly"?

How to belay quickly ascending top-rope climbers?

Did Hitler say this quote about homeschooling?

How do you send money when you're not sure it's not a scam?



Does a hash function have a Upper bound on input length?


Why does the padding in Merkle–Damgård hash functions like MD5 contain the message length?Is it theoretically possible to construct a string that contains its own hash value?Hash function in PBKDF2Does this guarantee a unique 32 bit Hash?How to choose the reduction function in rainbow tables?Combining secure hashes with insecure hashes?Advantages/disadvantages of using symmetric encryption function as hash function?Why does a Hashing Function produce good Random Numbers if Input is random?Hash length vs Data lengthWhat does “bits” mean in the context of hash functions?Security of a given hash functionHow many bits in the resultant hash will change, if the x bits are changed in its the original input?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1












$begingroup$


I came across this Answer stating (just a line from the answer):-




The input space is "infinite" and thus it has an infinite amount of values that will collide into a single hash




And in the comments of this answer, there exists a comment of @poncho stating:-




Technically, the input space for the SHA-1 and SHA-2 hash functions is not "infinite"; SHA-1 and SHA-256 inputs are limited to $2^64−1$ bits; SHA-512 is limited to $2^128−1$ bits




In reply to the above comment, the answer'er does accept the above fact. But, I can't seem to understand why?



As there exists a large number of answers, like this who loosely use the term infinite with the input space of hash functions. I tried to resolve the ambiguity via Wikipedia page of MD5 and SHA1, this is the definition of both:-




In cryptography, SHA-1 is a cryptographic hash function which takes an input and produces a 160-bit hash



The MD5 message-digest algorithm is a widely used hash function producing a 128-bit hash value




In both the definition, there exists no mention of input size (in bits) of the algorithms.



QUESTION:-
Does hashing algorithms have an upper bound in the input space?



P.S.:- If the upper bound does exists, then can anyone tell me why isn't the hashing algorithm able to work on input size above the upper bound?










share|improve this question









$endgroup$











  • $begingroup$
    Not all hash functions but the universe have a limit on the data to store.
    $endgroup$
    – kelalaka
    6 hours ago

















1












$begingroup$


I came across this Answer stating (just a line from the answer):-




The input space is "infinite" and thus it has an infinite amount of values that will collide into a single hash




And in the comments of this answer, there exists a comment of @poncho stating:-




Technically, the input space for the SHA-1 and SHA-2 hash functions is not "infinite"; SHA-1 and SHA-256 inputs are limited to $2^64−1$ bits; SHA-512 is limited to $2^128−1$ bits




In reply to the above comment, the answer'er does accept the above fact. But, I can't seem to understand why?



As there exists a large number of answers, like this who loosely use the term infinite with the input space of hash functions. I tried to resolve the ambiguity via Wikipedia page of MD5 and SHA1, this is the definition of both:-




In cryptography, SHA-1 is a cryptographic hash function which takes an input and produces a 160-bit hash



The MD5 message-digest algorithm is a widely used hash function producing a 128-bit hash value




In both the definition, there exists no mention of input size (in bits) of the algorithms.



QUESTION:-
Does hashing algorithms have an upper bound in the input space?



P.S.:- If the upper bound does exists, then can anyone tell me why isn't the hashing algorithm able to work on input size above the upper bound?










share|improve this question









$endgroup$











  • $begingroup$
    Not all hash functions but the universe have a limit on the data to store.
    $endgroup$
    – kelalaka
    6 hours ago













1












1








1





$begingroup$


I came across this Answer stating (just a line from the answer):-




The input space is "infinite" and thus it has an infinite amount of values that will collide into a single hash




And in the comments of this answer, there exists a comment of @poncho stating:-




Technically, the input space for the SHA-1 and SHA-2 hash functions is not "infinite"; SHA-1 and SHA-256 inputs are limited to $2^64−1$ bits; SHA-512 is limited to $2^128−1$ bits




In reply to the above comment, the answer'er does accept the above fact. But, I can't seem to understand why?



As there exists a large number of answers, like this who loosely use the term infinite with the input space of hash functions. I tried to resolve the ambiguity via Wikipedia page of MD5 and SHA1, this is the definition of both:-




In cryptography, SHA-1 is a cryptographic hash function which takes an input and produces a 160-bit hash



The MD5 message-digest algorithm is a widely used hash function producing a 128-bit hash value




In both the definition, there exists no mention of input size (in bits) of the algorithms.



QUESTION:-
Does hashing algorithms have an upper bound in the input space?



P.S.:- If the upper bound does exists, then can anyone tell me why isn't the hashing algorithm able to work on input size above the upper bound?










share|improve this question









$endgroup$




I came across this Answer stating (just a line from the answer):-




The input space is "infinite" and thus it has an infinite amount of values that will collide into a single hash




And in the comments of this answer, there exists a comment of @poncho stating:-




Technically, the input space for the SHA-1 and SHA-2 hash functions is not "infinite"; SHA-1 and SHA-256 inputs are limited to $2^64−1$ bits; SHA-512 is limited to $2^128−1$ bits




In reply to the above comment, the answer'er does accept the above fact. But, I can't seem to understand why?



As there exists a large number of answers, like this who loosely use the term infinite with the input space of hash functions. I tried to resolve the ambiguity via Wikipedia page of MD5 and SHA1, this is the definition of both:-




In cryptography, SHA-1 is a cryptographic hash function which takes an input and produces a 160-bit hash



The MD5 message-digest algorithm is a widely used hash function producing a 128-bit hash value




In both the definition, there exists no mention of input size (in bits) of the algorithms.



QUESTION:-
Does hashing algorithms have an upper bound in the input space?



P.S.:- If the upper bound does exists, then can anyone tell me why isn't the hashing algorithm able to work on input size above the upper bound?







hash sha-1 md5






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 8 hours ago









Vasu Deo.SVasu Deo.S

2189 bronze badges




2189 bronze badges











  • $begingroup$
    Not all hash functions but the universe have a limit on the data to store.
    $endgroup$
    – kelalaka
    6 hours ago
















  • $begingroup$
    Not all hash functions but the universe have a limit on the data to store.
    $endgroup$
    – kelalaka
    6 hours ago















$begingroup$
Not all hash functions but the universe have a limit on the data to store.
$endgroup$
– kelalaka
6 hours ago




$begingroup$
Not all hash functions but the universe have a limit on the data to store.
$endgroup$
– kelalaka
6 hours ago










1 Answer
1






active

oldest

votes


















5












$begingroup$


Does hashing algorithms have an upper bound in the input space?




They can, but they don't have to and it depends on their specification.



  • All Merkle-Damgård based hash functions do have an upper limit, because appending the message length simplifies the security proof and the backdoor-resistance of the function and they usually use a fixed-length encoding of the length.

  • SHA-3 (Spec PDF) does not have such a limit as it's based on the sponge-construction.

  • Skein (Spec PDF) does have a limit of $2^96$ bytes.

  • Blake2 (Spec PDF) has a limit of $2^128$ bytes.





share|improve this answer









$endgroup$












  • $begingroup$
    Oh, Thanks (+1). I totally forgot the fact that during the process of computing message digest of a message (in MD5 and SHA1), it's original length in bits is appended to the padded bits. Therefore, if we use message length > that length, we won't be able to append the actual length of the original message (as it would either result in overflow or would get truncated using a modulo operation which would lead to incorrect length).
    $endgroup$
    – Vasu Deo.S
    7 hours ago











  • $begingroup$
    BTW could you please tell me why answers like this still refer to the input space be infinite in length?
    $endgroup$
    – Vasu Deo.S
    6 hours ago










  • $begingroup$
    @VasuDeo.S probably because for most purposes "infinite" is a good approximation of "messages shorter than 2^64 bit" (which is > 1 million terabyte).
    $endgroup$
    – SEJPM
    6 hours ago










  • $begingroup$
    Thanks for taking time to answer my question!!
    $endgroup$
    – Vasu Deo.S
    6 hours ago













Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "281"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcrypto.stackexchange.com%2fquestions%2f72069%2fdoes-a-hash-function-have-a-upper-bound-on-input-length%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









5












$begingroup$


Does hashing algorithms have an upper bound in the input space?




They can, but they don't have to and it depends on their specification.



  • All Merkle-Damgård based hash functions do have an upper limit, because appending the message length simplifies the security proof and the backdoor-resistance of the function and they usually use a fixed-length encoding of the length.

  • SHA-3 (Spec PDF) does not have such a limit as it's based on the sponge-construction.

  • Skein (Spec PDF) does have a limit of $2^96$ bytes.

  • Blake2 (Spec PDF) has a limit of $2^128$ bytes.





share|improve this answer









$endgroup$












  • $begingroup$
    Oh, Thanks (+1). I totally forgot the fact that during the process of computing message digest of a message (in MD5 and SHA1), it's original length in bits is appended to the padded bits. Therefore, if we use message length > that length, we won't be able to append the actual length of the original message (as it would either result in overflow or would get truncated using a modulo operation which would lead to incorrect length).
    $endgroup$
    – Vasu Deo.S
    7 hours ago











  • $begingroup$
    BTW could you please tell me why answers like this still refer to the input space be infinite in length?
    $endgroup$
    – Vasu Deo.S
    6 hours ago










  • $begingroup$
    @VasuDeo.S probably because for most purposes "infinite" is a good approximation of "messages shorter than 2^64 bit" (which is > 1 million terabyte).
    $endgroup$
    – SEJPM
    6 hours ago










  • $begingroup$
    Thanks for taking time to answer my question!!
    $endgroup$
    – Vasu Deo.S
    6 hours ago















5












$begingroup$


Does hashing algorithms have an upper bound in the input space?




They can, but they don't have to and it depends on their specification.



  • All Merkle-Damgård based hash functions do have an upper limit, because appending the message length simplifies the security proof and the backdoor-resistance of the function and they usually use a fixed-length encoding of the length.

  • SHA-3 (Spec PDF) does not have such a limit as it's based on the sponge-construction.

  • Skein (Spec PDF) does have a limit of $2^96$ bytes.

  • Blake2 (Spec PDF) has a limit of $2^128$ bytes.





share|improve this answer









$endgroup$












  • $begingroup$
    Oh, Thanks (+1). I totally forgot the fact that during the process of computing message digest of a message (in MD5 and SHA1), it's original length in bits is appended to the padded bits. Therefore, if we use message length > that length, we won't be able to append the actual length of the original message (as it would either result in overflow or would get truncated using a modulo operation which would lead to incorrect length).
    $endgroup$
    – Vasu Deo.S
    7 hours ago











  • $begingroup$
    BTW could you please tell me why answers like this still refer to the input space be infinite in length?
    $endgroup$
    – Vasu Deo.S
    6 hours ago










  • $begingroup$
    @VasuDeo.S probably because for most purposes "infinite" is a good approximation of "messages shorter than 2^64 bit" (which is > 1 million terabyte).
    $endgroup$
    – SEJPM
    6 hours ago










  • $begingroup$
    Thanks for taking time to answer my question!!
    $endgroup$
    – Vasu Deo.S
    6 hours ago













5












5








5





$begingroup$


Does hashing algorithms have an upper bound in the input space?




They can, but they don't have to and it depends on their specification.



  • All Merkle-Damgård based hash functions do have an upper limit, because appending the message length simplifies the security proof and the backdoor-resistance of the function and they usually use a fixed-length encoding of the length.

  • SHA-3 (Spec PDF) does not have such a limit as it's based on the sponge-construction.

  • Skein (Spec PDF) does have a limit of $2^96$ bytes.

  • Blake2 (Spec PDF) has a limit of $2^128$ bytes.





share|improve this answer









$endgroup$




Does hashing algorithms have an upper bound in the input space?




They can, but they don't have to and it depends on their specification.



  • All Merkle-Damgård based hash functions do have an upper limit, because appending the message length simplifies the security proof and the backdoor-resistance of the function and they usually use a fixed-length encoding of the length.

  • SHA-3 (Spec PDF) does not have such a limit as it's based on the sponge-construction.

  • Skein (Spec PDF) does have a limit of $2^96$ bytes.

  • Blake2 (Spec PDF) has a limit of $2^128$ bytes.






share|improve this answer












share|improve this answer



share|improve this answer










answered 7 hours ago









SEJPMSEJPM

30.5k6 gold badges62 silver badges146 bronze badges




30.5k6 gold badges62 silver badges146 bronze badges











  • $begingroup$
    Oh, Thanks (+1). I totally forgot the fact that during the process of computing message digest of a message (in MD5 and SHA1), it's original length in bits is appended to the padded bits. Therefore, if we use message length > that length, we won't be able to append the actual length of the original message (as it would either result in overflow or would get truncated using a modulo operation which would lead to incorrect length).
    $endgroup$
    – Vasu Deo.S
    7 hours ago











  • $begingroup$
    BTW could you please tell me why answers like this still refer to the input space be infinite in length?
    $endgroup$
    – Vasu Deo.S
    6 hours ago










  • $begingroup$
    @VasuDeo.S probably because for most purposes "infinite" is a good approximation of "messages shorter than 2^64 bit" (which is > 1 million terabyte).
    $endgroup$
    – SEJPM
    6 hours ago










  • $begingroup$
    Thanks for taking time to answer my question!!
    $endgroup$
    – Vasu Deo.S
    6 hours ago
















  • $begingroup$
    Oh, Thanks (+1). I totally forgot the fact that during the process of computing message digest of a message (in MD5 and SHA1), it's original length in bits is appended to the padded bits. Therefore, if we use message length > that length, we won't be able to append the actual length of the original message (as it would either result in overflow or would get truncated using a modulo operation which would lead to incorrect length).
    $endgroup$
    – Vasu Deo.S
    7 hours ago











  • $begingroup$
    BTW could you please tell me why answers like this still refer to the input space be infinite in length?
    $endgroup$
    – Vasu Deo.S
    6 hours ago










  • $begingroup$
    @VasuDeo.S probably because for most purposes "infinite" is a good approximation of "messages shorter than 2^64 bit" (which is > 1 million terabyte).
    $endgroup$
    – SEJPM
    6 hours ago










  • $begingroup$
    Thanks for taking time to answer my question!!
    $endgroup$
    – Vasu Deo.S
    6 hours ago















$begingroup$
Oh, Thanks (+1). I totally forgot the fact that during the process of computing message digest of a message (in MD5 and SHA1), it's original length in bits is appended to the padded bits. Therefore, if we use message length > that length, we won't be able to append the actual length of the original message (as it would either result in overflow or would get truncated using a modulo operation which would lead to incorrect length).
$endgroup$
– Vasu Deo.S
7 hours ago





$begingroup$
Oh, Thanks (+1). I totally forgot the fact that during the process of computing message digest of a message (in MD5 and SHA1), it's original length in bits is appended to the padded bits. Therefore, if we use message length > that length, we won't be able to append the actual length of the original message (as it would either result in overflow or would get truncated using a modulo operation which would lead to incorrect length).
$endgroup$
– Vasu Deo.S
7 hours ago













$begingroup$
BTW could you please tell me why answers like this still refer to the input space be infinite in length?
$endgroup$
– Vasu Deo.S
6 hours ago




$begingroup$
BTW could you please tell me why answers like this still refer to the input space be infinite in length?
$endgroup$
– Vasu Deo.S
6 hours ago












$begingroup$
@VasuDeo.S probably because for most purposes "infinite" is a good approximation of "messages shorter than 2^64 bit" (which is > 1 million terabyte).
$endgroup$
– SEJPM
6 hours ago




$begingroup$
@VasuDeo.S probably because for most purposes "infinite" is a good approximation of "messages shorter than 2^64 bit" (which is > 1 million terabyte).
$endgroup$
– SEJPM
6 hours ago












$begingroup$
Thanks for taking time to answer my question!!
$endgroup$
– Vasu Deo.S
6 hours ago




$begingroup$
Thanks for taking time to answer my question!!
$endgroup$
– Vasu Deo.S
6 hours ago

















draft saved

draft discarded
















































Thanks for contributing an answer to Cryptography Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcrypto.stackexchange.com%2fquestions%2f72069%2fdoes-a-hash-function-have-a-upper-bound-on-input-length%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

François Viète Contents Biography Work and thought Bibliography See also Notes Further reading External links Navigation menup. 21Google Bookspp. 75–77Google BooksDe thou (from University of Saint Andrews)ArchivedGoogle BooksGoogle BooksGoogle BooksGoogle booksGoogle Bookscc-parthenay.frL'histoire universelle (fr)Universal History (en)ArchivedAdsabs.harvard.eduPagesperso-orange.frArchive.orgChikara Sasaki. Descartes' mathematical thought p.259Google BooksGoogle BooksGoogle Bookspp. 152 and onwardGoogle BooksGoogle BooksScribd.comGoogle Books1257-7979Google BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGallica.bnf.frGoogle BooksGoogle Books"François Viète"Francois Viète: Father of Modern Algebraic NotationThe Lawyer and the GamblerAbout TarporleySite de Jean-Paul GuichardL'algèbre nouvelle"About the Harmonicon"cb120511976(data)1188044800000 0001 0913 5903n82164680ola2013766880073431702w6vt1sb70287374827140948071409480