encrypt.sh 417 Bytes
Newer Older
ccarlos's avatar
ccarlos committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

if [ ! -e slt2020_pub.pem ]
then
    echo "> Public key ./slt2020_pub.pem does not exist."
    exit 1
fi

notebookfile=$1

if [ ! -e "$notebookfile" ]
then
    echo "> Notebook file $notebookfile does not exist."
else
    openssl smime -encrypt -aes256 -in "$notebookfile" -binary -outform DEM \
        -out "$notebookfile.encr" slt2020_pub.pem
    
    echo "> File encrypted as $notebookfile.encr"
fi