In this guide, we'll walk through the process of verifying the contents of an image file using the command line, OpenSSL, and your public key.
Before we begin, ensure you have the following:
- The image file you want to verify (
image.jpg) - Your public key (
public.pem) - OpenSSL installed on your system
-
Convert Image to Binary
Start by converting the image file to binary. You can achieve this using the
xxdcommand:xxd -p image.jpg > image.bin -
Verify the Image
Next, verify the image using OpenSSL and your public key:
openssl dgst -sha256 -verify public.pem -signature image.bin.sha256 image.bin
This command will verify the image contents using your public key.