SimonRH
SimonRH

Reputation: 1469

How to send an email to an MD5 address

I have a database of users that includes an email address that has been encrypted using md5. I want to send an email to one of the users, and want to know if this is possible. In other words, can I send an email using an encrypted field?

Upvotes: 2

Views: 876

Answers (2)

John Bollinger
John Bollinger

Reputation: 180886

can I send an email using an encrypted field?

No, you cannot.

MD5 is a hashing algorithm, not an encryption algorithm. One of the more significant differences is that you cannot recover the original text from the output of a hashing algorithm. Ever. All you can really do is test whether another piece of text generates the same hash, which can be taken as a sign that it is probably the same as the original text from which the hash was computed. This is what password systems do to test user-provided passwords against a database of password hashes.

Bottom line: you cannot extract the needed address from its hash.

Upvotes: 5

user1593881
user1593881

Reputation:

You can not send an email to an encrypted email address using the native PHP mail() function as the to string must comply with the RFC 2822 rules.

Upvotes: 3

Related Questions