Luminous Landscape Forum

Raw & Post Processing, Printing => Digital Image Processing => Topic started by: cn15 on July 28, 2008, 06:52:59 pm

Title: Can a raw file be doctored?
Post by: cn15 on July 28, 2008, 06:52:59 pm
I have always wondered if there is any way one can edit a file and then save it as a DNG or NEF or CR raw files.  I know of a medical legal case where an "expert" in photoshop is called to testify whether a picture has been "doctored".  I presumed this was a jpeg file.
Title: Can a raw file be doctored?
Post by: peteh on July 28, 2008, 07:14:04 pm
Quote
I have always wondered if there is any way one can edit a file and then save it as a DNG or NEF or CR raw files.  I know of a medical legal case where an "expert" in photoshop is called to testify whether a picture has been "doctored".  I presumed this was a jpeg file.
[{POST_SNAPBACK}][/a] (http://index.php?act=findpost&pid=211252\")
Yes! I believe Canon or I know for sure , at least I read this on the web that NIKON makes a forensic type camera that ,maybe does NOT alter the image.
Do a search for "Forensic camera" FUJI makes one for that type of work.
check her for more info.....
[a href=\"http://www.forensicmag.com/articles.asp?pid=122]http://www.forensicmag.com/articles.asp?pid=122[/url]
Title: Can a raw file be doctored?
Post by: peteh on July 28, 2008, 07:21:05 pm
Quote
Yes! I believe Canon or I know for sure , at least I read this on the web that NIKON makes a forensic type camera that ,maybe does NOT alter the image.
Do a search for "Forensic camera" FUJI makes one for that type of work.
check her for more info.....
http://www.forensicmag.com/articles.asp?pid=122 (http://www.forensicmag.com/articles.asp?pid=122)
[{POST_SNAPBACK}][/a] (http://index.php?act=findpost&pid=211254\")
Also be ready to PAY for such a camera!...another link
[a href=\"http://dpnow.com/4066.html]http://dpnow.com/4066.html[/url]
Title: Can a raw file be doctored?
Post by: Eric Myrvaagnes on July 28, 2008, 07:46:46 pm
But as soon as a picture file is downloaded from any digital camera (even a "forensic" one) to a computer, the file consist of a sequence of binary bits, which can be quite easily altered. To make the alterations appear convincing one would have to understand quite a bit about the format of the raw file, but that should be a piece of cake for any experienced and industrious programmer or hacker.

The only way I can imagine a digital image could be fairly certain not to have been doctored in any way would be to have the original photograph taken in the presence of reliable witnesses, then have the camera sealed and the "chain of custody" recorded until the camera is opened in the courtroom.

So altering any raw file is certainly possible, and I expect it would be easier than many of the "hacks" that go on regularly, IMHO.
Title: Can a raw file be doctored?
Post by: Panopeeper on July 28, 2008, 08:46:23 pm
Quote
I have always wondered if there is any way one can edit a file and then save it as a DNG or NEF or CR raw files
This is a very naive question, I had a hard time to take it seriously.

If you mention file, then you are talking about digitalized data available in computers. Accordingly, the proper question is not *if there is any way*, but *if such programs are readily available the public*.

There are literally tens of thousands of people, who could create such programs if they deemed that rewarding enough.
Title: Can a raw file be doctored?
Post by: madmanchan on July 28, 2008, 09:10:26 pm
The short answer is yes, absolutely, raw files can be doctored. In some cases it is trivial to do, in other cases difficult.
Title: Can a raw file be doctored?
Post by: rdonson on July 28, 2008, 09:54:37 pm
Quote
I have always wondered if there is any way one can edit a file and then save it as a DNG or NEF or CR raw files.  I know of a medical legal case where an "expert" in photoshop is called to testify whether a picture has been "doctored".  I presumed this was a jpeg file.
[a href=\"index.php?act=findpost&pid=211252\"][{POST_SNAPBACK}][/a]

You've actually asked two questions.

1) if its a data file on a computer it can be modified.  Some expertise required if you wish to make sure no one knows that its been modified.

2) can someone detect if a file (jpeg) has been "photoshopped"?  Yep, there's a professor who specializes in this and he has worked with Adobe.  You can catch a piece on him and his work on Nova Science Now
Title: Can a raw file be doctored?
Post by: John.Murray on July 28, 2008, 09:57:45 pm
The new proposed DNG specification by Adobe actually address' that issue (as well as corruption) by generating a hash or CRC of the raw data and including that within the file.  *Any* change to the original will cause the CRC check to fail

http://blogs.adobe.com/lightroomjournal/20...sta_dng_co.html (http://blogs.adobe.com/lightroomjournal/2008/05/dng_specification_vista_dng_co.html)
Title: Can a raw file be doctored?
Post by: DarkPenguin on July 28, 2008, 10:00:05 pm
Sure.  But they rarely get ill.
Title: Can a raw file be doctored?
Post by: tagor on July 29, 2008, 02:42:58 am
Quote
The new proposed DNG specification by Adobe actually address' that issue (as well as corruption) by generating a hash or CRC of the raw data and including that within the file.  *Any* change to the original will cause the CRC check to fail
It's not a CRC, it's an MD5 hash. A CRC is totally useless for detecting deliberate changes.

-- Tilo
Title: Can a raw file be doctored?
Post by: John.Murray on July 29, 2008, 10:43:39 am
Quote
It's not a CRC, it's an MD5 hash. A CRC is totally useless for detecting deliberate changes.

-- Tilo
[a href=\"index.php?act=findpost&pid=211325\"][{POST_SNAPBACK}][/a]

Sorry, my post was badly worded - both the hash and CRC serve the same purpose - the CRC *is* easily overcome, better suited for quickly verifying small blocks of data such as disk sectors, or packets on the wire.
Title: Can a raw file be doctored?
Post by: madmanchan on July 29, 2008, 11:20:26 am
The raw digest in the DNG 1.2 spec is designed to protect against accidental corruption/modification. That is, a file transfer error that corrupts a few bits of the image data (which is enough to completely ruin the decoding, if that image was compressed) is highly unlikely to also corrupt the digest in such a way that the corrupted digest matches the corrupted image data.

However, as noted above, this digest does not protect against deliberate modification. An adversary who wants to muck with the image data would simply have to recompute the digest from the modified data and replace the original digest with the modified one.
Title: Can a raw file be doctored?
Post by: Brad Proctor on July 29, 2008, 12:36:51 pm
Quote
It's not a CRC, it's an MD5 hash. A CRC is totally useless for detecting deliberate changes.

-- Tilo
[a href=\"index.php?act=findpost&pid=211325\"][{POST_SNAPBACK}][/a]

Couldn't you just generate a new MD5 on the modified data to replace the old one?  Seems to me that somewhere, other than the file, the MD5 would need to be stored for comparison to verify its authenticity.  Am I missing something here?
Title: Can a raw file be doctored?
Post by: madmanchan on July 29, 2008, 12:43:17 pm
Yes exactly. The MD5 hash is stored as a tag in the DNG file (as metadata, in other words). So, as noted above, an adversary can tweak the raw data, recompute the MD5 fingerprint, and update the raw digest tag in the DNG.

Again, the DNG raw digest is designed to help protect against accidental corruption ONLY. It has NO security / authentication powers at all, nor was it intended to.
Title: Can a raw file be doctored?
Post by: John.Murray on July 29, 2008, 01:15:55 pm
Quote
Yes exactly. The MD5 hash is stored as a tag in the DNG file (as metadata, in other words). So, as noted above, an adversary can tweak the raw data, recompute the MD5 fingerprint, and update the raw digest tag in the DNG.

Again, the DNG raw digest is designed to help protect against accidental corruption ONLY. It has NO security / authentication powers at all, nor was it intended to.
[a href=\"index.php?act=findpost&pid=211462\"][{POST_SNAPBACK}][/a]

Actually it does - recomputing a new MD5 hash from the altered RAW data will result in a new 16byte value (128bit) in the DNG's RawImageDigest field.  It is this value that is usefull to determine whether the content had been changed.  This value is easilly inspected using Adobes own dng_validate tool:

.
.
.
ProfileCopyright: "Copyright 2008 Adobe Systems, Inc."
ForwardMatrix1:
      0.8259   0.0184   0.1200
      0.3835   0.6715  -0.0550
      0.1129  -0.2582   0.9705
ForwardMatrix2:
      0.8001   0.0303   0.1339
      0.3876   0.7158  -0.1034
      0.0623  -0.1346   0.8975
PreviewApplicationName: "Adobe Photoshop Lightroom"
PreviewApplicationVersion: "2.0"
PreviewSettingsDigest: <383fb6eff82dfb94bec97caa5d29046e>
PreviewColorSpace: sRGB
PreviewDateTime: "2008-07-29T10:27:44-07:00"
RawImageDigest: <2e3eb30e25439958c7819d045a13d6e0>
NextIFD = 0

SubIFD 1: Offset = 88936, Entries = 28
.
.
.
Title: Can a raw file be doctored?
Post by: Panopeeper on July 29, 2008, 02:22:07 pm
Quote
Actually it does - recomputing a new MD5 hash from the altered RAW data will result in a new 16byte value (128bit) in the DNG's RawImageDigest field.  It is this value that is usefull to determine whether the content had been changed
What exactly is that supposed to prove?

It proves, that two versions are not identical. However, I don't need any checksum to verify that, I can compare the contents directly.
Title: Can a raw file be doctored?
Post by: John.Murray on July 29, 2008, 02:57:06 pm
Post processing a DNG files will also "change" it's content.  The point of of the RawImageDigest field is to ensure the original RAW data within the file remains unaltered.
Title: Can a raw file be doctored?
Post by: Panopeeper on July 29, 2008, 03:21:49 pm
Quote
The point of of the RawImageDigest field is to ensure the original RAW data within the file remains unaltered.
It does not ensure that the raw data remain unaltered. It makes an alteration recognizable (with high probability), if the digest has not been recalculated after the alteration. This is good against accidantal change of the data or destruction through transfer, etc.

However, if a program changes the raw data and recalculates the digest, then everything look ok (as it is supposed to).
Title: Can a raw file be doctored?
Post by: John.Murray on July 29, 2008, 03:42:27 pm
But after recalculating the value will have changed - comparing this using dng_validate.exe  will immediately identify whether the DNG's RAW data has in fact been altered.

Of course this pre-supposes whether you would have access (EDIT: or documented) to the original DNG (or even the original RAW file - DNG also has a OriginalRawFileDigest field as well).
Title: Can a raw file be doctored?
Post by: Panopeeper on July 29, 2008, 04:44:45 pm
Quote
But after recalculating the value will have changed - comparing this using dng_validate.exe  will immediately identify whether the DNG's RAW data has in fact been altered
LOL, how do you know which one is the original?
Title: Can a raw file be doctored?
Post by: madmanchan on July 29, 2008, 05:04:16 pm
Joh, your reasoning is flawed. The validation system works by grabbing the image data from the raw file, computing the MD5 hash, then comparing that computed hash with the digest stored in the file metadata. If they match, it's considered good. If not, it's considered bogus.

If an adversary modifies the original data and updates the hash, then the original hash no longer exists (it's been overwritten). So the validation system has no way of knowing that the data has been modified. It'll run thru the above check and say "looks good to me."
Title: Can a raw file be doctored?
Post by: John.Murray on July 29, 2008, 05:24:32 pm
I believe the original post was about detecting whether a file was altered . . .

That (at least to me) would imply there was something to compare it against.  Any reasonable chain of evidence would include documentation.  The built in features in the new DNG spec allow:

Quick and easy documentation at the ingestion phase - run dng_validate.exe and generate a human readable text file of metadata and fields.

The ability of *anyone* to post process within that same file for presentation, yet be assured that the data upon which the presentation is based is unaltered - run dng_validate and compare . . . .

I've never suggested that the new DNG spec replace "rules of evidence", rather it greatly enhances and benefits them.
Title: Can a raw file be doctored?
Post by: bjanes on July 29, 2008, 08:11:29 pm
Quote
Joh, your reasoning is flawed. The validation system works by grabbing the image data from the raw file, computing the MD5 hash, then comparing that computed hash with the digest stored in the file metadata. If they match, it's considered good. If not, it's considered bogus.

If an adversary modifies the original data and updates the hash, then the original hash no longer exists (it's been overwritten). So the validation system has no way of knowing that the data has been modified. It'll run thru the above check and say "looks good to me."
[{POST_SNAPBACK}][/a] (http://index.php?act=findpost&pid=211549\")


From the above discussion, it would appear that many technically accomplished programmers could easily doctor a raw file without detection by the methods discussed. However, other methods may reveal tampering. Some of these are discussed in a recent volume of Scientific American:

[a href=\"http://www.sciam.com/article.cfm?id=digital-image-forensics]http://www.sciam.com/article.cfm?id=digital-image-forensics[/url]

Be sure to read the sidebar:

http://www.sciam.com/article.cfm?id=5-ways-to-spot-a-fake (http://www.sciam.com/article.cfm?id=5-ways-to-spot-a-fake)

The recent Iranian photos of a missile launch were crude attempts at cloning:

http://www.sciam.com/article.cfm?id=is-that-iranian-missile (http://www.sciam.com/article.cfm?id=is-that-iranian-missile)

In legal cases it is still necessary to have the photographer testify that the picture in question accurately represents what he/she saw and it is also important to preserve the chain of evidence as previously mentioned.

Bill
Title: Can a raw file be doctored?
Post by: feppe on July 30, 2008, 08:16:14 am
I haven't read the DNG specifications, but it is entirely possible to have a "secure" or forensic camera to make an MD5 (or whatever) hash with its own key. Any new hash made would show that the adjustments are not done by the camera, ie. it was adjusted off-camera.

This would not only validate the photo was not altered, but also which camera took the photo. Again, making a new hash would only serve the purpose of validating that the hash is correct, but it would also show the source of the hash (ie. alteration) is different than the camera.

In similar way, Lightroom or Photoshop could conceivably have a plugin which would also sign the hash with its own key.

For those who are interested in the nitty-gritty, google "public key cryptography."
Title: Can a raw file be doctored?
Post by: Brad Proctor on July 30, 2008, 12:35:04 pm
Quote
I haven't read the DNG specifications, but it is entirely possible to have a "secure" or forensic camera to make an MD5 (or whatever) hash with its own key. Any new hash made would show that the adjustments are not done by the camera, ie. it was adjusted off-camera.

This would not only validate the photo was not altered, but also which camera took the photo. Again, making a new hash would only serve the purpose of validating that the hash is correct, but it would also show the source of the hash (ie. alteration) is different than the camera.

In similar way, Lightroom or Photoshop could conceivably have a plugin which would also sign the hash with its own key.

For those who are interested in the nitty-gritty, google "public key cryptography."
[a href=\"index.php?act=findpost&pid=211721\"][{POST_SNAPBACK}][/a]

Now we're getting somewhere
Title: Can a raw file be doctored?
Post by: Panopeeper on July 30, 2008, 07:31:18 pm
Quote
Now we're getting somewhere
We are not getting anywhere. The topic was and is NOT if a photographer can verify if his/her image has been modified. No additional info is necessary (checksum, digest, key) if the original is available.

The topic is, how an image can be proven as being the original to a third party, for example in court. In other words: how can one prove, that an image is original, not compared to another version, but on its own.

It is possible to encode a digest like MD5 using an asymmetric key; however, the private part of that key has to be preserved somewhere. It can be stored in the camera firmware, in which case only the manufacturer knows the key - as long as no-one makes the effort to find it.

Doing the same in Photoshop, etc. is a dead-born idea. What should that prove? That I have successfully processed the image in Photoshop?

Methink some posters don't understand the difference between watermarking and authentication.
Title: Can a raw file be doctored?
Post by: Brad Proctor on July 30, 2008, 09:52:59 pm
Quote
We are not getting anywhere. The topic was and is NOT if a photographer can verify if his/her image has been modified. No additional info is necessary (checksum, digest, key) if the original is available.

The topic is, how an image can be proven as being the original to a third party, for example in court. In other words: how can one prove, that an image is original, not compared to another version, but on its own.

It is possible to encode a digest like MD5 using an asymmetric key; however, the private part of that key has to be preserved somewhere. It can be stored in the camera firmware, in which case only the manufacturer knows the key - as long as no-one makes the effort to find it.

Doing the same in Photoshop, etc. is a dead-born idea. What should that prove? That I have successfully processed the image in Photoshop?

Methink some posters don't understand the difference between watermarking and authentication.
[a href=\"index.php?act=findpost&pid=211882\"][{POST_SNAPBACK}][/a]

Methinks some posters are a little grumpy this evening.

I think we've established that there must be more information than the file itself for this concept to work.  An MD5 hash embedded in the file doesn't do any good, but the use of encryption like feppe suggested at least allows that additional piece of information to to stay consistent and is a step in the right direction.  Hence, "Now we're getting somewhere."
Title: Can a raw file be doctored?
Post by: bernie west on July 31, 2008, 07:10:45 am
Quote
It is possible to encode a digest like MD5 using an asymmetric key; however, the private part of that key has to be preserved somewhere. It can be stored in the camera firmware, in which case only the manufacturer knows the key - as long as no-one makes the effort to find it.

[a href=\"index.php?act=findpost&pid=211882\"][{POST_SNAPBACK}][/a]

The key could be hardware based, as opposed to software, I believe.  The down-side might be processing time for keys of any meaningful length.
Title: Can a raw file be doctored?
Post by: Marlyn on August 01, 2008, 12:00:45 am
For a system to work where you can verify the contents hasn't changed since it was Origionally created, the data would have to be signed, generally by a digital Certificate.

You could sign the entire file, or you could just sign the MD5 Hash potentially,

For the best end-to-end system, this would have to take place IN the camera, but I suspect it could also take place at the first download, when done by law enforcment maintaining a chain of evidence.

Mark.
Title: Can a raw file be doctored?
Post by: Guillermo Luijk on August 02, 2008, 06:35:48 am
If the camera had its own hardware code to encode the key into the RAW file, and only the owner of that camera (for instance the forensic corps making use of it) had access to that camera, then it is certainly possible in a court to prove:
* That the RAW file in discussion was actually produced by that particular camera
* That the RAW file has not been altered

but only as long as the owner of the camera has not access to the hardware code and algorithm to generate the key.

If the owner of the camera has access to that information, they (and only they) could only prove:
* That the RAW file in discussion *could* actually have been produced by that particular camera

So the problem is here again. It all depends on who has access to the original camera and its inner data, and what their intentions or legal confidence are.
Title: Can a raw file be doctored?
Post by: jerryrock on August 02, 2008, 03:49:09 pm
Canon has been producing data verification kits for it's line of Digital EOS cameras since the 1Ds in 2002. These kits provide data verification for law enforcement and other documentary purposes.

Canon DVK-E1 (discontinued) for the EOS 1Ds
Canon DVK-E2 (discontinued)for the EOS 1Ds, 1D Mark II(n), 1Ds Mark II, 1D Mark III, 5D, 30D, 20D, 20Da.

Current model is the OSK-E3 which was introduced in 2007 with the EOS 1D Mark III. It support all previously supported models of Canon EOS cameras. Price = $650. (US)