Computer Hope

Software => Computer programming => Topic started by: Bgines on January 14, 2014, 03:29:12 PM

Title: Trying To Get MD5 out of a .bat file
Post by: Bgines on January 14, 2014, 03:29:12 PM
I am familiar with the term MD5 in windows and PHP
but I am trying to echo out a MD5 output on a .bat file
so if someone typed VrsSlilser it would outcome as a MD5 Hash
How do I convert it to a MD5 with batch?
Title: Re: Trying To Get MD5 out of a .bat file
Post by: Squashman on January 14, 2014, 04:27:19 PM
As far as I can recall Windows does not have a native MD5 hash utility. You will need to download and use a 3rd party utility.
Title: Re: Trying To Get MD5 out of a .bat file
Post by: Geek-9pm on January 14, 2014, 06:12:57 PM
This topic can be more meaningful is the OP would tell why this is needed. The MD5 hash is not part of the Windows set of tools, as was mentioned.
When data files  transported over a network, there is the danger of error due to noise or poor connections. Some transmissions can   verify by hardware features. In other cases the data itself may have a check built into the data.
Use of MB5 is rather extreme. It requites CPU power and protocol.

Perhaps the OP can tell us why he needs MB5 in a typical scenario.

Title: Re: Trying To Get MD5 out of a .bat file
Post by: Bgines on January 14, 2014, 06:37:08 PM
I need a MD5 Hash or some other thing to stop prying eyes from looking at a file and knowing that the contents are
Title: Re: Trying To Get MD5 out of a .bat file
Post by: Squashman on January 14, 2014, 06:51:44 PM
That is called Encryption. You want PGP.  MD5 is used for file integrity.
Title: Re: Trying To Get MD5 out of a .bat file
Post by: Geek-9pm on January 14, 2014, 07:05:45 PM
OK.
This may have been covered before...
http://www.computerhope.com/forum/index.php/topic,31807.0.html
 Topic: How to hide the contents of batch file

edit: The page does not help much. Try this:
http://www.battoexe.com/
Quote

Quick Batch File Compiler

Quick Batch File Compiler convert your batch files into actual program (.EXE format) in one click. This program may be run on Windows 2000/2003/XP/Vista/7 without any limitations. An .EXE file is much harder to casually reverse-engineer, so this could be a way to conceal a particular batch file's operations from an end user. Content of your batch file will be encrypted and protected from changes.
Quick Batch File Compiler also lets you set various resources in the .EXE file, such as its description, the company name, version information and even the application icon. In additional, you may include any files to compiled exe file and use it during execution.
Title: Re: Trying To Get MD5 out of a .bat file
Post by: Bgines on January 14, 2014, 07:33:39 PM
OK.
This may have been covered before...
http://www.computerhope.com/forum/index.php/topic,31807.0.html
 Topic: How to hide the contents of batch file

edit: The page does not help much. Try this:
http://www.battoexe.com/
No I want to hide other files contents
Title: Re: Trying To Get MD5 out of a .bat file
Post by: Bgines on January 14, 2014, 07:42:46 PM
I NEED THE .BAT To ENCRYPT THE FILE ITS SELF
Title: Re: Trying To Get MD5 out of a .bat file
Post by: Geek-9pm on January 14, 2014, 07:53:23 PM
An EXE file can have lots of features. It can be made for C, C++ or a special tool. With a custom tool, the resulting EXE will  group of files inside a EXE . This might be said to be a kind of  kind of container.

A suitable tool might have these kind of features:

Can compile any batch file to EXE format compatible with Windows or Linux.
"Ghost" mode: application opens no windows and provides no feedback - best way to perform an install or modification silently.
Custom application resources. You can define Icon and Version Info for EXE-file.
Protects contents of a batch file from the non-authorized change
Hides contents of a batch file from viewing. Keep your secrets!
It is not necessary to be the programmer to create the program
It is very useful for installation and automation tasks
The one EXE file does not need run time  or DLL files
Can store additional files required during execution into one EXE file.
You can find these using a Google search.

Title: Re: Trying To Get MD5 out of a .bat file
Post by: Bgines on January 14, 2014, 08:08:29 PM
Here is what a normal non-encrypted file would look like
Code: [Select]
--Begin Data Node--
Zach
Win7
sys32
Adefe758
PERSONAL DATA
PERSONAL DATA
--END Data Node--
I am trying to encrypt that file and make it like or something like that
Code: [Select]
--Begin Data Node--
4874h8fsfe4d
3fv79w4
fdsa84h984
f8734hp0
f80aseduu94978
D454uj9rj9
--END Data Node--
Title: Re: Trying To Get MD5 out of a .bat file
Post by: camerongray on January 14, 2014, 08:27:05 PM
Taking an MD5 hash of a file is not encryption - It's "hashing".  By design it is impossible to take that MD5 hash and turn it back into the file's contents!  What you are looking for is an encryption algorithm.
Title: Re: Trying To Get MD5 out of a .bat file
Post by: Bgines on January 14, 2014, 08:29:00 PM
Taking an MD5 hash of a file is not encryption - It's "hashing".  By design it is impossible to take that MD5 hash and turn it back into the file's contents!  What you are looking for is an encryption algorithm.
OMG YES! BUT CAN I GET THE CODE OR A SOLUTION!!!!
Title: Re: Trying To Get MD5 out of a .bat file
Post by: camerongray on January 14, 2014, 08:35:58 PM
OMG YES! BUT CAN I GET THE CODE OR A SOLUTION!!!!

You need to do research and learn about different encryption systems - It's hardly a case of "Here's a bit code, use it and it will work" - Good encryption is a lot more complicated than that!

As mentioned above, a good starting point would be looking up and reading about "PGP"
Title: Re: Trying To Get MD5 out of a .bat file
Post by: Bgines on January 14, 2014, 08:55:04 PM
You need to do research and learn about different encryption systems - It's hardly a case of "Here's a bit code, use it and it will work" - Good encryption is a lot more complicated than that!

As mentioned above, a good starting point would be looking up and reading about "PGP"
Well Thanks Anyway.  ;D
Title: Re: Trying To Get MD5 out of a .bat file
Post by: BC_Programmer on January 14, 2014, 09:52:29 PM
OMG YES! BUT CAN I GET THE CODE OR A SOLUTION!!!!

What's the pay?
Title: Re: Trying To Get MD5 out of a .bat file
Post by: briandams on January 15, 2014, 06:46:10 AM
this guy just need an md5 tool, why so many opinions on what he should do ?

