In the next article we are going to take a look at a command line application called Magic Wormhole. This is an application based on "CLI" with which we will be able to securely send text, files and even folders (which will be automatically compressed) to practically anyone from our terminal.
Today it is public knowledge that if you want to get most of the things quickly and safely, it is advisable to use the command line. The application that concerns us is quick and easy to use. There is no need to worry about the knowledge required to use terminal programs. Its use is extremely minimalist and does not require prior knowledge about protocols or anything like that.
The logic of the application is reduced to knowing which file we want to send and executing the only command to proceed with its sending. There is no limit when shipping. Documents can be sent individually or compressed files.
Let's imagine a very likely scenario. We want to send a file to a friend, who is thousands of miles away connected to the internet with his computer. The solution to this possible case is as simple as, start a new window of terminal, open a Wormhole and after entering a couple of words, press Enter and wait for the other party.
Your friend on the other end will launch their terminal, open a Wormhole as well, and enter a code to authenticate your access to files. Once you have entered the code, you will only have to wait for the download to your computer to finish.
It is true that in the case of files, there is no storage at any intermediate point as such, the sending being between the two extremes involved. Although it could be an end-to-end service, it is not. To be more exact, communication at some point must go through a proxy server.
General Features of Magic Wormhole
Magic Wormhole uses PAKE (Password-Authenticated Key Exchange) to encrypt the information that is sent between the endpoints. This application uses the SPAKE2 algorithm.
Before I mentioned that at some point, communication has to be managed by a server. This is going to be the one in charge of creating a TCP tunnel between the ends. This will ensure that the information is sent.
The Magic Wormhole library requires a «RendezvousServer«. This is a simple relay based on WebSocket that delivers messages from one client to another. This allows Magic Wormhole codes to bypass IP addresses and port numbers.
The file transfer commands use a "Transit Relay". This is another simple server that gathers two incoming TCP connections and transfers the data between the two.
The user who sends the file will have to send the key via chat / message / call that Magic Wormhole will generate to the receiving user.
If anyone needs to know more about how safe Magic Wormhole can be or its features, check out the GitHub can solve many doubts.
Install Magic Wormhole
In Debian 9 and Ubuntu 17.04+ we will be able to install Magic Wormhole. For this we will use the terminal (Ctrl + Alt + T) and the apt command that is shown below.
sudo apt install magic-wormhole
In older versions of Debian / Ubuntu, the following packages need to be installed before the program. We open the terminal (Ctrl + Alt + T) and write in it.
sudo apt-get install python-pip build-essential python-dev libffi-dev libssl-dev pip install magic-wormhole
Use Magic Wormhole
First of all, I have to say that I have reported errors in my local network. This happened if the directory path from which I intend to send the file contained accents or the like at some point in the indicated path. The code required for shipping is generated at this point. We will have to pass this on to the recipient. Once this is clarified, to send a file you just have to open the terminal (Ctrl + Alt + T) and write the following.
wormhole send “nombre del archivo”
To receive the file, you just have to use the following command in the terminal. It seems obvious to me, but don't forget that the receiver also has to have Magic Wormhole installed. The program will ask the receiver to enter the code it has received from the sender.
Both sender and receiver will receive notifications indicating the progress of the transfer of files. It will also inform us if the process finds any errors along the way.
This is obviously an application for those who feel comfortable using the terminal.