I'm a really newbie, so sorry if the title isn't grammatically correct :p Anyway...
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.
Can I change a files md5 number using a batch file
Ben ShelockBen Shelock
2 Answers
It's not clear at all which are your intents but a MD5 is associated with a set of bytes. You cannot change it without changing the bytes and recalculating it. This operation is one-way in the sense that you have your data, you use it to calc the MD5, you keep MD5 around with your file so that you can check the integrity whenever you need it.
This apporach requires the MD5 to be correct a not to be modified..
JackJack
An MD5 checksum is calculated from the contents of the file. The only way you could change this using a batch file, would be to write a batch file which would modify the file.
If the file is text, you could simply echo some new contents to the end:
If, however, the file is binary, this will lead to corruption.
If your question actually referred to the creation of MD5 checksums, you can obtain FCIV from Microsoft and use this within your batch: http://support.microsoft.com/kb/841290
Martin EveMartin Eve
Not the answer you're looking for? Browse other questions tagged batch-filemd5 or ask your own question.
md5sum
Original author(s)
Ulrich Drepper, Scott Miller, David Madore[1]
Operating system
Unix and Unix-like
Type
Command
License
coreutils: GNU GPL v3
md5sum is a computer program that calculates and verifies 128-bit MD5hashes, as described in RFC 1321. The MD5 hash functions as a compact digital fingerprint of a file. As with all such hashing algorithms, there is theoretically an unlimited number of files that will have any given MD5 hash. However, it is very unlikely that any two non-identical files in the real world will have the same MD5 hash, unless they have been specifically created to have the same hash.[2]
The underlying MD5 algorithm is no longer deemed secure. Thus, while md5sum is well-suited for identifying known files in situations that are not security related, it should not be relied on if there is a chance that files have been purposefully and maliciously tampered. In the latter case, the use of a newer hashing tool such as sha256sum is recommended.
md5sum is used to verify the integrity of files, as virtually any change to a file will cause its MD5 hash to change. Most commonly, md5sum is used to verify that a file has not changed as a result of a faulty file transfer, a disk error or non-malicious meddling. The md5sum program is included in most Unix-likeoperating systems, or compatibility layers such as Cygwin.
The original C code was written by Ulrich Drepper and extracted from a 2001 release of glibc.[3]
1Examples
1.1Create MD5 hash file hash.md5
Examples[edit]
All of the following files are assumed to be in the current directory.
Create MD5 hash file hash.md5[edit]
File produced[edit]
File contains hash and filename pairs.
Note: There must be two spaces or a space and an asterisk between each md5sum value and filename to be compared (the second space indicates text mode, the asterisk binary mode). Otherwise, the following error will result: 'no properly formatted MD5 checksum lines found'. Many programs don't distinguish between the two modes, but some utils do.
Note: The file must be also UNIX line ending formatted otherwise 'md5sum: WARNING: x listed files could not be read' will be seen. 'dos2unix' will convert it quickly if it is DOS/Windows formatted.
Check MD5[edit]
Check single MD5[edit]
See also[edit]
References[edit]
^https://linux.die.net/man/1/md5sum
^'HowToMD5SUM - Community Help Wiki'. help.ubuntu.com. Retrieved 2018-11-02.