22 dezembro, 2008

 

SMTP plain-text authentication

SMTP plain-text authentication is still used amongst ISPs.
The basic idea is someone who wants to send a message via SMTP, needs to be authenticated first.
Username and password are encoded (typically via Base64).

liblowstream has capabilities to encrypt / decrypt to simetric encodings, such as:
Let's focus on SMTP authentication now:
These two, in sequence, form the object to be encoded to plain Base64, to what we call below userpassencd.
The SMTP starts then with authentication, as follow:
AUTH PLAIN userpassencd

For instance, supose your username and password are:
The "object to be encoded" is [00]user1@com.xy[00]yourPasswd
(each [00] is actually ASCII-0d).

The plain-text authentication to send is then marked bold:
test_blowstream a E example.bin
Input had 24 bytes, output has: 32 (convertCode=0)
AHVzZXIxQGNvbS54eQB5b3VyUGFzc3dk
If you use the liblowstream library, all you have to do is underlined on the piece of C++ code on the right.

This page is powered by Blogger. Isn't yours?