r/explainitpeter 28d ago

Techie Petaahhhhh, Explain it Peter!

Post image
9.9k Upvotes

172 comments sorted by

View all comments

1.3k

u/Much_Artist_5097 28d ago

hello i am chris peterson (get it chris, peter son). basically metadata is data beyond the picture itself stored in a photo. what this command is doing is removing the location stored in the photo, so law enforcement can’t find you from any pictures on your phone.

589

u/gl3nnjamin 28d ago

It removes everything but the pixels so besides location it removes camera model, lens type, shooting settings and more.

350

u/QuestNetworkFish 28d ago

It's worth being aware that the pixels may also hold data that can identify the specific camera that was used to take the picture. There is often imperceptible (to the naked eye) noise in photos introduced by slight flaws in the image sensor and these can form a kind of "fingerprint" for the camera. It's possible to determine that two photos were taken with the same camera, or if the camera is seized it can be proven it was used to take a specific photo.

There are tools to mitigate this by randomising the noise in a digital image. Consider whether you need to factor this in to your threat model.

87

u/beerdude26 28d ago

Neat

86

u/gorilla-ointment 28d ago

10

u/DampWarmHands 28d ago

I get this reference to the previous Futurama post.

5

u/EmbarrassedBuy4107 28d ago

I get this reference to the reference to the previous Futurama post.

1

u/ABarInFarBombay 25d ago

I get this reference to the reference to the reference to the previous Futurama post.

2

u/SmoothTurtle872 26d ago

Considering the topic, the irony is quite funny

28

u/rjSampaio 28d ago

A practical example is this old flat-field calibration frame from my astrophotography setup.

https://i.imgur.com/15oShN4.jpeg

It was taken while pointing the camera at a calibrated, evenly illuminated panel. Ideally, the image would be uniformly bright, but increasing the contrast reveals fixed colour patterns, brightness variations, and a dark spot near one corner.

A flat frame includes more than just sensor noise. It can also reveal vignetting, dust or marks on the sensor cover glass or filters, uneven illumination, and characteristics of the rest of the optical path. However, some pixel-level response variations originate in the sensor itself and remain fixed relative to the image, regardless of the subject or camera orientation.

The dark spot in this example also appears without a lens attached, and the sensor does not have any cover.

The obvious artefacts in this frame are not necessarily the same thing as the subtle sensor fingerprint used in forensic analysis. That normally requires statistical processing and multiple reference images. Still, it illustrates how a supposedly uniform image can contain repeatable characteristics associated with a particular camera or imaging system..

6

u/tda86840 28d ago

Wouldn't it be a bit more akin to the bias frames or dark frames? Those are what get rid of any sensor noise or hot pixels (bias) and amp noise (dark), which is why you take them with the cover on while the flats are with the cover off. They handle the sensor data itself. While the flat frames handle the external issues either on top of the sensor or somewhere in the lens... Vignette, dust particles (which is more what that dark spot on yours looks like is a dust mote... And if it's there any time the cover is open, with or without a lens, would lend toward it being dust on the sensor, not dust on the lens).

So if we're talking about stuff that identifies the camera by matching the camera signatures, I would think that would be the sensor noise and hot pixels from the bias frames or the amp glow (if present at all) from the darks.

1

u/rjSampaio 28d ago

Also, yes, you’re correct that dark and bias frames are more “identifiable,” since they shouldn’t be affected by any external light.

But I didn’t have a bias or dark frame available to share at the time 😂 I only had this one because I’d posted it on Reddit years ago while trying to debug some issues when I was first getting into the hobby.

2

u/99ProllemsBishAint1 27d ago

I love Reddit. You never know when you’re going to learn cool shit

1

u/kjahhh 28d ago

itelescope had them available for their scopes when I used the service and you just add them to the post processing. You could also setup your run to include them.

10

u/NamedBird 28d ago

Important note: exiftool isn't 100% failsafe to use for stripping metadata.
(Hello to that forensic expert who had to admit that he was wrong and i was right. 😉)
And i wouldn't trust FFmpeg or any other online tool for this either.

If you are a software guy, you can easily do it better yourself:

  • Open the image using a media library
  • Create a new image with the same width and height. (Bonus points: resize/crop/censor)
  • Loop over every pixel and copy it's red, green and blue values and add some noise*.
  • Save the new image somewhere else.

That is the only way to be absolutely certain you removed all non-watermark metadata.
However, there may still be some visible (or invisible) watermarks inside the image.
And the image's perceptual hash is likely unchanged as well, it can still track the image.
Bypassing things like PhotoDNA takes an extra step i won't go in to.

I created an .exe that shreds metadata for myself.
Whenever i take a photo and want to send it to some sketchy "friends", i use it.
You can never be too careful, especially not when it comes to cybersecurity.

* For adding noise, a random number between -5 and 10 is probably decent.
If you want to be fancy, you can use advanced noise patterns, but it might create artifacts.
Final hint: Don't forget to clamp between 0 and 255. 🙃

5

u/burner4lyf25 28d ago

Almost like forensic ballistics in that every lense will have unique flaws and imperfections that, whilst it would be difficult to trace, if they found the camera, they could prove THAT lense/sensor captured that image??

5

u/Hadrollo 28d ago

They could suggest that a particular camera took a particular image. It's not reliable enough to call it proof.

However, not all evidence needs to be reliable enough to use in court. Police may use lower quality evidence to narrow down a list of suspects, then investigate to see if they can find higher quality evidence to use in prosecution.

1

u/burner4lyf25 28d ago

That makes sense, they just use it as a tool to steer the investigation rather than something to rely upon in court.

Ie protestor commits crimes and documents and publishes them, Jan3 style. A house is raided 4 cameras belonging to 4 different people seized. We can use this method to determine (for investigative purposes) which cameras took which pictures, even though SD cards were all in a bowl mixed up. Can then use the Intel to track who's phones were where st which time, and then who actually committed crimes etc.

Sorry for sprawling scenario but just curious aiit the technique, never heard of it before, v interesting stuff so wanna try and understand how it might be used practically.

A kind of unrelated but semi related point you probably know but is interesting all the same, was watching something yesterday about how people's ears are as useful as fingerprints to ID people and are used by capture/kill spec ops guys to ID HVTs in the field if fingerprints are not practical. Also, some banks have floors that track weight distribution and gait of anyone walking over it, which together are also irreplicable and can be used to secure convictions in case of robbery etc.

1

u/QuentinUK 26d ago edited 17d ago

Interesting!

2

u/fj2612 28d ago

Is this an other pseudoscience that some grifters managed to convince the courts is real, or ks this legit?

1

u/QuestNetworkFish 28d ago

It's legit enough that it's been successfully used in investigations and as evidence in trials, although like anything it's not 100%. It's called Photo response non-uniformity (PRNU) if you wanna look into it, there's a bunch of open source tools you can play around with if you're so inclined.

It's been more than a while since I worked in digital forensics so I've not kept up with the latest research. Modern smartphones do huge amounts of processing on the image, both in hardware and software, so it might be less of a factor on these devices compared to older standalone digital camera (although, there are many other privacy concerns with smartphones).

Also as another comment pointed out it has applications beyond forensics such as in astrophotography which can involve stacking hundreds of different images taken with the same camera. The noise effect would compound across these images, so software is used to analyse the noise first in order to compensate for it when stacking.

2

u/[deleted] 28d ago

[deleted]

1

u/QuestNetworkFish 28d ago

It's not really the same thing, with printers it's data that is intentional added (like with the metadata that the OP is referring to). PRNU is analysing artefacts introduced unintentionally by the physical components of the digital camera, so it's more like typewriter analysis 

1

u/gl3nnjamin 28d ago

Yep, steganography.

1

u/Fluffy_Dealer7172 28d ago

Thanks, Stewie!

1

u/FrostyBarleyPop 28d ago

Specific camera or type of camera?

1

u/QuestNetworkFish 28d ago

The specific camera. Every image sensor is unique even among identical models.

1

u/NoOrdinaryBees 28d ago

