Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Openssl sha1 length

Why after executing the command openssl sha1 < /dev/null | wc --bytes the output is 50? The output size of SHA-1 should have 160 bits what gives us 20 bytes.

like image 316
Adam Sznajder Avatar asked Aug 16 '26 09:08

Adam Sznajder


1 Answers

Why is the output of openssl sha1 < /dev/null | wc --bytes 50?

$ openssl sha1 < /dev/null
(stdin)= da39a3ee5e6b4b0d3255bfef95601890afd80709

Because the 20 byte digest is prefixed by (stdin)= and is expressed in hex.

like image 163
MattH Avatar answered Aug 18 '26 21:08

MattH



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!