I want to get external proof for the time a picture was recorded. I was thinking of using ssl timestamp and a public time stamping authority for this. It would not prove exactly when the picture was taken but prove that the picture existed at the point in time the TSA signature was created, which is enough for my needs.
I have found [this guide] (https://www.freetsa.org/index_en.php). Say the file I want time stamped is image.png
- Generate a hash of the file.
openssl ts -query -data image.png -no_nonce -sha512 -out image.tsq
- Get a signed time stamp from freetsa.org for instance:
curl -H "Content-Type: application/timestamp-query" --data-binary '@image.tsq' https://freetsa.org/tsr > image.tsr
Then I can validate the image.tsr
(both cacert.pem
and tsa.crt
are downloaded from freetsa.org):
openssl ts -verify -in image.tsr -queryfile image.tsq -CAfile cacert.pem -untrusted tsa.crt
The problem comes when I want to validate the image file itself, which fails:
openssl ts -verify -in image.tsr -data image.png -CAfile cacert.pem
I'm new to the signing and timestamping process and would like understand what I'm doing wrong here.