Skip to content

Instantly share code, notes, and snippets.

@cristianrasch
Last active February 9, 2023 19:37
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cristianrasch/8ecf9e78d2c300632179 to your computer and use it in GitHub Desktop.
Save cristianrasch/8ecf9e78d2c300632179 to your computer and use it in GitHub Desktop.
rsyncrypto tutorial
# Generate your backup private key and certificate
openssl req -nodes -newkey rsa:1536 -x509 -keyout backup.key -out backup.crt
# Encrypt your data to a temporary folder
rsyncrypto --verbose --ne-nesting=2 --trim=2 --name-encrypt=/tmp/rsyncrypto-map --delete-keys --changed --recurse /home/cristian/Dropbox/ /tmp/Dropbox/ /tmp/rsyncrypto-keys ~/Dropbox/backups/laptop/crypto/rsyncrypto/backup.crt
# Send it over the network
rsync --verbose --archive --compress --delete /tmp/Dropbox/ pi:~/backups/laptop
# Decryption time!
# First, generate the mapping file
rsyncrypto --decrypt /tmp/Dropbox/filemap ~/Desktop/Dropbox/filemap ~/Desktop/Dropbox/filemap-keys ~/Dropbox/backups/laptop/crypto/rsyncrypto/backup.key
# and finally decrypt away placing files under ~/Desktop/Dropbox/files
rsyncrypto --trim=2 --name-encrypt=/home/cristian/Desktop/Dropbox/filemap --verbose --recurse --decrypt /tmp/Dropbox ~/Desktop/Dropbox/files ~/Desktop/Dropbox/keys ~/Dropbox/backups/laptop/crypto/rsyncrypto/backup.key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment