For how want to use Odin to flash the ClockWorkMod Recovery img or any image files like 'boot.img', this is a tool to create a tar.md5 file from the img file. Unzip the file tool, and put your img files into the same directory of the batch file. You can not change md5sum of a file as long as the contents of the files are same. And that is the sole purpose of it. You can change the md5sum value of a file by making any change in its content only. But I found a tool(on window) and it can change MD5 of a file.
Why do sites offer an MD5 hash of a file? How does that help you verify the integrity/source of the file? Wouldn't paying attention to your URL be enough security?
WebnetWebnet
migrated from stackoverflow.comOct 21 '10 at 1:17
This question came from our site for professional and enthusiast programmers.
7 Answers
It helps to verify that once you are done downloading the file, that you have the same file that is sitting on their server.
After running your local file through a hash function, if the slightest difference is found between your copy and theirs, it will result in you getting a different hash than what they have posted.
barfoonbarfoon
An MD5 hash doesn't protect you if the site gets hacked because the MD5 sum an be changed as well by the hacker. A GPG signature (in a separate file) would protect against this if you have a copy of the public key that you've gotten from somewhere else, or verified that it's the correct key by checking the signatures on the key.
What an MD5 hash is good for is making sure the file didn't get corrupted in the download process. TCP checksums don't all of the errors that could occur while your file is in transit (though those errors are rare), and I have seen an ISO image get corrupted during the download process before.
Ken BloomKen Bloom
Security is one (important) thing, but I think it is also to make sure you downloaded the file in its entirety.
GôTôGôTô
Well in theory both files should produce the same hash if they are exactly the same (though collisions do occur).
You can provide it easily with a server side language, such as ol' trusty PHP...
alexalex
It offers a defence against a possible man-in-the-middle attack. Suppose a malicious party had somehow been able to hijack the request for the file, but had not been able to alter the text of the web page itself. The MITM would be able to get you to download a different sequence of bytes, but would not be able to make the hash of his file match the hash quoted on the qweb page, that of the real file.
AakashMAakashM
There are several reasons:
- a Man-in-the-Middle attack could possible alter your download and inject a virus or trojan or other malicious code in the download
- It's also possible that some corruption occurred in the bitstream while downloading and the downloaded file might be broken.
- There might be a proxy server involved which might cutoff the connection early.
- Some older browser couldn't download files bigger than 2GB, so downloading bigger files would also mean a corrupted download.
- It also allows a user to check if the 'same' file on a mirror server is really the same file and not an altered version.
OthersideOtherside
Sometimes, files transferred may be corrupt, either intentionally by an attacker or due to a faulty connection.
Cryptographic hash functions (such as MD5) are designed to change if there's a change in the original file. As such, you can detect such alterations.
Note that, if you want protection against intentional modification (made by an attacker), you need a way to verify that the reference hash you obtained is correct and from a trusted source (e.g. signature via PGP or X.509 certificates for example). You may also need a better hash algorithm (e.g. SHA-1, SHA-256), as collisions attacks have been demonstrated against MD5.
BrunoBruno
Not the answer you're looking for? Browse other questions tagged securitymd5 or ask your own question.
--> Computes the hash value for a file by using a specified hash algorithm.
Syntax
Description
The Get-FileHash cmdlet computes the hash value for a file by using a specified hash algorithm.A hash value is a unique value that corresponds to the content of the file.Rather than identifying the contents of a file by its file name, extension, or other designation, a hash assigns a unique value to the contents of a file.File names and extensions can be changed without altering the content of the file, and without changing the hash value.Similarly, the file's content can be changed without changing the name or extension.However, changing even a single character in the contents of a file changes the hash value of the file.
![Check Check](/uploads/1/2/3/7/123749731/849156535.png)
The purpose of hash values is to provide a cryptographically-secure way to verify that the contents of a file have not been changed.While some hash algorithms, including MD5 and SHA1, are no longer considered secure against attack, the goal of a secure hash algorithm is to render it impossible to change the contents of a file-either by accident, or by malicious or unauthorized attempt-and maintain the same hash value.You can also use hash values to determine if two different files have exactly the same content.If the hash values of two files are identical, the contents of the files are also identical.
By default, the Get-FileHash cmdlet uses the SHA256 algorithm, although any hash algorithm that is supported by the target operating system can be used.
Examples
Example 1: Compute the hash value for a PowerShell.exe file
This command uses the Get-FileHash cmdlet to compute the hash value for the Powershell.exe file.The hash algorithm used is the default, SHA256.The output is piped to the Format-List cmdlet to format the output as a list.
Example 2: Compute the hash value for an ISO file
This command uses the Get-FileHash cmdlet and the SHA384 algorithm to compute the hash value for an ISO file that an administrator has downloaded from the Internet.The output is piped to the Format-List cmdlet to format the output as a list.
Example 3: Compute the hash value of a stream and compare the procedure with getting the hash from the file directly
Parameters
Specifies the cryptographic hash function to use for computing the hash value of the contents of the specified file.A cryptographic hash function includes the property that it is not possible to find two distinct inputs that generate the same hash values.Hash functions are commonly used with digital signatures and for data integrity.The acceptable values for this parameter are:
- SHA1
- SHA256
- SHA384
- SHA512
- MD5
If no value is specified, or if the parameter is omitted, the default value is SHA256.
For security reasons, MD5 and SHA1, which are no longer considered secure, should only be used for simple change validation, and should not be used to generate hash values for files that require protection from attack or tampering.
Type: | String |
Accepted values: | SHA1, SHA256, SHA384, SHA512, MD5 |
Position: | 1 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the input stream.
Type: | Stream |
Position: | 0 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the path to a file.Unlike the Path parameter, the value of the LiteralPath parameter is used exactly as it is typed.No characters are interpreted as wildcard characters.If the path includes escape characters, enclose the path in single quotation marks.Single quotation marks instruct PowerShell not to interpret characters as escape sequences.
Type: | String[] |
Aliases: | PSPath |
Position: | 0 |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Specifies the path to one or more files as an array.Wildcard characters are permitted.
Type: | String[] |
Position: | 0 |
Default value: | None |
Accept pipeline input: | True (ByPropertyName, ByValue) |
Accept wildcard characters: | False |
Inputs
System.String
You can pipe a string to the Get-FileHash cmdlet that contains a path to one or more files.
Outputs
Microsoft.Powershell.Utility.FileHash
Get-FileHash returns an object that represents the path to the specified file, the value of the computed hash, and the algorithm used to compute the hash.