Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

md5() - limit on amount of text encrypted?

Status
Not open for further replies.

mancroft

Programmer
Oct 26, 2002
267
GB
md5() - limit on amount of text encrypted?

When using md5($string);, is there an upper limit on the amount of $string that can be encrypted.

For example, can an entire web page be encrypted this way?

Thanks.
 
But md5() function does not encrypt its argument. It calculates the hash of a string (32-character hexadecimal) - some kind of a message checksum...
 
I'd like to see that happen, given the fact that MD5 is a hashing algo and is non-reversible.

the resulting browser output would be interesting to say the least [lol]

Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
Nightclub counting systems

So long, and thanks for all the fish.
 
No matter how much input, the output of an md5 hash is a fixed-length (32 character) string, being the hexadecimal representation of the 16-byte binary data that is the real hash-function output. It's a reentrant piece of code that takes the input data in chunks of 64 bytes, if memory serves, and repeatedly modifies its output data based on the new input chunk. It will operate very slightly differently on the last piece of data it receives, as it adds a few bytes of data to the input stream when finishing. So, yes you can take an md5 of anything from an empty string to the entire content of your hard drive, and obtain just one 32-character string in return.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top