How to generate hex representation of SHA1 using openssl command??? Thanks creat
ID: 3701042 • Letter: H
Question
How to generate hex representation of SHA1 using openssl command???Thanks
create a text mode password file named passwdfile.txt that contains the following line: Alice; <hex representation of SHA1(PW)>
where “Alice” is a recognized ID, and the PW is “SecretPW”. Note you can obtain the SHA1 of “SecretPW” via appropriate OpenSSL command. How to generate hex representation of SHA1 using openssl command???
Thanks
create a text mode password file named passwdfile.txt that contains the following line: Alice; <hex representation of SHA1(PW)>
where “Alice” is a recognized ID, and the PW is “SecretPW”. Note you can obtain the SHA1 of “SecretPW” via appropriate OpenSSL command. How to generate hex representation of SHA1 using openssl command???
Thanks
create a text mode password file named passwdfile.txt that contains the following line: Alice; <hex representation of SHA1(PW)>
where “Alice” is a recognized ID, and the PW is “SecretPW”. Note you can obtain the SHA1 of “SecretPW” via appropriate OpenSSL command.
Explanation / Answer
$ openssl dgst [hash function] -sign private.key -out file.sign file.input
$ openssl dgst [hash function] -verify public.key -signature file.sign file.input
hash function -> It is the name of the algorithm for computing the digest. Default is always MD5.
-sign private.key -> It encodes the digest computed from the input file with the private key of the author.
-verify public.key -> It decodes the signature with the public key and compares the output digest it with the one obtained from the input file.
-signature file.sign -> It is the source for verifiy the digital signature of the input file.
-out file.sign -> It is the destination file where to store the signature of the input file. Default is standard output.
file.input -> It is the file to digitally sign or to verify.
Therefore,
$ openssl dgst [SHA1] -sign private.key -out passwdfile.txt SecretPW
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.