0

I don't understand why it is said in Pset4 that "Odds are, if you find this pattern of four bytes on media known to store photos (e.g., my memory card), they demarcate the start of a JPEG. To be fair, you might encounter these patterns on some disk purely by chance, so data recovery isn’t an exact science."

Why purely by chance? Isn't it supposed that if a JPEG is "deleted" on a disc, searching for the JPEG pattern will always find the "deleted" JPEGs?

Thanks!

1

It means exactly what it says. If you find a signature pattern, the chances are high that this will mark the start of an image file. BUT, its also possible that there is stored data that will match a signature, completely by coincidence. A certain combination of a couple of consecutive pixels of the right colors could produce raw data that is also the same as a signature. It's unlikely, but it is possible. In fact, one of the test data sets does exactly that. It's also possible that garbage data or random data produced from other sources could produce four bytes that match a signature.

Simply put, there's no guarantee that random data can't match any string of data that you might be searching for. It's just the laws of chance.

It's kind of like saying that if you randomly shuffle a deck of cards, it can produce a perfectly ordered pattern. It's highly unlikely, but its still possible.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

1
  • Thanks Cliff B! "It's kind of like saying that if you randomly shuffle a deck of cards, it can produce a perfectly ordered pattern. It's highly unlikely, but its still possible." 👏👏👏 Thanks Curiouskiwi! Jun 6 '17 at 4:07
1

Those 4 bytes might appear and not be part of a jpg at all. The point is that if you find those 4 bytes, they probably signify the beginning of a jpg, but they might not.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .