I am looking for if it's possible to losslessly recreate the original content of a text file only from a stored hash value (I prefer CRC checksum algorithm instead of others, because it's footprint is really small, although it can be considered BAD for large inputs).
Specifically, I have one text file consisting of 16 characters from the alphabet:
AD DE CB ME AE PA EB AB CN NO CE MD CK GI CL GL LE CA PH GE HB CL DE CA LF CK KD CB AB BJ JA KE KL GI HM CI DB DE AJ FC
Goal: restore the original file content losslessly only from CRC hash values
If you have a suitably small and finite set of files, that just coincidentally have unique hashes, then yes you can derive the file from the hash, using the hash as a key.
1.1 - Small input - what´s the limit of overall number of characters in text file when hash algorithm still considers the file as good in term of making hash collisions?
P.S. Of course, separator (newline in this case) can be removed, since there are only two values (one pair), but that´s irrelevant so far. Therefore it can be mixed together, yet it must be paired correspondingly - i.e. "ADDECBME"
To guarantee that hash collisions do not occur for your "library" of files, you can reserve a "scratch area" (a gap somewhere) for tie breaking purposes and populate it with arbitrary values that produce a new, unique key for the whole file, which has now changed.
2.1. "Scratch area" - could it be defined in the form of new folders? I mean: there will be folders from 1-2000 with many generated files for CRC checksum comparisons purposes.
Or it must be separated much better such as corrupt file strategy? Corrupted files always gives the 00000000 CRC value (I know that from WinRAR), so... or 1st approach is better?
As for files generation, files will be generated randomly according to given specification since they don´t contain followable pattern at all. Any better ideas? Remember that I want to preserve only the CRC values, nothing more.
Time is not important, of course.
Could you help me?