Backing up data in an encrypted way

4

3

I have the following use case:

  1. There's some data from my PC I want to periodically back-up online
  2. I own some hosting, so I want to use that for the backups, don't want to pay to another backup service
  3. I want to encrypt my data locally prior to moving it to the server

I have no problem writing scripts to automate the process (say, periodically generate the backup and upload by FTP to my server), but my main question is about step 3 - the encryption: which way is recommended to encrypt my files (say, collected into a .ZIP) prior to uploading to the server?

P.S. TrueCrypt seems popular but it's not quite what I'm looking for, since I don't want the files to be constantly encrypted here on my PC.

Eli Bendersky

Posted 2010-06-12T05:04:35.063

Reputation: 594

A word of warning though-Hosting services usually do not allow personal backups to be stored there. – JFW – 2010-09-11T11:09:29.870

1@JFW: what do you mean? It's my paid hosting, do they care what I use it for, as long as it's not child porn or stuff like that? – Eli Bendersky – 2010-09-24T15:41:09.400

@Eli Usually in their Terms and Conditions, there is one part of the document where they do not allow users to host their own private files, even if it's your own paid hosting. (Unless the service is exclusively a File Hosting service and not a web hosting service.) – JFW – 2010-09-25T07:03:58.893

@JFW: that's weird, given that all my website files are my private files in some sense. For instance, if I host my private photo album there - is it considered backup? – Eli Bendersky – 2010-09-25T07:27:55.603

If you host your private photo album and have it as part of your website, it should be fine. If you host your private photo album in a closed folder (As in blocking connections from the whole world.), then that would be considered backup. – JFW – 2010-09-26T13:04:30.427

Of course, your host might allow personal backups (Website backups should be fine.) but for the majority of hosts, disk space isn't free and it'd be hard to earn profit if every user decided to host an encrypted image of their whole computer on their hosting service. – JFW – 2010-09-26T13:05:19.973

I know I'm jumping in over a year late, but I suspect Eli and JFW are talking about different things. Many free web hosting services (like geocities when it existed) or targeted providers that make money off of ads (YouTube) did not officially allow storing files that were not linked and using them as backuped violated the TOS. Most paid hosting companies do not care what you use the space for as long as it is legal and would be perfectly fine with using it as a backup for all legal material. I know people with Amazon S3 accounts that use it for backup, for instance. – TimothyAWiseman – 2011-12-21T23:28:24.670

Answers

4

Actually, TrueCrypt might help you greatly here. As part of an automated process, say via batch file, you could:

  1. Mount a TrueCrypt volume using TrueCrypt's command line interface (or just do it manually).

  2. Copy the files you want to back up into the mounted volume.

  3. Unmount the volume.

  4. Upload the TrueCrypt container to the server in the manner of your choosing.

Stephen Jennings

Posted 2010-06-12T05:04:35.063

Reputation: 21 788

I ended up rolling my own with PyCrypto, but I accept this answer because I really like TrueCrypt and its being open-source. – Eli Bendersky – 2010-06-25T13:59:06.567

4

Bundle the files into <archive format of choice>, then encrypt the whole thing with GnuPG.

Ignacio Vazquez-Abrams

Posted 2010-06-12T05:04:35.063

Reputation: 100 516

2

Also, the 7z format uses strong encryption, so if you use 7z you could skip the GPG step altogether.

– Stephen Jennings – 2010-06-12T05:34:26.100

+1 for GPG. If you use symmetric encryption with a passphrase you don't need to set up public/private keys. – Mike Fitzpatrick – 2010-06-12T05:43:43.487

Just remember to set the compression ratio of zip/rar/7zip to zero before archiving it. – Nifle – 2010-06-12T07:30:37.790

2

Take a look at Cobian Backup It offers encryption, compression and supports FTP, it's also free

Pulse

Posted 2010-06-12T05:04:35.063

Reputation: 4 389

I've used Cobian as well, and it's pretty good. I'd advise using the encryption you get from an archive, rather than using Cobian's own encryption, on the grounds it's easier to recover from. – Dentrasi – 2010-06-12T08:56:47.687

1

If you know how to write scripts, you could do something really cool with the encryption. Write it Yourself!

The famous RSA encryption scheme is time tested and very secure, and its only 5 steps of simple algebra. http://en.wikipedia.org/wiki/RSA#A_worked_example

I did it in java for school but if you hate algebra it may not be for you.

CDeanMartin

Posted 2010-06-12T05:04:35.063

Reputation: 31

1While inventing a security system may be entertaining, in general if you actually want something to be secure, you should almost never roll your own. Use existing technologies because they are time-tested, peer-reviewed, and have already come across and fixed the corner cases and potential weaknesses that you haven't. – Stephen Jennings – 2010-06-25T16:08:15.317