~hrvojem/percona-xtrabackup/doc-43-2.1

« back to all changes in this revision

Viewing changes to doc/source/innobackupex/encrypted_backups_innobackupex.rst

  • Committer: jenkins at percona
  • Date: 2013-07-29 08:44:29 UTC
  • mfrom: (636.2.1 2.1)
  • Revision ID: jenkins@jenkins.percona.com-20130729084429-lyarg7rq418a2fes
MergeĀ lp:~hrvojem/percona-xtrabackup/bug1179445-2.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
|Percona XtraBackup| has implemented support for encrypted backups. This feature was introduced in |Percona XtraBackup| 2.1. It can be used to encrypt/decrypt local or streaming backup with |xbstream| option (streaming tar backups are not supported) in order to add another layer of protection to the backups. Encryption is done with the ``libgcrypt`` library.
8
8
 
 
9
.. note:: 
 
10
 
 
11
  Encryption related options are currently ignored by |innobackupex| when specified in :file:`my.cnf`.
 
12
 
9
13
Creating Encrypted Backups
10
14
===========================
11
15
 
17
21
 
18
22
 * :option:`--encrypt-key-file=KEYFILE` - the name of a file where the raw key of the appropriate length can be read from. The file must be a simple binary (or text) file that contains exactly the key to be used. 
19
23
 
20
 
Both :option:`--encrypt-key` option  and :option:`--encrypt-key-file` option can be used to specify the encryption key.
 
24
Both :option:`--encrypt-key` option  and :option:`--encrypt-key-file` option can be used to specify the encryption key. Encryption key can be generated with command like: ::
 
25
  
 
26
  $ openssl enc -aes-256-cbc -pass pass:Password -P -md sha1
 
27
 
 
28
Output of that command should look like this: :: 
 
29
 
 
30
  salt=9464A264486EEC69
 
31
  key=DDD3A1B6BC90B9A9B631913CF30E0336A2571BA854E2D65CF92A6D0BDBCBB251
 
32
  iv =A1EDC73815467C083B0869508406637E
 
33
 
 
34
In this case we can use ``iv`` value as key.
21
35
 
22
36
Using the :option:`--encrypt-key` option
23
37
-----------------------------------------
24
38
Example of the innobackupex command using the :option:`--encrypt-key` should look like this ::
25
39
 
26
 
  $ innobackupex --encrypt=AES256 --encrypt-key="secret_key_with_the_length_of_32" /data/backups
 
40
  $ innobackupex --encrypt=AES256 --encrypt-key="A1EDC73815467C083B0869508406637E" /data/backups
27
41
 
28
42
 
29
43
Using the :option:`--encrypt-key-file` option
34
48
 
35
49
.. note::
36
50
 
37
 
  Depending on the text editor used for making the ``KEYFILE``, text file in some cases can contain the CRLF and this will cause the key size to grow and thus making it invalid. Suggested way to do this would be to create the file with: ``echo -n "secret_key_with_the_length_of_32" > /data/backups/keyfile``
 
51
  Depending on the text editor used for making the ``KEYFILE``, text file in some cases can contain the CRLF and this will cause the key size to grow and thus making it invalid. Suggested way to do this would be to create the file with: ``echo -n "A1EDC73815467C083B0869508406637E" > /data/backups/keyfile``
38
52
 
39
53
 
40
54
Both of these examples will create a timestamped directory in :file:`/data/backups` containing the encrypted backup.