How I encrypt my backups in the cloud

 · 1 min read

One thing that I do in order to secure my data is to use encryption. So why shouldn’t I do the same with the sensitive files of my websites.

Like database dumps or php files contains passwords like the wp-config.php. I found a kind of easy way to do this by simply adding all the files to a zip file and then encrypting this file using GnuGPG. GnuGPG is preinstalled with every ubuntu distribution and uses the OpenPGP standart to encrypt data. But as I don’t want to use public and private keys to encrypt the data I simply use the password mode of GnuGPG. To encrypt the data I use this command: echo password-here | gpg --passphrase-fd 0 -c /path/to/backupfile.zip the field where it says password-here is the place where you want to put your encryption password. After entering the command your file will be encrypted. You can find the encrypted version if you look for the .pgp file extension. If you want to decrypt your file just use gpg /path/to/backupfile.zip.gpg. And thats it you have successfully encrypted your backup.