53 lines
2.5 KiB
Plaintext
53 lines
2.5 KiB
Plaintext
sha version 1.0.4 (2003-Jul-25)
|
|
===============================
|
|
Copyright (c) 2001-2003 Allan Saddi <allan@saddi.com>
|
|
All rights reserved.
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
modification, are permitted provided that the following conditions
|
|
are met:
|
|
1. Redistributions of source code must retain the above copyright
|
|
notice, this list of conditions and the following disclaimer.
|
|
2. Redistributions in binary form must reproduce the above copyright
|
|
notice, this list of conditions and the following disclaimer in the
|
|
documentation and/or other materials provided with the distribution.
|
|
|
|
THIS SOFTWARE IS PROVIDED BY ALLAN SADDI AND HIS CONTRIBUTORS ``AS IS''
|
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
ARE DISCLAIMED. IN NO EVENT SHALL ALLAN SADDI OR HIS CONTRIBUTORS BE
|
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
Introduction
|
|
------------
|
|
sha is a simple program that hashes files. It uses the National
|
|
Institute of Standards and Technology's Secure Hash Algorithm.
|
|
It can use SHA-1, SHA-256, SHA-384, or SHA-512, which generate
|
|
respectively, hashes of 160, 256, 384, or 512 bits. sha can be
|
|
used in scripts to do, for example, file integrity checking.
|
|
|
|
Using sha is simple. Just pass the names of one or more files on
|
|
the command line. By default, sha will use SHA-1 unless passed
|
|
one of the following flags: -2 for SHA-256, -3 for SHA-384 or
|
|
-5 for SHA-512. Type "sha -h" for help.
|
|
|
|
You may want to perform a sanity check on sha before relying on it. A
|
|
program called "shatest" is built along with sha (but not installed).
|
|
If you run shatest, it will display the results of running the various
|
|
SHA algorithms on a set of known test vectors. If the resultant hash
|
|
matches what is expected, "PASS" will be displayed. Otherwise it will
|
|
display "FAIL."
|
|
|
|
Also, feel free to use my SHA implementations in your own projects.
|
|
They are fast and relatively portable. Please see the top of each
|
|
source file for copyright and warranty information. See README.SHA
|
|
for technical notes.
|
|
|
|
- Allan Saddi <allan@saddi.com>
|