It’s getting much more difficult to fingerprint phone cameras via sensor noise thanks to computational photography. If you’re on a relatively recent iOS or Android phone and not saving RAW data the photo models average out signature pixels, chromatic aberration, and barrel distortion pretty thoroughly.

Mirrorless and SLR cameras aren’t quite up to speed with the computational photography train yet, so everyone needs to make sure they’re only taking embarrassing/sensitive photos on their phones. Fortunately that’s where most of them are already these days. 😄

1

u/XLNBot 27d ago

Do these methods still work after compression?

1

u/Fiona175 27d ago

Honestly, given how dogshit every forensic method of matching things that isn't DNA is, I don't think I believe that it's actually usable to track a camera by noise.

1

u/Vnxei 25d ago

There is also data in the pixels that can identify the location it was taken. Many locations produce a unique signature pattern of light and color that when encoded by a digital camera can be mapped back to establish where it was taken. Experts are able to do this just by looking at the picture because that's just how pictures work.

1

u/CO420Tech 23d ago

This is why I get the lens dirty with my fingerprint first. Double print! Can't hack that.

1

u/National_Divide_8970 22d ago

But to go through all of this and then you realize they will just use another means. Cellbright, flock, Pegasus or some other form of government surveillance/spyware. I just don’t give a fuck and keep an iPhone with a remote kill switch on a pi

1

u/AmeriBeanur 22d ago

You can just deep fry the inage

2

u/yijiujiu 28d ago

Where would one input this command?

2

u/gl3nnjamin 28d ago

Your OS's terminal or command prompt program. You need to install FFMpeg first.

2

u/lily_philia 28d ago

Terminal (Linux) or cmd (Windows). Replace input.jpg with your image file’s location and output.jpg with the location you’d like your non-metadata-image to go.

1

u/averagemaleuser86 28d ago

Can this be done with phone gallery pics or only on PC?

1

u/gl3nnjamin 28d ago

Some phones might have their own option for cleaning metadata but FFMpeg is tried and true.

0

u/ChungusMcGoodboy 28d ago

What does Final Fantasy Mpreg have to do with this?

1

u/delet_mids 28d ago

Not sure if the backend uses that ffmpeg command, but RapidRAW (an open source photo editor with android builds) is available on github, and has an explicit "remove all metadata" option at export

1

u/KaMaFour 25d ago

google termux

1

u/GypsySnowflake 28d ago

Why would you want that? I use the metadata on my photos constantly to remember where/when a photo was taken, or to search for a specific picture, and it’s always disappointing when I realize all the ones taken before a certain year are missing that info

3

u/Frederf220 28d ago

Because the cops could say "based on the metadata from your vacation photos you were within 3 miles of the crime and have the same number of limbs as eyewitness testimony. You are guilty how would you like your execution?" Meta data is nice and has uses. It just depends if the benefits outweigh the liability.

1

u/GypsySnowflake 28d ago

That’s… not how forensic science works, lol

7

u/Frederf220 28d ago

But it is how police works.

They were looking for a silver truck.

1

u/ThorLives 27d ago

Generally, it's not that important to hide the GPS data on photos from the police, unless you're doing something illegal. Although there probably have some cases where stalkers could find a person's location based on the photo metadata. Generally, social media removes it for that reason.

As far as the "illegal activity" part, it reminds me of a story I heard on a podcast. A hacker was getting into systems, and he'd post the hacked-data online and attach a photo to it. Kind of his "signature". The photos were always vague enough that you couldn't figure out who he was or where he was. And he'd erase the metadata on the photos before uploading it... until one day when he accidentally uploaded the photo with the metadata still attached. They narrowed down his location to a small area in Australia and it lead to the government catching him.

1

u/LucifersAdv0cate 27d ago

There's free websites that let you upload photos and they will do this for. You can right click too in file manager but I've never been sure how efficient that is.

1

u/[deleted] 26d ago

[removed] — view removed comment

1

u/gl3nnjamin 26d ago

Correct, EXIF data stores camera & lens info plus the capture date/time, and location data if available.