### 23.5.31 ndbxfrm — Compress, Decompress, Encrypt, and Decrypt
Files Created by NDB Cluster

[]()

 The [**ndbxfrm**](mysql-cluster-programs-ndbxfrm.html) utility, introduced in NDB 8.0.22, can be used to decompress, decrypt, and output information about files created by NDB Cluster that are compressed, encrypted, or both. It can also be used to compress or encrypt files.

[]()

**Table 23.51 Command-line options used with the program ndbxfrm**

|                                                                                                 Format                                                                                                  |                                     Description                                      |           Added, Deprecated, or Removed           |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|---------------------------------------------------|
|                       `[--compress](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_compress)`,<br/><br/>` [-c](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_compress) `                       |                                    Compress file                                     |                 ADDED: NDB 8.0.22                 |
|                                                 ` [--decrypt-password=password](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_decrypt-password) `                                                  |                          Use this password to decrypt file                           |                 ADDED: NDB 8.0.22                 |
|                                           ` [--decrypt-password-from-stdin](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_decrypt-password-from-stdin) `                                           |                Get decryption password in a secure fashion from STDIN                |                 ADDED: NDB 8.0.24                 |
|                                                ` [--defaults-extra-file=path](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_defaults-extra-file) `                                                 |                     Read given file after global files are read                      | (Supported in all NDB releases based on MySQL 8.0)|
|                                             ` [--defaults-group-suffix=string](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_defaults-group-suffix) `                                              |                     Also read groups with concat(group, suffix)                      | (Supported in all NDB releases based on MySQL 8.0)|
|                                                      ` [--defaults-file=path](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_defaults-file) `                                                       |                      Read default options from given file only                       | (Supported in all NDB releases based on MySQL 8.0)|
|                                                   ` [--encrypt-block-size=#](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_encrypt-block-size) `                                                   |Size of input data chunks encrypted as a unit. Used with XTS, set to zero for CBC mode|                 ADDED: NDB 8.0.29                 |
|                                                       ` [--encrypt-cipher=#](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_encrypt-cipher) `                                                       |                       Encryption cipher: 1 for CBC, 2 for XTS                        |                 ADDED: NDB 8.0.29                 |
|`[--encrypt-kdf-iter-count=#](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_encrypt-kdf-iter-count)`,<br/><br/>` [-k #](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_encrypt-kdf-iter-count) `|                     Number of iterations used in key definition                      |                 ADDED: NDB 8.0.22                 |
|                                                 ` [--encrypt-password=password](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_encrypt-password) `                                                  |                          Use this password to encrypt file                           |                 ADDED: NDB 8.0.22                 |
|                                           ` [--encrypt-password-from-stdin](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_encrypt-password-from-stdin) `                                           |                Get encryption password in a secure fashion from STDIN                |                 ADDED: NDB 8.0.24                 |
|                             `[--help](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_help)`,<br/><br/>` [-?](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_help) `                             |                               Print usage information                                |                 ADDED: NDB 8.0.22                 |
|                             `[--info](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_info)`,<br/><br/>` [-i](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_info) `                             |                                Print file information                                |                 ADDED: NDB 8.0.22                 |
|                                                         ` [--login-path=path](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_login-path) `                                                          |                           Read given path from login file                            | (Supported in all NDB releases based on MySQL 8.0)|
|                                                           ` [--no-defaults](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_no-defaults) `                                                           |        Do not read default options from any option file other than login file        | (Supported in all NDB releases based on MySQL 8.0)|
|                                                        ` [--print-defaults](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_print-defaults) `                                                        |                         Print program argument list and exit                         | (Supported in all NDB releases based on MySQL 8.0)|
|                           `[--usage](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_usage)`,<br/><br/>` [-?](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_usage) `                            |                     Prints usage information; synonym for --help                     |                 ADDED: NDB 8.0.22                 |
|                        `[--version](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_version)`,<br/><br/>` [-V](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_version) `                         |                              Output version information                              |                 ADDED: NDB 8.0.22                 |

#### Usage

```
ndbxfrm --info file[ file ...]

ndbxfrm --compress input_file output_file

ndbxfrm --decrypt-password=password input_file output_file

ndbxfrm [--encrypt-ldf-iter-count=#] --encrypt-password=password input_file output_file
```

*`input_file`* and *`output_file`* cannot be the same file.

#### Options

* []() `--compress`, `-c`

  []()[]()

   Compresses the input file, using the same compression method as is used for compressing NDB Cluster backups, and writes the output to an output file. To decompress a compressed `NDB` backup file that is not encrypted, it is necessary only to invoke [**ndbxfrm**](mysql-cluster-programs-ndbxfrm.html) using the names of the compressed file and an output file (with no options required).

* []() `--decrypt-password=*`password`*`

  []()[]()

   Decrypts a file encrypted by `NDB` using the password supplied.

