I've had an idea about storing parts of SHA256 hashes and I'd like to find out how secure it is, or how much less secure it is than storing the entire hash.
For example, users can share this list of truncated hashes and each user only stores one of the entire hashes, they only need to store they're own hash, and when someone gives them a hash they don't recognize they can check it against my list.
If I have some hashes like this:
CA978112CA1BBDCAFAC231B39A23DC4DA786EFF8147C4E72B9807785AFEE48BB
3E23E8160039594A33894F6564E1B1348BBD7A0088D42C4ACB73EEAED59C009D
2E7D2C03A9507AE265ECF5B5356885A53393A2029D241394997265A1A25AEFC6
etc ...
Instead of storing all 256 bits of each hash, I'd like to store random chunks of each hash. The first step is to add a number to the end of the hash.
CA978112CA1BBDCAFAC231B39A23DC4DA786EFF8147C4E72B9807785AFEE48BB(4)
3E23E8160039594A33894F6564E1B1348BBD7A0088D42C4ACB73EEAED59C009D(7)
2E7D2C03A9507AE265ECF5B5356885A53393A2029D241394997265A1A25AEFC6(9)
And now instead of storing the entire hash, I store two bytes from each hash. The first byte is byte 4 for the first hash, 7 for the second etc ... using the number I added to the end of the hash.
The first number is the 4th byte.
The second number is (first number + half size of the entire hash) % (size of the entire hash).
So based on my first hash above:
CA978112CA1BBDCAFAC231B39A23DC4DA786EFF8147C4E72B9807785AFEE48BB(4)
byte1 = 4th byte = 12
byte2 = (4 + 32/2) % 32 = 20th byte = F8
So instead of storing:
CA978112CA1BBDCAFAC231B39A23DC4DA786EFF8147C4E72B9807785AFEE48BB(4)
I could store:
12F8(4)
So now I have my hash and if I want to compare it against the list I just check the 4th and 20th bytes equal 12 and F8, respectively.
I don't know anything about Cryptography really, so I'm wondering if this idea already exists, if it's secure and if there's a way prove mathematically how secure only storing 8 bits of the 256bit hash is as opposed to storing the entire thing.
Thanks!