OpenSSL create SHA hash from shell stdin

后端 未结 2 1577
心在旅途
心在旅途 2020-12-11 00:47

How to generate the SHA-512 hash with OpenSSL from command line without using a file?

I\'ve tried this

echo \"password\" | openssl dgst -sha512
         


        
2条回答
  •  时光说笑
    2020-12-11 01:47

    Try echo -n "password".

    What's happening is the new line character(s) that echo adds to the end of the string are getting hashed. The -n to echo suppresses this behavior.

提交回复
热议问题