Patrick’s development blog

Encrypt chat conversations in Pidgin using pidgin-otr

Posted in Articles, Security by Patrick on March 17, 2009

Pidgin is an excellent “chat client” or instant messaging client. I’ve even replaced the MSN client on my Windows system with Pidgin. It’s open source and has support for many different chat networks like MSN, ICQ…

There’s a plugin called pidgin-otr (Off-the-Record messaging) which allows you to encrypt your conversations (assuming the other part also has pidgin-otr installed). Regretfully, people never seems to care about encryption even if they seem to get close to crazy if someone invades their privacy, quite the paradox… Well that’s just another story which i’m not going to post here, as i’m just spreading the word about everything that’s good : )

The Off-the-Record messaging plugin uses public and private keys. It’s very easy to use. Just download the plugin, activate it in the Pidgin add-on menu and generate a key. In the conversation window, a button will appear that makes it easy to toggle encryption on/off.

Download Pidgin from: http://www.pidgin.im/download/
Download Pidgin-otr from: http://www.cypherpunks.ca/otr/index.php#downloads

Advertisements

Sending mail via SMTP in Python

Posted in Python by Patrick on June 22, 2008

SMTP (Simple Mail Transfer Protocol) is the most common protocol for sending mail. The communication in SMTP is done using TCP.
Read more about the SMTP protocol here: RFC821

Here’s an example of a simple Python program that sends a mail.

Send mail in Python using SMTP

import smtplib

addr_from = “from@mail.domain”
addr_to = “to@mail.domain”

server=smtplib.SMTP(‘smtp.server.domain’)
server.set_debuglevel(1)

msg = (“From: %s\r\nTo: %s\r\n\r\n”
% (addr_from, “, “.join(addr_to)))

msg = msg + “This is the message”

server.sendmail(addr_from, addr_to, msg)

server.quit()

‘smtp.server.domain’ specifies the SMTP server the program is going to use. You can experiment with different free SMTP servers until you find something that works. Personally, I use my ISP SMTP server.

smtplib is the module I used in order to use SMTP in Python. Information about smtplib can be found in the official Python documentation here.