[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Encrypt data between socket client and server
[Thread Prev] | [Thread Next]
- Subject: Re: Encrypt data between socket client and server
- From: gbWilly <gbWilly@xxxxxxxxxxxxxx>
- Date: Thu, 05 Mar 2026 12:26:44 +0000
- Cc: List Gambas Mailing <user@xxxxxxxxxxxxxxxxxxxxxx>, Olivier Cruilles <olivier.cruilles@xxxxxxxx>
On Thursday, March 5th, 2026 at 02:19, Olivier Cruilles <olivier.cruilles@xxxxxxxx> wrote: > Hi gbWilly, > > Multiple solutions existe to encrypt data between a client and a server. > > 1) Encryption of each piece of data send from one side to the other: > > - Define a word at the begin of each piece of data + the encrypted data + the checksum + word to end the piece of data > > - Example: PIECESTART + ‘:’ + < data encrypted with SHA256 > + ‘:’ + < checksum of the data encrypted > + ‘:’ + ENDPIECE > > Note: Be careful because data over a socket buffer does not arrive/send in one shot, so take care to re-assemble all the flow before trying to analyse it of decrypt it. > > 2) Solution 2: SSH tunnel > > - SSH can create a tunnel between 2 hosts or IPs, even on the same Linux machine > - You can start the SSH tunnel manually, at one time, by entering the SSH password or using an SSH Key > - Once the tunnel is established, it will live until you kill it or the machine reboot > > - Example: Redirection from Machine 1 - Port 1000 -> SSH Tunnel -> to Machine 2 - Port 2000 > > - Cmd: ssh -f <user>@machine2 -L 1000:127.0.0.1:2000 -N > > - Here 127.0.0.1 represent the localhost of Machine2 > > 3) Solution 3: Wireguard > > - Wireguard is a way to build a simple VPN between 2 or more Machines/Host, totally encrypted.t > - It’s easy to create a new VPN network between 2 Hosts, as it’s like create an ssh communication by using a token (equal to an SSH key) > - In the end it will create a new IP/interface on both side and you will use the new IP created to communicate, totally encrypted, from one Host to the other > > 4) Solution 4: commad ’stunnel’ > > - ’stunnel’ need to be installed on both side, server and client. SSL and certificate can be used by this tool > > I hope it could help you > > Olivier You certainly could, there is some good leads in there to dive into. I like the SSH tunnel idea. So, if a socket daemon would be listening at port 2000 in your example and my socket client is operating a port 1000 in your example, just first creating the tunnel would make socket client and server communicate over the tunnel? Do I get that right that, once this tunnel is made all communication between those 2 ports will be over that tunnel. Thanks gbWilly [GambOS](https://gambos.gambas.one/) [Gambas3 for Debian/Ubuntu](https://gitlab.com/gbWilly/gambas3-debian-repository) [GambOS](https://gambos.gambas.one/) ...there is always a Catch if things go wrong!
| Re: Encrypt data between socket client and server | Lee <t.lee.davidson@xxxxxxxxx> |
| Encrypt data between socket client and server | gbWilly <gbWilly@xxxxxxxxxxxxxx> |
| Re: Encrypt data between socket client and server | Lee <t.lee.davidson@xxxxxxxxx> |
| Re: Encrypt data between socket client and server | gbWilly <gbWilly@xxxxxxxxxxxxxx> |
| Re: Encrypt data between socket client and server | Lee <t.lee.davidson@xxxxxxxxx> |
| Re: Encrypt data between socket client and server | Olivier Cruilles <olivier.cruilles@xxxxxxxx> |