Skip to content
Advertisement

How can I generate a correct CRAM-MD5 response in PHP?

I wish to generate a CRAM-MD5 response for an SMTP server.

I can see the theoretical details of how to do so here: CRAM-MD5 Implementation, but I’m looking for the specific PHP code in order to implement it.

How can I implement this in PHP?

Advertisement

Answer

The following PHP code will produce a valid response for CRAM-MD5:

JavaScript

In a telnet session, you can use it like this:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement