Sorry guys and girls,
This time it is a tip for OpenBSD.
$ cksum -a sha512 /etc/passwd
SHA512 (/etc/passwd) =
b4d6a742cada5305686832f1037b60f79b56fe6dfdf9904e6070295e74
c2341535db26b731e27e04a73f0cb70bb589d31b8e9e18e207a8aae5aa81d06ea29f5a
prints a very long checksum. This is also known as message digest or
cryptographic hash in
crypto parlance.
In fact the RSA algorithm is based on this message digest algorithm
but I don't think many people
recognize this fact.
RSA is basically an implementation of this concept a^b^c = a ^c^b =
a^bc with modulo N thrown in.
But the math will crumble down without relying on the cryptographic
hash mechanism.
Think of fingerprinting or signature.
Now talking of signatures, PKI signatures also rely on message digests
but that is a detail.
IOW cksum(1) tells you whether a file has changed or not. For instance
corrupted downloads and uploads
can easily be detected by this utility.
Here are the algorithms you can specify with the -a switch.
cksum
md4
md5
rmd160
sha1
sha256
sha384
sha512
sum
sysvsum
Of course you have sha1sum(1) and md5sum(1) in linux.
You have cksum too but it does not seem to have these algorithms built into it.
-Girish
--
Gayatri Hitech
web: http://gayatri-hitech.com
SpamCheetah Spam filter:
http://spam-cheetah.com