* []() `--decrypt-password-from-stdin[=TRUE|FALSE]`

  []()[]()

   Decrypts a file encrypted by `NDB`, using a password supplied from standard input. This is similar to entering a password after invoking [**mysql**](mysql.html) [`--password`](mysql-command-options.html#option_mysql_password) with no password following the option.

* []() `--defaults-extra-file`

  []()[]()

  |Command-Line Format|`--defaults-extra-file=path`|
  |-------------------|----------------------------|
  |       Type        |           String           |
  |   Default Value   |          `[none]`          |

   Read given file after global files are read.

* []() `--defaults-file`

  []()[]()

  |Command-Line Format|`--defaults-file=path`|
  |-------------------|----------------------|
  |       Type        |        String        |
  |   Default Value   |       `[none]`       |

   Read default options from given file only.

* []() `--defaults-group-suffix`

  []()[]()

  |Command-Line Format|`--defaults-group-suffix=string`|
  |-------------------|--------------------------------|
  |       Type        |             String             |
  |   Default Value   |            `[none]`            |

   Also read groups with concat(group, suffix).

* []() `--encrypt-block-size=*`#`*`

  []()[]()

   Size of input data chunks that are encrypted as a unit. Used with XTS; set to `0` (the default) for CBC mode.

* []() `--encrypt-cipher=*`#`*`

  []()[]()

   Cipher used for encryption. Set to `1` for CBC mode (the default), or `2` for XTS.

* []() `--encrypt-kdf-iter-count=*`#`*`, `-k *`#`*`

  []()[]()

   When encrypting a file, specifies the number of iterations to use for the encryption key. Requires the [`--encrypt-password`](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_encrypt-password) option.

* []() `--encrypt-password=*`password`*`

  []()[]()

   Encrypts the backup file using the password supplied by the option. The password must meet the requirements listed here:

  * Uses any of the printable ASCII characters except `!`, `'`, `"`, `$`, `%`, `\`, ```, and `^`

  * Is no more than 256 characters in length

  * Is enclosed by single or double quotation marks

* []() `--encrypt-password-from-stdin[=TRUE|FALSE]`

  []()[]()

   Encrypts a file using a password supplied from standard input. This is similar to entering a password is entered after invoking [**mysql**](mysql.html) [`--password`](mysql-command-options.html#option_mysql_password) with no password following the option.

* []() `--help`, `-?`

  []()[]()

   Prints usage information for the program.

* []() `--info`, `-i`

  []()[]()

   Prints the following information about one or more input files:

  * The name of the file

  * Whether the file is compressed (`compression=yes` or `compression=no`)

  * Whether the file is encrypted (`encryption=yes` or `encryption=no`)

   Example:

  ```
  $> ndbxfrm -i BACKUP-10-0.5.Data BACKUP-10.5.ctl BACKUP-10.5.log
  File=BACKUP-10-0.5.Data, compression=no, encryption=yes
  File=BACKUP-10.5.ctl, compression=no, encryption=yes
  File=BACKUP-10.5.log, compression=no, encryption=yes
  ```

* []() `--login-path`

  []()[]()

  |Command-Line Format|`--login-path=path`|
  |-------------------|-------------------|
  |       Type        |      String       |
  |   Default Value   |     `[none]`      |

   Read given path from login file.

* []() `--no-defaults`

  []()[]()

  |Command-Line Format|`--no-defaults`|
  |-------------------|---------------|

   Do not read default options from any option file other than login file.

* []() `--print-defaults`

  []()[]()

  |Command-Line Format|`--print-defaults`|
  |-------------------|------------------|

   Print program argument list and exit.

* []() `--usage`, `-?`

  []()[]()

   Synonym for [`--help`](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_help).

* []() `--version`, `-V`

  []()[]()

   Prints out version information.

[**ndbxfrm**](mysql-cluster-programs-ndbxfrm.html) can encrypt backups created by any version of NDB Cluster. The `.Data`, `.ctl`, and `.log` files comprising the backup must be encrypted separately, and these files must be encrypted separately for each data node. Once encrypted, such backups can be decrypted only by [**ndbxfrm**](mysql-cluster-programs-ndbxfrm.html), [**ndb\_restore**](mysql-cluster-programs-ndb-restore.html), or **ndb\_print\_backup** from NDB Cluster 8.0.22 or later.

 An encrypted file can be re-encrypted with a new password using the [`--encrypt-password`](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_encrypt-password) and [`--decrypt-password`](mysql-cluster-programs-ndbxfrm.html#option_ndbxfrm_decrypt-password) options together, like this:

```
ndbxfrm --decrypt-password=old --encrypt-password=new input_file output_file
```

 In the example just shown, *`old`* and *`new`* are the old and new passwords, respectively; both of these must be quoted. The input file is decrypted and then encrypted as the output file. The input file itself is not changed; if you do not want it to be accessible using the old password, you must remove the input file manually.

