|
General software and network General OS-independent software and network questions, X11, MTA, routing, etc. |
|
Thread Tools | Display Modes |
|
|
|||
'openssl dgst -sha256 filename' will also do the trick, but you need a recent version of OpenSSL (the one from FreeBSD 7.0 is fine).
|
|
||||
Code:
Terry@dixie$ uname -r 2:56 7.0-STABLE Terry@dixie$ openssl version 2:57 OpenSSL 0.9.8e 23 Feb 2007 Terry@dixie$ openssl dgst -sha256 ~/.vimrc 2:57 SHA256(/usr/home/Terry/.vimrc)= d5b17cc1975d3095c6353f3fdced45ae867c06e02c1efb7c09662cdc796724b0 Terry@dixie$ 2:57 $ openssl version ).
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
|||
From the OpenBSD 4.2 man page sha-1(1):
Code:
The sha1 command is shorthand for cksum -a sha1 The cksum(1) command can also be used to compute digests from the SHA-2 family: sha256, sha384 and sha512. Code:
-a algorithms Use the specified algorithm(s) instead of the default (cksum). Supported algorithms include cksum, md4, md5, rmd160, sha1, sha256, sha384, sha512, sum, and sysvsum.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
Quote:
http://www.beeblebrox.org/hashtab Sorry about the weird url format, the forum won't let me post url's because I don't have enough posts apparently, but it is a pretty useful little free utility for generating all kind of checksums. [EDIT: Carpetsmoker: Made proper link -- After 10 posts you'll be able to post links, this is an anti-spam measure, I'm sorry for the inconvenience. Welcome to the forums and thanks for your contribution] Last edited by Carpetsmoker; 26th June 2009 at 06:53 AM. Reason: Make link |
|
|||
I just wish someone had shared an example command line to do an actual checksum confirmation. I spent quite a few minutes working this one out. I think the man page synopsis may be wrong or inaccurate, and it doesn't mention exit status quietly used to confirm check. Also, big files take a small while to check so you can't do too many tests quickly and not sure if it's actually hung or waiting for input. I tried pipeing file into the command as well at one point.
On Mac OS X 10.6 Snow Leopard checking a FreeBSD SHA256 checksum. I've downloaded a 2.1 GB ISO file and the checksums are provided inside a file called CHECKSUM.SHA256 (there's an MD5 list of checksums too). $ grep dvd CHECKSUM.SHA256 SHA256 (FreeBSD-9.0-RELEASE-i386-dvd1.iso) = ebc75ecdbd0580fbe9e59373962e0fc452c4480082af563e5c d765aca1ecd705 $ /usr/bin/shasum -a 256 FreeBSD-9.0-RELEASE-i386-dvd1.iso ebc75ecdbd0580fbe9e59373962e0fc452c4480082af563e5c d765aca1ecd705 FreeBSD-9.0-RELEASE-i386-dvd1.iso $ /usr/bin/shasum -a 256 -c CHECKSUM.SHA256 FreeBSD-9.0-RELEASE-i386-dvd1.iso $ echo $? 0 |
|
|||
Actually, I still haven't got it right. The return status seems to always be 0.
Code:
-rw------- 1 anil staff 2244231168 Mar 10 00:50:38 2012 FreeBSD-9.0-RELEASE-i386-dvd1.iso -rw------- 1 anil staff 2244231166 Mar 10 13:16:46 2012 test.iso $ /usr/bin/shasum -a 256 -c CHECKSUM.SHA256 FreeBSD-9.0-RELEASE-i386-dvd1.iso $ echo $? 0 $ /usr/bin/shasum -a 256 -c CHECKSUM.SHA256 test.iso $ echo $? 0 |
|
|||
Doesn't the man page for shasum mention something similar like the OpenBSD man page cksum(1)?
Code:
EXIT STATUS The cksum and sum utilities exit 0 on success or >0 if an error occurred.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
Thread Tools | |
Display Modes | |
|
|