Is there a way to make a 16-bit checksum of data with variable length, probably from 25 bytes to 8 KB?
The solution should be easy to implement, or should already be implemented in C++, and should be quick to evaluate.
|
Is there a way to make a 16-bit checksum of data with variable length, probably from 25 bytes to 8 KB? The solution should be easy to implement, or should already be implemented in C++, and should be quick to evaluate. |
|||||||||||
|
Questions on IT Security Stack Exchange are expected to relate to IT security within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.
|
Anything that is only 16 bits in size isn't going to be strong enough for any security application. Therefore, a non-cryptogrpahic hash function, such as CRC-16, should be fine. If you care about security, then the minimum would be a 128-bit hash function. MD5 is 128 bits, but it's very broken, SHA-1 is 160 bits and is "safe". SHA-256 is a great choice as a security checksum. |
|||||||||
|