sha256h v1.10 initial release

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: sheep, Hacker, Stefan2, white

Post Reply
User avatar
JackFoo
Senior Member
Senior Member
Posts: 373
Joined: 2003-02-05, 19:53 UTC
Location: ERROR

sha256h v1.10 initial release

Post by *JackFoo »

Hi, after some testing and legal queries (cryptography), I'm posting here the initial version. To all those who have websites (Maxwish, Ergo ...) please DO NOT post it there before it has undergone more testing.

readme:

Code: Select all

sha256h v1.10 file digester with HMAC.


Creates/checks sha256 digest from given files.

  sha256 [-h] [-c [cfv file]] [-s string] [-f [file1] [file2] ... [fileN]]
         [-l [list file]] [-o [out file]] [-k key] [-e]
    -h               Prints this screen.
    cfv file         Checks the cfv file.
    string           Creates sha256 hash from the given string and outputs it
                     to screen.
    file1...fileN    Creates sha256 digest from the files.
    list file        Opens the list file and creates sha256 digest from files
                     found within.
    out file         Puts the output in the specified file, default is screen.
    key              If specified, will run an HMAC-SHA digest/check by using
                     the specified key, max length is capped at 512 chars.
    -e               If this switch is specified with -c the output will
                     contain only the incorrect digests.


1. Please note that -l and -f cannot be specified together.
2. -s takes precedence, if it's specified no other option will be parsed.
3. If -c is specified -l or -f will not be parsed.
4. In -f you can also use wildcards eg. *.txt (this is platform specific).
5. Please note that if you used sha256h with [key] (ie. HMAC) you should supply
   the same [key] when checking the digest.

6. If you use HMAC please verify that your [key]'s are up to RFC-2119.

sha256h is completely compliant with FIPS-180-2 and RFC-2104, it was
  thoroughly tested with every available test vector, most can be found on the
  internet, try http://www.itl.nist.gov/fipspubs/. Note that you
  use it of your own accord, the author cannot be held liable for any claim,
  damages or other liability. Note that in some countries using this program
  might be prohibited.
This program is free for PERSONAL usage only.

The author (JackFoo) can be reached at {sha256h@yahoo.com},
  you might even get a reply.
This is the XXE (don't forget to remove trailing spaces):

Code: Select all

begin 644 sha256h.rar
hIa3m6Fc5+1jEQkU+1E++++++++0oubG+Y1++zlQ++++u+++074sOHk4mUWsR
hBEg+6++++5BcMH6pB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R-pXSeOXuksa120wS9Bq4xUFjiaEcTNElSbvahGFThNi0oDHV6k81Bu
h2j0qQteBuTEPlLRbd2nxq81IoR+urgdiz1A6JmLOcOONy2cGvp3P4EdiRuBM
hZrW8v4C7iRtbCZ34ZaMXzGEy3H0Iudr9GbJ2AGUSOo19rMDd9rCvuYjxOaJj
hBQY9mpS7z+39GkSwBD2kzJNLjxfcIaQ0O5TYKXCnWcvv7f1i6RO4w5X4EDm7
hgPPG0dpywTOwsqpmKby-IRkC+yHmmmujex2QBV9yDxEjQEKfgN-TJxiZDcbw
hSgtdqBSit1mGVmOzSifkjfpKV+EXlDkLu0XS8BIlthS0ROWnlFT+QRJV2Tfk
hhXUbyu6jyucBkCm5qvzUtrzmUpm0QkYam-qYKrP6ufmGAL5J6uT6uEFp8cui
hcCfi1eKWrwUXdyXewFpPYx+b2-lRceBTLvcDym+LzED88QegFzMGcPXiDvXz
hEOyjrETdpymUqpyn+sUqqC6iuw3LcrVSggmF7VY3hC0q74o3JEz8oay7kGQE
hZQHY2h0Kd9QZoFwIGWH740dMWkYkGQ7CYzk7-iZH1PBHa9ViLxBh3PiCbqNp
h-Hh4JDFhaR51i4lTHNSuOhVzTUCDapLUS-Gd-daHKbNC8J8CU4rILonduZea
h5HkzpA7CIHk4JF1IvPp1Ad3eMNdX0HlTDwk-Tm6eRiWjD6DytMKzx40eVkn5
hBcbk2Hm2oCZNFKc-seCN5FV9YcuYcanRmPANP+MaR25v0zlxhKJRWW7XF4ne
hEdqM15qpyeZmxl1ykXeMrtAFQkmk4nde8cqsFsIQsNlg1PlnZfGs9HMhzi6F
hV0nRcVnWWdeVIdziU9wvpVexGkozrAuhcqlU2hgYTYdbBHFC1clDTLvcDxzz
6IAExSk-+-k++
+
end
sum -r/size 43670/6218
User avatar
JackFoo
Senior Member
Senior Member
Posts: 373
Joined: 2003-02-05, 19:53 UTC
Location: ERROR

Post by *JackFoo »

Hi, anyone tried it? Any comments? Bugs etc.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 40299
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Looks good so far for hashing files in the same dir. However, the following command gave an empty list:

sha256h.exe -f e:\test1\*.* > e:\test1\test.sha

e:\test1 contained some files. It seems that the hashes are written to STDERR instead of STDOUT in this case.

The following command seems to work though:

sha256h.exe -f e:\test1\*.* -o e:\test1\test.sha
Author of Total Commander
http://www.ghisler.com
User avatar
JackFoo
Senior Member
Senior Member
Posts: 373
Joined: 2003-02-05, 19:53 UTC
Location: ERROR

Post by *JackFoo »

Hmm, I checked it and it works both ways... Could you double check it? I did the same test (different dir) :
sha256h -f c:\Downloads\*.* > c:\Downloads\try.sha
and it worked ok...
I use STDERR only for the errors everything else is redirected to STDOUT or in case of -o some output is redirected there. Either way it should have worked...

Cheers.
Post Reply