You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
313 B
18 lines
313 B
#!/bin/bash
|
|
# Usage: recv-file <server> <port> <file>
|
|
|
|
SERVER=$1
|
|
PORT=${2:-4443}
|
|
FILE=$3
|
|
|
|
# Recv the key and IV
|
|
$KEY_IV=$(nc -w 3 $SERVER $PORT | gpg --decrypt || exit 1)
|
|
|
|
echo "Received key and iv: $KEY_IV"
|
|
|
|
echo "Reading file"
|
|
|
|
nc -w 3 $SERVER $PORT | chacha20 d $KEY_IV | gunzip > $FILE || exit 2
|
|
|
|
echo "Read"
|