lainchan / sec

Storing IRC logs encrypted

Neuromancer · 2020-05-11 07:06
IRC logs are a valuable resource, though due to the nature of IRC they are plaintext. Storing them encrypted would be a safer way to store this valuable source of information. I personally use Hexchat, though any IRC client could work fine for this. Tomb (https://www.dyne.org/software/tomb/) is a nice zsh script that allows you to easily make encrypted storage files (called 'tombs') with the ability to mount directories inside the tomb to a user's home directory. I made a little script to mount my hexchat logs directory from my tomb to my hexchat .config directory. Assume your tomb is `irc.tomb` and your key is `secrets.tomb.key`. #!/bin/bash if tomb open -k ~/secrets.tomb.key ~/irc.tomb; then hexchat tomb slam fi If you're using qubes or have a system with plaintext swap on an encrypted drive you'll need to add f to the flags to make tomb work (this will force tomb to work with plaintext swaps, which could be dangerous on systems with plaintext drives/swaps). In your tomb, you should setup a file named bind-hooks to look something like this, assuming your logs directory is `logs` and your log directory path in your home folder is `.config/hexchat/logs` (this will differ depending on your IRC client). logs .config/hexchat/logs Copy your logs directory over to your tomb and then delete the directory from your client's directory. Then, mkdir the logs directory to have it work with tomb. After all of this, your IRC logs should now be stored in an encrypted file so alphabet soup can't read your chats about buying anime body pillows.
Miho Iwakura · 2020-05-11 07:07
I didn't make this obvious but tomb is simply a wrapper around cryptsetup+LUKS to make it more user friendly for making small encrypted block devices. In absence of tomb you could do the same with cryptsetup.
Chan Siu Ming · 2020-05-17 03:42
>>10892 Thanks Lain I was considering ways to do exactly this only a couple hours ago ^_^
Cereal Killer · 2020-05-19 00:02
Why do I need to encrypt logs from publicly-accessible chatrooms if I already have a full disk encryption? >If you're using qubes or have a system with plaintext swap I don't use qubes and my swap is definitely not plaintext.
Joey · 2020-05-19 00:39
>>10972 Not OP. FDE should be enough, but read this https://en.wikipedia.org/wiki/Disk_encryption#Disk_encryption_vs._filesystem-level_encryption I believe the only way to securely store logs is to transparently encrypt them as they come and only decrypt them explicitly when you want to read them. In other words, encrypt them before you store them. I can't come up with a reason why you would want to encrypt logs from publicly-accessible chats, but someone will surely think of something.
藤原純一 · 2020-05-19 01:00
>>10973 One thing I forgot to mention is that there's probably no difference between FDE and the tomb that is mentioned in this article. If I understand it correctly, it's basically a tool that simplifies the process of creating a transparently encrypted partition. OP suggests you to use this partition to store logs (again, all of this is just an assumption). It is understandable why you wouldn't want to dive deep into FDE. The difficulty of course depends on the system, but I remember that when I did it for the first time (on Arch), I've spent days thinking it through.
SHODAN · 2020-05-22 09:05
>>10973 You linked a paragraph of bureaucratic gobbledygook and expect me to take it seriously? I own a computer, i.e. one where no attacker has access to at "run-time", there is no reason to encrypt anything on the filesystem level when FDE is present.
Splicer · 2020-05-22 10:25
>>11011 I'm not quite sure I understand you. If by 'a computer' you mean a desktop which doesn't provide services and doesn't have to run 24/7 (iow. not a laptop and not a server), then yeah, FDE should be enough, that is literally the first thing I wrote. My point was that a mounted partition is encrypted/decrypted transparently as long as it's mounted. If someone gains access to your computer at "run-time" while the partition is mounted, they get access to everything that is stored on it. Gaining such access on a personal desktop isn't easy and this is the exact reason why I explicitly say that "FDE should be enough". Please, read about the arrest of Dread Pirate Roberts. Long story short, he brought a laptop to the library. The FBI suspected that if he unmounted the partition (which he could've done by simply closing the lid), they would lose access to all his files. To prevent this, they distracted him and eventually grabbed the laptop while it was still running. There are, of course, more ways to secure some particularly sensitive data and FS-level encryption is just the one I happened to come up with. But in the end, it all boils down to explicitly asking for a key/passphrase on decryption (as far as I'm aware) - how exactly you do this is not my concern. If you're talking about just that one case where you use a desktop, you're hiding somewhere in the middle of the desert and you turn your computer off immediately when you see a cop, then yes, FDE is enough. And not just in this one case, but in many of them; in many of them it is enough and in many of them it is not. And if I still misunderstand you, I'm sorry.