dar encryption - RSA

Tobias Specht <[email protected]> Wed, 24 Sep 2014 02:00:25 +0200
Newsgroups gmane.comp.sysutils.backup.dar.libdar
Message-ID <1411516825.4651.102.camel@EliteBook>
Hi Denis,

As I'm working on a user friendly automated backup solution based on dar
I have also done some considerations about encryption.
For me encryption is a major topic to ensure privacy and to do so it
must be easy to use for everyone, not only for IT-experts.

The first question: 
is it possible to get to know whether the archive is encrypted or not
before I open it? 
When I try to open it without a password I get the error message anyway.

Now to some deeper considerations about encryption.
When creating backups automated on a regular basis (eg. every day the
computer is running) it is annoying to enter the password every time to
encrypt the backup. When thinking about this problem I came up with the
following idea:
We could use in addition to the symmetric encryption system of the dar
archive a asymmetric encryption schema like RSA.
In asymmetric encryption a different key is used for decryption then for
encryption.
Once for every user/computer a pair of public and private key is
generated. The public key can be stored in plain text because it is only
used for encryption. But the private key must be encrypted so that the
user has to enter a password to open the key and to decrypt data that
has been encrypted with his public key.
When a backup is created a random password for the encryption of the
archive can be generated. This password is only used for this one
archive. And now comes the magic thing, the password can be encrypted
with the public key which can be done without user interaction. 
To decrypt the password for the backup the private key is needed which
itself is encrypted. In this case the user has to enter his password. 
So a user only needs to remember the password of his private key. With
this he can decrypt all the passwords for his backups. 
In a backup solution the user should of course not care about all the
keys, he only needs to enter his password for the private key and every
thing else is done by the program. 
I have implemented a proof of concept to create backups like this and it
is working really well.
What du you think about this idea?

If you like it, I have a feature request for you.
To do all the RSA stuff I need to store some extra data:
1) the encrypted password of the dar archive
2) the ID of the public key with which the password has been encrypted.
(this is useful because the public key is also part of the private key
so it is easier to match the corresponding private key to the key-file
of the backup)
This information can be saved in separate files but this lets to
confusion and if any of this files get lost, it is impossible to
recovery the password of the backup. To make things easier it would be
nice to store them in the header of the dar archive. To be exact this
would be 256 Byte for the encrypted password and a SHA256 value for the
ID of the public key.
As I have just noticed dar supports a user defined message to be written
inside the archive header (--user-comment). You have documented that
this message is unencrypted even if the archive is encrypted. But I have
found no way to read the message without providing the password of the
archive. Is it possible the read the user message without knowing the
password of the archive?
(On a long run it would be nice to have a separate option in the archive
header for the RSA stuff.)

Finally there is another thing which I had to consider. When creating a
backup with a reference to an encrypted archive, I need the password. To
bypass this problem I have isolated the catalogue. 
I know it would increase the complexity of the archive header to store
the catalogue either encrypted or unencrypted, but it would eliminate
the need of the isolated catalogue file. I could imagine that is a quite
common issue.
Are you planing to add a possibility to store the catalogue unencrypted
even if the archive data is encrypted?

Regards,
Tobias


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk