signature - Generating, Signing and Verifying Digital Certificates - Ask Ubuntu
so here's question project.
in task, use openssl generate digital signatures. please prepare file (example.txt) of size. prepare rsa public/private key pair. following: 1. sign sha256 hash of example.txt; save output in example.sha256. 2. verify digital signature in example.sha256. 3. modify example.txt, , verify digital signature again. please describe how performed above 3 operations (e.g., exact commands used, etc.). describe observed , explain observations. please explain why digital signatures useful in general.
so, following.
1.create private/public key pair
openssl genrsa -out private.pem 1024
2. extracting public key.
openssl rsa -in private.pem -out public.pem -outform pem -pubout
3. create hash of data.
echo 'data sign' > example.txt openssl dgst -sha256 < example.txt > hash
4. sign hash using private key file called example.sha256
openssl rsautl -sign -inkey private.pem -keyform pem -in hash > example.sha256
5. verify file (example.txt)and digital signature (example.sha256)
openssl dgst -sha256 -verify public.pem -signature example.sha256 example.txt
after doing this, error message saying "verification failure"
please correct me if went wrong somewhere.
generating private/public key pair. 1. openssl genrsa -out private.pem 1024 2. openssl rsa -in private.pem -out public.pem -outform pem -pubout sign. openssl dgst -sha256 -sign private.pem -out sla.txt.sha256 sla.txt verify openssl dgst -sha256 -verify public.pem -signature sla.txt.sha256 sla.txt
Comments
Post a Comment