MD5
The MD5 Message-Digest Algorithm is a widely used cryptographic hash function that produces a 128-bit (16-byte) hash value. Specified in RFC 1321, MD5 has been employed in a wide variety of security applications, and is also commonly used to check data integrity.
Based on http://www.zedwood.com/article/121/cpp-m
In http://www.knowledgesutra.com/discuss/tm
This means that, despite the encryption being one way only, brute force attacks (although original data hash may colide with other hash) or dictionary attacks (attacks based on common known words, like http://www.md5decrypter.com/) can find the original data. Based on brute force attacks and the code above, I've created a program that calculates hashes exhaustively, and compares to the given hash; if it matches, the word responsible for that hash is shown. It starts with words of length 1, and increases this length on the go, until it finds one correct answer: decryptMD5.cpp. Any combination of characters can be used.
Example of usage:
Compile:
g++ -g -Wall -o generateHashMD5 generateHashMD5.cpp md5.cpp
g++ -g -Wall -o decryptMD5 decryptMD5.cpp md5.cpp
./generateHashMD5
Word to encrypt: ~~~~
md5 of '~~~~': ed790e134796eb704dd092dde146a792
./decryptMD5 ed790e134796eb704dd092dde146a792
WORD FOUND: ~~~~