CST1642 Advanced
Java II
Lab 3 notes Page 2
Here is some information I found
on a web site regarding authentication. We are doing AUTH LOGIN.
Notes •Authentication
Types •Inform the
sever we wish to use AUTH AUTH *** Where the *** is filled in with one of the servers available AUTH methods such as LOGIN. •PLAIN 334 Username: We then send the username in plain text and we receive the next line: 334 Password: We then send the password in plain text and if everything is correct we receive the line: 235 Go Ahead If we sent the wrong user/pass combination we receive: 535 auth failure As you can see the PLAIN method offers no protection from packet sniffers seeing your password. •LOGIN AUTH LOGIN And we receive the line: 334 VXNlcm5hbWU6 Which Username: encoded in base64. We then send the server our username encoded in base64 and we receive the line: 334 UGFzc3dvcmQ6 Whic is Password: encoded in base64. We then send the server our password encoded in base64 and we receive the following line: 235 Go Ahead If we sent a bad combination we receive the line: 535 auth failure As you can see LOGIN only provides a mask of your username and password. However an intelligent person can still view the packets for this and unencode your username and password, or even just reuse it since the encoding never changes. •CRAM-MD5 AUTH CRAM-MD5 We then receive a similar line to the following: 334 PDIzODkxLjEwMTU5ODM0OTNAcGlvbmVlci5ob3N0LXNlcnZlLm5ldApaAj4= If we decode base64 this line it should say: <23891.1015983493@pioneer.host-serve.net> (However my server has a glitch in its CRAM-MD5 authentication and it sends extra characters that mess up the authentication). We then respond with the following line: ZGVtbyBlMDRjMDkyMDA5NzY3MWE3NmM3YzAyMzhkMjU2ZTdjMg== If we base64 decode this line it says: demo e04c0920097671a76c7c0238d256e7c2 We can see that it says demo which is my username and some junk after it. But what is this junk? The junk is the previous server ticket, that funny line that looks like an email address of numbers. Hashed and CRAM-MD5 encoded with my password. The server ticket changes every millisecond so my response never looks the same and the CRAM-MD5 cannot be undone. So how does the server verify me? It does the same process on its end and looks at the two responses, if they match you can enter. Basically your password changes every millisecond and only the server and you know how to create the new password each millisecond. If authentication works we get the following message: 235 Go Ahead If we sent a bad combination we receive the line: 535 auth failure |