Someone seems to misunderstand something. MD5 is NOT encryption. MD5 is a hash. Meaning, if you MD5 the string 'test', you get another string from this. With the new string, there is NO WAY whatsoever you can get the text 'test' back. The only way to find the contents of a md5ed string, is to "bruteforce", that is, systematically md5 strings, and wait for the same finished result.
Two different strings may produce the same MD5 hash ("encrypted" string), but these two strings will not have the slightest bit of simularity. One could be 'test', the other could be a 2MB binary file. However, 'test' and any other 4-char string will produce very different result.
The usage of MD5 is primarily for integrity check. If MD5 a file and ship your md5 sum with the file, others can md5 the file to determine if it has changed. It is also very often used in relation to passwords. The procedure is then to have the user input a password, and store the md5 hash of it. To validate if the user types correct password at a later time, md5 what he types and then compare the hashes.
I sincerely doubt that md5 has any relevant 'flaws'.
The best way to encrypt something, if you need to be able to decrypt it, is probably to use PGP. If you don't need public/private keys etc, just a single encryption routine, you could use the un*x crypt library, or implement a stand-alone routine such as rijandel, blowfish, DES or similar.