Ricardo Polo Jaramillo
Ricardo Polo Jaramillo

Reputation: 12318

Digital certificate to JPEG

Is it possible to inject a digital SSL certificate to an image? I know how to sign an executable file (.exe) file or a PowerShell script (.ps1) but is it possible with an image (JPEG)?

Upvotes: 1

Views: 773

Answers (2)

emboss
emboss

Reputation: 39620

I was the co-inventor of the "dSIG" chunk that involves digital signatures to be embedded in PNGs. I believe this is more about what you are really after, you may want to have a look at the specification.

You could use a degenerated CMS signature only consisting of certificates but with no actual SignerInfo to just add certificates to a PNG image that way, but I would assume that actual signatures might be more about what you really want?

The beauty of the approach is that software not aware of dSIG will continue to display the image as if it weren't signed at all, it will simply ignore the additional dSIG chunk.

Upvotes: 1

You can create a detached CMS signature and pass it along with the JPEG file. The benefit is that the original JPEG file is not modified in any way.

Another idea that comes to my mind is putting JPEG into say PDF and sign the PDF using PDF signing techniques. But this won't let you easily extract the JPEG (the user will be able to easily view it though).

Upvotes: 2

Related Questions