Secure chat in IRC, how to choose the SSL port in irssi

Anyone who likes the command line and shell will love the irssi IRC chat client, it can also work as an administration tool for IRC operators and the software, although originally only available for Linux and BSD, has been ported to Windows.

Good quality IRC networks will offer you secure SSL chat but you will need to specify the port for this, the most common ports in IRC  for secure (SSL) connections are  6697/9999, however it will depend on the network, the usual port for plain IRC chat without SSL is 6667, or something in between 6660/6670.

To choose your preferred port in irssi (Rizon network):

/server irc.rizon.net -p 6667

This example uses the Rizon IRC network , a well known IRC network with many chatrooms of Japanese hentai, manga, anime, lolicon, furry, etc.

 

irssi SSL IRC chat
irssi SSL IRC chat

Anyone can write plugins and additional features for open source software, and irssi has dozens of useful scripts available.

Useful irssi scripts

autowhois.pl /WHOIS all the users who send you a private message.
blowjob.pl Encrypt IRC communication with blowfish encryption
topics.pl Records a topic history and locks the channel topic
nickserv.pl This script will authorize you into NickServ
fserve.pl File server for irssi
cron.pl Cron implementation, allows to execute commands at given interval/time
clones.pl /CLONES – Display clones in the active channel (with added options)
binary.pl Encodes and decodes into binary what you and others type in the channel
anotherway.pl Another auto away script

To download those scripts and many more visit: http://scripts.irssi.org/

How to encrypt your data using OpenSSL

For those of you comfortable with the command line, there is an alternative way to password a file using the free utility OpenSSL, for example if you wanted to password protect a .tar archive with documents documents called unencrypted-data.tar

From the command line, type:

$ openssl des3 -salt -in unencrypted-data.tar -out encrypted-data.tar.des3
enter des-ede3-cbc encryption password:
Verifying – enter des-ede3-cbc encryption password:

That command will encrypt the unencrypted-data.tar file with the password of your choice and output the result to encrypted-data.tar.des3, to unlock the encrypted file, use the following command:

$ openssl des3 -d -salt -in encrypted-data.tar.des3 -out unencrypted-data.tar
enter des-ede3-cbc encryption password:

You can also use OpenSSL commands to verify a digital certificate, encrypt a S/MIME message, connect to a secure SMTP server, and much more!  The page below contains lots of command line examples on how to do that.

OpenSSL Command-Line HOWTO

Stop your Unix/Linux shell from saving typed in commands

When working using bash, zsh, ksh (korn shell) or any other Unix shell the default is to save the history of the command lines typed in, this can become a security and privacy risk if someone else has access to your computer.

How to erase Unix shell history file

You can do this as long as you have administrator rights, I am using the bash shell as example, depending on what shell you are using the path and instructions might differ a little.

# kill -9 $$

$$ gives the pid of the current shell instance, and the kill ends the process.

You could also use the history command, see man history:

# history -c (clear the history)
# history -w (write to the file – overwrite!)

Delete the bash history file, find out where your shell saves the history of typed in commands and delete it the same way. You may also use the shred command to overwrite it safely.

# rm -rf ~/.bash_history

But even if you delete the ~/.bash_history file, your current bash session will still be written to history once you log out, this is because it is being stored in RAM, you will need to use the previous history -c command to avoid this.

Stop the shell saving typed commands

Examples based on the bash shell configuration files:

Turn off bash history for all users, append unset HISTFILE to /etc/profile

# echo “unset HISTFILE” >> /etc/profile

Set size of the history to zero:

HISTSIZE: The number of commands to remember in the command history. The default value in bash is 500, You can set this to 0 and disable the usage of the history file.

Introduce the following command in your personal bash configuration file ~/.bashrc (~/.zshrc for the zsh shell users) or in the global bash configuration file /etc/bash.bashrc

export HISTSIZE=0

You will need to restart your bash session in order to activate the settings, you can check if your configuration were entered correctly by going at the command prompt and typing:

env

If you don’t see your configuration in the environment variables than you have done something wrong.

The name of the configuration files can depend from your Linux distribution and bash version, you can always see your particular options using man bash.

Configuration files path Unix shell
Configuration files path Unix shell

Unix shell configuration table files explained:

  • Blank means a file is not read by a shell at all
  • yes” means a file is always read by a shell upon startup
  • login” means a file is read if the shell is a login shell
  • n/login” means a file is read if the shell is not a login shell
  • int.” means a file is read if the shell is interactive
  • i.login” means a file is read if the shell is an interactive login shell

To find out what shell you are using type: echo $SHELL

To change your shell see chsh –help