LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   using SHA1 on terminal (https://www.linuxquestions.org/questions/linux-software-2/using-sha1-on-terminal-4175479634/)

anuRV 10-04-2013 01:57 PM

using SHA1 on terminal
 
Hi,

I am trying to use SHA1 on the terminal in my macbook. Do I need any prerequisites?

sha1::sha1 "test string"
-bash: sha1::sha1: command not found

Any help or information on SHA1 and its usage would be appreciated.

Thanks in advance :)
ANRV

teckk 10-04-2013 03:12 PM

md5sum filename
sha1sum filename

anuRV 10-16-2013 04:16 PM

Hi again!

I now encode a file as below:
openssl sha1 -hex myFile.txt
SHA1(myFile.txt)= 951d2dd9ee6eda62be4eaba4101edc3174723e21

openssl sha1 -hex "mystring"
mystring: No such file or directory

Can anyone help me figure out how to encode the contents of the file rather than the file name?
Or how to encode a string?

Thanks in advance.

teckk 10-17-2013 02:50 PM

sha1 gives you the checksum of a file or string. You can then compare that to a known unchanged file to see if the file has the same checksum, (It is the exact same unaltered file) It is possible to enc with openssl.

http://www.bresink.com/osx/sha1.html
http://support.apple.com/kb/HT1652
http://en.wikipedia.org/wiki/SHA-1
http://www.madboa.com/geek/openssl/#encrypt-simple
http://www.madboa.com/geek/openssl/#encrypt-base64
http://www.madboa.com/geek/openssl/#key
http://www.madboa.com/geek/openssl/


All times are GMT -5. The time now is 05:42 AM.