You cannot get the original password. Keep in mind that digesting and Base64 encoding do two completely different things. The MD5 collection creates a cryptographic hash of the data provided to it. It is irreversible. Base64 is an encoding mechanism for converting data (which may contain non-printable binary data) into a string that is guaranteed to contain only printable characters. This step is reversible.
The standard way to verify the password is to not decrypt the original password and compare plain text. What you need to do is take the encoding (MD5 hash and then Base64 encoding) that you made on the original password, and apply it to the password just provided. Then compare the saved encoded version with the new encoded version. If they match, then the passwords match.
This design is a safer mechanism than storing passwords that can be decoded. Thus, if someone has stolen your password database, they will not automatically have access to all the passwords of your users. To get into the system, they still have to find a password that is encoded to the same value. A cryptographic hash point, like MD5, should make this very complex. On the other hand, MD5 is no longer considered a very secure hash. You will be better off using SHA1 or SHA256 (but remember that you cannot change existing saved passwords from your MD5 hash to another hash without an original password that you do not have, i.e. you cannot just convert your stored password databases) .
source share