Encrypting and Decrypting SQL Workload Files

Encrypt SQL Workload Files

  1. Open a terminal window, go to the directory where the Anonymizer JAR file is located, and run the following command:
    java -jar cloudera_anonymizer-<x.x>.jar anonymize sql <path_to_workload_file>
    
    Option Description/Effect
    -jar Path to the Anonymizer JAR file
    anonymize Encrypt the file
    sql <path_to_workload_file> Path to the SQL file that contains the workload

    See the Anonymizer CLI Reference for more command-line options.

  2. Anonymizer prompts you for the following information:
    • Location and name of the encrypted output file.
    • Location and name of the .passkey file.
    • Location and name of the error output file.

    For each, type the path and file name and press Enter or press Enter only and Anonymizer will assign the following default names to the files:

    Input File Name Encrypted Output File Name Key File Name Error File Name
    xyz.sql anonymizedxyz.sql xyz.sql.passkey xyz.sql.err
  3. Identify the vendor of your database where the queries are used. Type the name and press Enter.
  4. The tool asks you to enter a strong password. Type your password and press Enter. If the password you typed is not strong enough, the tool writes the password requirements to the terminal window.
  5. The tool processes the SQL file and when finished writes a success message to the terminal window.

By default, Anonymizer names the SQL output files as follows:

Decrypt SQL Workload Files

  1. Open a terminal window, navigate to the directory where the Anonymizer JAR file is located, and run the following command:
    java -jar cloudera_anonymizer-<x.x>.jar deanonymize sql <path_to_encrypted_workload_file> -k <path_to_passkey_file> 
    
    Option Description/Effect
    -jar Path to the Anonymizer JAR file
    deanonymize Decrypt the file
    sql <path_to_workload_file> Path to the SQL file that contains the workload
    -k <path_to_passkey_file> Path to the .passkey file created when you originally encrypted the SQL workload

    See the Anonymizer CLI Reference for more command-line options.

  2. Anonymizer prompts you for the following information:
    • The location and file name of the decrypted output file. Type the path and file name and press Enter. If you press Enter only, Anonymizer assigns a default name to the file. For example, if your encrypted file name is anonymized_xyz.sql, Anonymizer names the decrypted file deanonymized_anonymized_xyz.sql.
    • Identify the vendor of your database where the queries are used. Type the name and press Enter.
  3. The tool prompts you to enter the password. Type the password that you originally entered when the file was encrypted, and press Enter.
  4. The tool processes the encrypted file and when finished writes a success message to the terminal window.