SHA256 Hash in batch

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
SirJosh3917
Posts: 36
Joined: 02 May 2016 18:59

SHA256 Hash in batch

#1 Post by SirJosh3917 » 20 Oct 2016 11:26

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.

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: SHA256 Hash in batch

#2 Post by Squashman » 20 Oct 2016 11:43

Did you search the forums?
This question was just asked again, recently on the forums.
viewtopic.php?t=7428

SirJosh3917
Posts: 36
Joined: 02 May 2016 18:59

Re: SHA256 Hash in batch

#3 Post by SirJosh3917 » 20 Oct 2016 12:22

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.

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: SHA256 Hash in batch

#4 Post by Squashman » 20 Oct 2016 12:26

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.

SirJosh3917
Posts: 36
Joined: 02 May 2016 18:59

Re: SHA256 Hash in batch

#5 Post by SirJosh3917 » 20 Oct 2016 12:35

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?

ShadowThief
Expert
Posts: 1160
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: SHA256 Hash in batch

#6 Post by ShadowThief » 20 Oct 2016 16:26

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.

Post Reply