Page 1 of 1

SHA256 Hash in batch

Posted: 20 Oct 2016 11:26
by SirJosh3917
I was wondering, does anybody have a batch file that can hash a string in one of the existing hash methods like SHA256, SHA1, or MD5?
I want to make a user login system and I want to hash the password.

Re: SHA256 Hash in batch

Posted: 20 Oct 2016 11:43
by Squashman
Did you search the forums?
This question was just asked again, recently on the forums.
viewtopic.php?t=7428

Re: SHA256 Hash in batch

Posted: 20 Oct 2016 12:22
by SirJosh3917
Squashman wrote:Did you search the forums?
This question was just asked again, recently on the forums.
viewtopic.php?t=7428

You gave me a link to a batch file that uses certutil to do a SHA512 hash on a string.
Certutil isn't availible on all computers however, which is what I'm afraid of.

If this is the only way, I guess I'm forced to do it, but I'd like to have a batch file to hash using SHA256.
Since hashing algorithms are complex and batch isn't a good enough language in the terms of modern-day programming language capabilities, if you had to end up using a C++98 or C++3 or C++11 program code and use a batch file to use the c++ file, that'd be ok, but if a batch file could hash with SHA256 that'd be amazing.

Re: SHA256 Hash in batch

Posted: 20 Oct 2016 12:26
by Squashman
SirJosh3917 wrote:You gave me a link to a batch file that uses certutil to do a SHA512 hash on a string.

You didn't read all the links in that thread.

Re: SHA256 Hash in batch

Posted: 20 Oct 2016 12:35
by SirJosh3917
Squashman wrote:
SirJosh3917 wrote:You gave me a link to a batch file that uses certutil to do a SHA512 hash on a string.

You didn't read all the links in that thread.

Ok sorry.
The MD5 hash tool seems to be what I need, but I forgot, is the MD5 hash "de-hashable"? Or do you "dehash" it by brute forceing?

Re: SHA256 Hash in batch

Posted: 20 Oct 2016 16:26
by ShadowThief
SirJosh3917 wrote:
Squashman wrote:Did you search the forums?
This question was just asked again, recently on the forums.
viewtopic.php?t=7428

You gave me a link to a batch file that uses certutil to do a SHA512 hash on a string.
Certutil isn't availible on all computers however, which is what I'm afraid of.

If this is the only way, I guess I'm forced to do it, but I'd like to have a batch file to hash using SHA256.
Since hashing algorithms are complex and batch isn't a good enough language in the terms of modern-day programming language capabilities, if you had to end up using a C++98 or C++3 or C++11 program code and use a batch file to use the c++ file, that'd be ok, but if a batch file could hash with SHA256 that'd be amazing.

So change 512 to 256. The only reason I didn't use 256 in my code is because I found out that certutil can do 512.