Friday, September 10, 2021

Private Communications

 

It's the 21st century and a man and wife cannot have a truly private conversation. A meeting of the “The Young College Republicans" is almost certainly bugged, Libertarians ... Yep. In fact any politically incorrect group is going to probably be bugged. Jewish organizations, Christian organizations are all politically incorrect today. There is no guarantee that your home isn't bugged. Your chat on the internet is probably being logged. If Trump can be bugged, anyone can be bugged!!! The truth of the matter is there is a high probability the NSA or your government's version of the NSA is logged into your home router trying to see what their citizens are up to. In the past they would have had to get a warrant, this is not true today. In the past, any intelligence or policing institution would have to go to a judge and present credible evidence a crime is or has been committed to get a warrant. But in today's world the NSA goes wherever it damned well pleases and the Constitution be damned. Even worse, it is reasonable to assume that Corporate America is also spying on us.


Is it possible to have a private conversation in today's world? Well, you can rule out any conversation over the Internet. TOR Chat is supposed to be pretty good, but I heavily suspect the NSA has a back door into that, but one could setup a private network off the Internet and then turn off all wireless and then have a chat. The problem is that most chat servers and clients keep logs. Note in the table that privacy is not cheap. Also, this does sort of require everyone to be in the same room.


Here is my solution, and it isn't pretty, but it should work.  I realize what I am talking about here can be used to plan and help commit crimes, but that is the price of living in a free society, and I am not willing to give up those freedoms.


One, select your hardware. I have tried using a Raspberry Pi. It was just a model 3B+ and it proved adequate for small groups, I'm not sure how many connections it can handle. I suspect it could handle ten to 15 connections without getting hammered too badly. I have played around with an Orange Pi Zero and it also works, but by the time you pay shipping it is almost as expensive as a Raspberry Pi 3B+ and the Raspberry Pi performs better. You will also need a Raspberry Pi power supply and a Micro SD card. You will also need a CAT cable for each laptop and one for the Raspberry Pi which can be purchased at your local office store or one can get about five for as little as $20 USA on Amazon. You will need a basic network switch, one can be purchased on Amazon for as little as $10 USA.


The cheapest switches have between 4-8 ports, the two-port models are useless for this, since the Raspberry Pi uses a port. One needs at least three ports to do this. If a larger group wants to chat, I have seen used switch models in the range of 18, 24 and 48 port models on Amazon. They run around $50, but some are considerably more expensive.

Hardware Cost


Raspberry Pi 3B+ 35.00
Raspberry Pi PS 6.00
Network Switch 10.00
Micros SD Card 7.00
CAT Cables 20.00


Total 78.00            

 

 

Software: 

We need to install some software. First, I used the following website to install Linux on a Raspberry Pi headless:

https://hackernoon.com/raspberry-pi-headless-install-462ccabd75d0


Next I ssh'd in (From Windows use Putty to sign in) and ran the following commands:

sudo apt-get update

sudo apt-get upgrade (This takes a while) 

sudo apt-get install fpc fpc-source  

sudo apt-get install dnsmasq 

Instead of doing an install of Free Pascal from the repository (2nd line), it is probably better to grab the install files from FreePascal.org. When I tried to install from the repository I did not get all of my source files. 

Add following command to /etc/dnsmasq.conf:  

dhcp-range=192.168.0.0,192.168.0.255,12h

 

In the /etc/network/interfaces file, you need to add the following. This will 
make sure you Raspberry Pi always has an ip address of 192.168.0.200:

iface eth0 inet static
address 192.168.0.200
netmask 255.255.255.0
gateway 192.168.0.1


We need a chat client and server that does not keep a log. Most apps do keep a log even though they may not tell you about it. If a log is kept, your computer could be searched and any log could be discovered. I think a primitive app is the safest solution, even though it is not encrypted. As long as it runs on a private network and not hooked up to the Internet, one should be safe. Warning: wireless should be turned off on all laptops.


I came across such an app written in Free Pascal years ago. It think it was an example program and somewhere in the example programs included with Lazarus. I have a copy of the original source code and it is compile-able with a little effort. There could be similar apps written in c or python. I know it will compile for Linux and Windows. The source code is only about 150 lines in the main app, but it does use some libraries. I have watched “lsof” output for files that are connected with it and have not found anything suspicious. The program just runs in a command prompt with no GUI, so it not going to be too pretty. For highest level of security, once the the Raspberry Pi is set up and the laptops used should not touch the Internet.


I have zipped up the source code into a zip file named chatsrc. You will need to compile lclient.pp and lserver.pp by typing in a command prompt


fpc lclient.pp

fpc lserver.pp


The program lclient.pp will need to be compiled on your Linux or Windows laptops: lserver.pp will need to be compiled on your Raspberry Pi. This may be a little touchy as each version of FreePascal has different numbers and you may have to make some slight adjustments in the source code. Look for something like “{$i /usr/share/fpcsrc/n.n.n” where n.n.n is something like “3.0.4”: this will be be your Free Pascal version number, and it needs to be consistent with your version number on your system. This will be in the files lcommon.pp, levents.pp and lnet.pp multiple times. This will need to be done on the laptop where you are compiling the client and on the Raspberry Pi where you will compile the server.


I will confess I have made a slight modification to lclient.pp, I have altered it so the person sending a message's name is in color (yellow) to make the chat session more readable. I have a 2nd version of lclient out there. That one allows you to send private messages to the different users on the chat. I only have that working for Linux laptops currently. Windows uses the command “ipconfig” to display the computer's IP address while Linux uses “ifconfig”. To get that to work, “ifconfig” in the source code would need to be changed to “ipconfig” and then the search in the for loop would need to be changed to what ever Windows prints to grab the right address.


To start a chat, first ssh into the Raspberry Pi and start the server. You will need to be in the directory where you compiled it.


sudo ./lserver 1000


This will start the server on port 1000


Then on your laptops go to the directory where the lcient program exists, type the following in a command prompt


./lclient 192.168.0.200 1000 MyName


MyName is going to be your chat id. You can have multiple chats going on different ports, by starting lserver with differnt port numbers:

sudo ./lserver 1000 &

sudo ./lserver 1001 &

sudo ./lserver 1002 &

You could use ports 1001 and 1002 as subcommitee chats. If you are using ports 1001 and 1002 for subcommitee chats, the chat clients that need to connecct to said chats would need to adjust the 2nd parm to that port number. Yes it is possible to have more then one lclient running on a single laptop.  To send a private message using v2 of the client, note the ip address of the recipent and type “PM192.168.0.nnn Send me your secret message”

nnn would be their last octet.

Performance:  I had three laptops hooked up and I saw ZERO cpu utilization in Linux's Top commandd for the lserver process and only about .04% memory use.  I tried sending a bunch of fake messages across and still saw zero cpu utilization, so it may be possible to run quite a few chat clients at once.