@TS, go here (https://www.dropbox.com/sh/cja5mvymvinmfco/mHw6J4I1Kd) and download md5sum. that's it.
Title: Re: Trying To Get MD5 out of a .bat file
Post by: camerongray on January 15, 2014, 07:26:42 AM
this guy just need an md5 tool, why so many opinions on what he should do ?

As we just established, while they originally wanted an MD5 tool he was wanting to use it to encrypt a file.  Surely you know that MD5 is a hashing algorithm which is one way (An MD5 hash cannot be converted back to the original message) and that the OP should instead be looking at some sort of encryption algorithm.
Title: Re: Trying To Get MD5 out of a .bat file
Post by: BC_Programmer on January 15, 2014, 07:54:10 AM
this guy just need an md5 tool

Quote
I need a MD5 Hash or some other thing to stop prying eyes from looking at a file and knowing that the contents are
They thought they need(ed) an MD5 tool. But since an MD5 hash isn't going to do any of those, they were likely mistaken.
Title: Re: Trying To Get MD5 out of a .bat file
Post by: briandams on January 15, 2014, 08:12:32 AM
As we just established, while they originally wanted an MD5 tool he was wanting to use it to encrypt a file.  Surely you know that MD5 is a hashing algorithm which is one way (An MD5 hash cannot be converted back to the original message) and that the OP should instead be looking at some sort of encryption algorithm.
and surely you know that he can use hashing functions in an encryption framework to "keep from prying eyes" as well. In this case, "prying eyes" can be those trying to change the integrity. Please, just give him what he wants.
Title: Re: Trying To Get MD5 out of a .bat file
Post by: camerongray on January 15, 2014, 08:32:59 AM
and surely you know that he can use hashing functions in an encryption framework to "keep from prying eyes" as well. In this case, "prying eyes" can be those trying to change the integrity. Please, just give him what he wants.

Read his posts again - He even used the word "encrypt" - He did not mention file integrity.

You really need to watch your attitude - A lot of your posts have the tone of "I am better than you" or "I know I'm right".  You aren't exactly giving a good first impression on this forum!
Title: Re: Trying To Get MD5 out of a .bat file
Post by: Allan on January 15, 2014, 08:37:16 AM
and surely you know that he can use hashing functions in an encryption framework to "keep from prying eyes" as well. In this case, "prying eyes" can be those trying to change the integrity. Please, just give him what he wants.

You have a very confrontational and abrasive manner. You've already received one warning. The next one will result in your posting privileges being revoked. Please try to watch the way you respond and show others the same respect you'd like to receive. Thank you.
Title: Re: Trying To Get MD5 out of a .bat file
Post by: Squashman on January 15, 2014, 09:21:19 AM
if you want a basic text file encryption do a Google search for ROT13.
Title: Re: Trying To Get MD5 out of a .bat file
Post by: BC_Programmer on January 15, 2014, 09:26:46 AM
and surely you know that he can use hashing functions in an encryption framework to "keep from prying eyes" as well. In this case, "prying eyes" can be those trying to change the integrity. Please, just give him what he wants.
None of the content or examples he gave suggest this was the OP's intention.
Title: Re: Trying To Get MD5 out of a .bat file
Post by: briandams on January 15, 2014, 09:32:56 AM
None of the content or examples he gave suggest this was the OP's intention.
errm yes, and aren't all of us assuming what we don't know? maybe he got mixed up about encryption where in fact, he just want hashing? who is right or who is wrong? No one knows. So, why not just give him what he wants.
Title: Re: Trying To Get MD5 out of a .bat file
Post by: camerongray on January 15, 2014, 09:43:57 AM
errm yes, and aren't all of us assuming what we don't know? maybe he got mixed up about encryption where in fact, he just want hashing? who is right or who is wrong? No one knows. So, why not just give him what he wants.

Because from everything that has been said so far, he is asking for encryption - This can be clearly seen from where the OP says that they have a file containing x then "I am trying to encrypt that file and make it like or something like that" with an example of an encrypted file.

By your logic - If someone came here saying "My PC won't turn on, what replacement motherboards can I get?" you would say "Oh, get this Gigabyte GA-..." which is giving the OP what they want.  However, more experienced members would realise that the OP may have just jumped to the conclusion that their motherboard is at fault and would take them through the stages of testing other parts such as the power supply first!

Quite frankly, you have a really bad attitude towards other members on the forum - You are new here and have made a really bad first impression.
Title: Re: Trying To Get MD5 out of a .bat file
Post by: BC_Programmer on January 15, 2014, 09:48:49 AM
errm yes, and aren't all of us assuming what we don't know? maybe he got mixed up about encryption where in fact, he just want hashing? who is right or who is wrong? No one knows. So, why not just give him what he wants.
Reply #9 indicates a desire for encryption, since the intent described in the posts previous to that indicate that they wish to use it "to stop prying eyes from looking at a file and knowing that the contents are". A requirement not met by a hash, since it implies that the data in the resulting file is still the same content but at a glance does not appear to be that content.

Title: Re: Trying To Get MD5 out of a .bat file
Post by: Geek-9pm on January 15, 2014, 10:30:56 AM
Earlier I posted a link to a site that has a free third part Windows program that can hide a set of install files into one EXE file. The documentation indicates it would serve the needs of the OP. However, the OP either did not red the linked page, or else he already has his heart set on some other way to solve his problem.

Dear OP,
Hope you are still with us. The forum is made of volunteers with different backgrounds and skills. The general consensus is the MD5 is only part of a number of methods used to improve security in computer systems.
It has been suggested that you try something that is more completed and self-contained to dove your problem.

Yes, it is possible to write a program in a text editor that will look like nonsense. But it will execute hidden commands when lo pended in DOS. - But  later versions of Windows have blocked off that method for security reasons.

Noways the proper way to begin a sires of actions without the user knowing the details is by using an Installer Program.

Before you conclude that an installer is NOT for you, please look at the link below:
http://en.wikipedia.org/wiki/List_of_installation_software.
Also, the idea is discussed on the Microsoft site. But it may not be for you.
http://www.microsoft.com/en-us/download/details.aspx?id=25

Quote
This white paper describes the patch sequencing functionality in Microsoft® Windows Installer version 3.0. Beginning with the theory of patch sequencing in Windows Installer version 3.0 and finishing with specific sequencing sample techniques for controlling the lifetime of patches through supersedence relationships, this document identifies the concepts of patch migration and compatibility, advanced sequencing scenarios, and integration of sequencing with other features of the Windows Installer.

This document is targeted at installation developers or Setup authors responsible for the design, creation, and management of Windows Installer patches (.msp files). Familiarity with the basic principles of the Windows Installer and Windows Installer patches is assumed. Sample patch metadata tables in this document may be authored by using the Orca tool in the software development kit for Windows Installer version 3.0. Other authoring tools may require different authoring steps or may provide access to a subset of the described functionality.
OK, that is not exactly what you want, but close. The installer does thinbgs with the user NOT knowing the details. Nor can the user change it.

Just trying to help  :D :D

Title: Re: Trying To Get MD5 out of a .bat file
Post by: Squashman on January 15, 2014, 10:41:54 AM
Geek,
Maybe I am misunderstanding the users request but it looks like from POST #9 that he just wants to encrypt a text file.
Title: Re: Trying To Get MD5 out of a .bat file
Post by: Geek-9pm on January 15, 2014, 12:07:50 PM
Geek,
Maybe I am misunderstanding the users request but it looks like from POST #9 that he just wants to encrypt a text file.
Yes, it does. And I said above, that kind of stuff is now considered a security risk and you can't do nit without some  limitation due to security improvements.

I can't post and example here  on the forum, because it violates rules about security.  The old trick was to create a text file with hidden code and then rename it as an executable file. Now that is much harder to do than t it used to be.

The close thing now  is to convert a batch into an EXE and ask the user to open it as an attachment.  Here is an old post.
http://www.computerhope.com/forum/index.php?topic=64597.0

But the OP somehow got the idea you can do it with MB5.

EDIT: Please look at the thread posted above. It is not as easy as one would want. Building an EXE file that will pas AV tests is a n o-go job if it has strange instructions.

Title: Re: Trying To Get MD5 out of a .bat file
Post by: Salmon Trout on January 15, 2014, 12:31:46 PM
7-zip has AES-256 encryption.
Title: Re: Trying To Get MD5 out of a .bat file
Post by: Squashman on January 15, 2014, 12:47:20 PM
7-zip has AES-256 encryption.
Definitely the best option is to use a 3rd party utility.  Either zipping or pgp.

But we actually have a few threads over on the dostips.com site about AES encryption using pure batch.  It is painfully slow but I think the guy just wrote it as a proof of concept.
Title: Re: Trying To Get MD5 out of a .bat file
Post by: briandams on January 15, 2014, 04:38:18 PM
You are new here and have made a really bad first impression.
I might be new here, but i am the only one giving TS what he wants. well i don't need anyone having good impression of me, except for TS. I am here to solve TS problem only, not yours.
Title: Re: Trying To Get MD5 out of a .bat file
Post by: Squashman on January 15, 2014, 05:00:30 PM
I might be new here, but i am the only one giving TS what he wants. well i don't need anyone having good impression of me, except for TS. I am here to solve TS problem only, not yours.
Brian, please read post 9 of this thread and explain how the TS is going to use MD5SUM to encrypt his text file so that nobody can read it and then be able to use md5sum to un-encrypt the file so that it can be readable again. 

Just read the whole first page of this entire thread.  You will see that the TS is confused on what md5sum is versus encryption.
Title: Re: Trying To Get MD5 out of a .bat file
Post by: camerongray on January 15, 2014, 05:37:31 PM
I might be new here, but i am the only one giving TS what he wants. well i don't need anyone having good impression of me, except for TS. I am here to solve TS problem only, not yours.

Few things you need to learn when you are on this forum:

Title: Re: Trying To Get MD5 out of a .bat file
Post by: Allan on January 16, 2014, 05:48:19 AM
EVERYONE in this thread - please stop addressing each other. Just address the question asked by the OP. Thank you.