Chapter 13. The IRC Protocol

Introduction: Hacks #78-85

IRC protocol to get the most out of your bot hacking. The protocol imposes restrictions on the lengths of your messages—if you don’t know about this, you may make a bot that sends too much data in one go and run the risk of truncating your valuable messages.

To ascertain the authenticity of who you claim to be, a lot of IRC servers try to contact your machine and ask it who you are. The Ident Protocol is used to handle this request, but Windows machines do not run an Ident server. Most Windows IRC clients therefore create their own temporary Ident server that runs while the client is connecting to an IRC server. In case you need to add such a feature to one of your bots, one of the hacks shows you how to create your own disposable Ident server.

In Chapter 4, you were shown how to add color and formatting to your IRC messages. When parsing these messages within the brain of an IRC bot, the extra formatting characters may cause problems. This chapter shows you how to remove colors and formatting from IRC messages, thus alleviating the problem.

The IRC protocol is text based, so the only way you can ensure total privacy is to encrypt your messages before they leave your IRC client and decrypt them when another client receives them. One hack shows you how to create a proof-of-concept bot that encrypts messages using a shared pass phrase or key. Only people who know the key will be able to decrypt the messages.

Netsplits occur frequently ...

Get IRC Hacks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.