From f4304c32e27608491b6c7f893ec066a7aff653f2 Mon Sep 17 00:00:00 2001 From: Gagan Saksena Date: Sat, 18 Nov 2023 09:56:50 -0800 Subject: [PATCH] Fixing the example for encrypted transfer with openssl --- source/_posts/nc.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/_posts/nc.md b/source/_posts/nc.md index 8a6c5f4..fcabc8e 100644 --- a/source/_posts/nc.md +++ b/source/_posts/nc.md @@ -152,12 +152,12 @@ Suppose you want to transfer a directory over the network from A to B. Server (192.168.1.9) ```shell script -$ nc -l 8000 | openssl enc -d -des3 -pass pass:password > file.txt +$ openssl enc -des3 -in file.txt -pass pass:password | nc -l 8000 ``` Client ```shell script -$ openssl enc -des3 -pass pass:password | nc 192.168.1.9 8000 +$ nc 192.168.1.9 8000 | openssl enc -des3 -d -pass pass:password -out file.txt ``` Encrypt data before transfering over the network