Adding SHA256 verifier to TC

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

noen,
Does chsum understands filenames in double quotes? E.g.

Code: Select all

MD5("file1.txt") = ...
SHA256("my first movie.avi") = ...
If so it would be much more clever way to detect filename ending than to trace end of line in order to find last brace. Also text editor with string highlighting would be useful way to read such files.


BTW just now I tried cksum command under FreeBSD 8.0 on my old VM and I must say that it uses another output format:

Code: Select all

4294967295 0 1.txt
3576261603 512 PAM
3940192329 512 Stuff
462915865 41647017 boost_1_43_0.tar.gz
3055188612 512 gdm
So I don't think that format provided by you is widely used for years in many systems.
User avatar
noen
Junior Member
Junior Member
Posts: 25
Joined: 2006-03-30, 11:11 UTC

Post by *noen »

You still do not catch... (:
Any name means any name!

You do not have to trace last brace.
Think for a while and create algorithm like this:
0/ enumerate known checksum signatures for further usage
1/ check first n character for match known signature (md5, sha256 etc)
2/ when you know what siganture is used you can compute length of the checksum
3/ truncate first n characters where n is equal to signature length +2 (for space and opening brace)
4/ truncate last m characters where m is equal to length of checksum + 4 (for two spaces, brace and equal sign)
...and there you have filename.
Any filename with braces, quotes, equalsigns, quotation marks etc...

The simpler, the better (:
Some say: keep it simple stupid...
...there would be no room for errors. (:

Nothing else you need to do,
unles you want/need to detect end of line style of file (unix, windows, mac).

About cksum in FreeBSD - try to check for other parameters which can change output.
Notice that FreeBSD is not as precise writing manuals as OpenBSD is.
There may be separate tool to compute new checksums and cksum can be used for compatibility only.
In OpenBSD there is also sum, sha1, md5, etc. as separate tools but their functionality was also build in cksum.
Try them (md5, sha1, sha256) in FreeBSD to see what is the format... (:

I wrote that cksum is/was used for years.
Format which i point out is now increasing...
Last edited by noen on 2011-05-05, 15:13 UTC, edited 1 time in total.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50873
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

MD5 (file1) = 01234...
SHA1 (file2) = 01234...
SHA256 (file3) = 01234...
OK, I will try to add these 3 to the next version.
Author of Total Commander
https://www.ghisler.com
User avatar
noen
Junior Member
Junior Member
Posts: 25
Joined: 2006-03-30, 11:11 UTC

Post by *noen »

ghisler(Author) wrote:
MD5 (file1) = 01234...
SHA1 (file2) = 01234...
SHA256 (file3) = 01234...
OK, I will try to add these 3 to the next version.
That is a great news!
Thank you for adding this sugestion to implementation in TC (:
User avatar
noen
Junior Member
Junior Member
Posts: 25
Joined: 2006-03-30, 11:11 UTC

verifier window summary

Post by *noen »

One more thing...

Please, make hash verification summary message more legible.
Putting all in the same line is confusig and harder to read.
Most wanted information (Errors and OK) should be at the end (especially when you can change TC fonts).
Please consider putting the sum in separate lines.

current version:

Code: Select all

OK:   File1.txt
OK:   File2.txt
OK:   File3.txt

Errors: 0
OK: 3, not found: 0, read error: 0, wrong checksum: 0
please consider changing for example to this:

Code: Select all

OK:   File1.txt
OK:   File2.txt
OK:   File3.txt
---
     not found: 0
    read error: 0
wrong checksum: 0
---
Errors: 0
    OK: 3
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Re: verifier window summary

Post by *ts4242 »

noen wrote:Putting all in the same line is confusig and harder to read.
I support your request.

For now you can make it more readable by using an external language file and edit the string number 1464 to looks like

Code: Select all

1464="OK: %i                not found: %i                read error: %i                wrong checksum: %i"
User avatar
noen
Junior Member
Junior Member
Posts: 25
Joined: 2006-03-30, 11:11 UTC

Post by *noen »

Sorry, but this is only half-measure solution.
It does not change line order and do not imporve much ):
(additional spaces do not break line and do not change line order)
(Author of TC changing checksum verifier could also easly change line order)
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3381
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

@Chris:
If you add noen's way of displaying the output please make it OPTIONAL as i like the way it is right now. TIA
Hoecker sie sind raus!
User avatar
noen
Junior Member
Junior Member
Posts: 25
Joined: 2006-03-30, 11:11 UTC

Post by *noen »

Please let me know... are the power members involved in implementing TC (not only Author of TC)?

If this is true and ts4242's message means that he will be implementing this change... then I have to thank you ts4242. That is a great news.
I am looking forward to new TC version with all the changes implemented (as optional or not).
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

noen wrote:Please let me know... are the power members involved in implementing TC (not only Author of TC)?
No, power members are not involved in implementing TC because TC is not open source.

noen wrote:If this is true and ts4242's message means that he will be implementing this change...
Usually when a user likes a suggestion from another user, he say "Support" in hope to encourage TC author to implement it if there are many supporters for that suggestion.
User avatar
noen
Junior Member
Junior Member
Posts: 25
Joined: 2006-03-30, 11:11 UTC

Post by *noen »

Thanks for explanation (:
Now i have to withdraw my thanks (:
...but it is good to hear you agree (support) with this sugestion.
I hope Author of TC take it into consideration.
User avatar
white
Power Member
Power Member
Posts: 5988
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

ghisler(Author) wrote:SHA256 is already supported, but the format you describe is quite unusual. TC expects files like this:

e5c7e41f033f42cc20c745aa4ebc8bef4f86845e68b75449146b0c5f4a5a37ef *cd49.iso
or
e5c7e41f033f42cc20c745aa4ebc8bef4f86845e68b75449146b0c5f4a5a37ef cd49.iso
or
cd49.iso e5c7e41f033f42cc20c745aa4ebc8bef4f86845e68b75449146b0c5f4a5a37ef
The last format doesn't seem to work. Is that correct?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50873
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

You are right, the name must be behind the checksum.
Author of Total Commander
https://www.ghisler.com
vudu
Junior Member
Junior Member
Posts: 27
Joined: 2011-12-04, 19:52 UTC

Post by *vudu »

Any chance of adding SHA256 calculation (since totalcmd already supports verification) beside CRC32, MD5 and SHA-1 into version 8.50?

No matter in which format, this from *BSD or one Total Commander already supports (hash, asterisk, filename).
Personal licence #263866
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50873
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The calculation wouldn't be difficult, but I would need to create a new dialog box because the used standard dialog only supports 3 checkboxes.
Author of Total Commander
https://www.ghisler.com
Post Reply