Skip to content

User Guide: Running the File Encryption Utility (FEU)

Follow the steps below to use the File Encryption Utility (FEU) for encrypting and decrypting files:

  • Create a folder to store sample data
    Bash
    1
    2
    3
      mkdir -p /home/<user>/customer_data/protect/input
      mkdir -p /home/<user>/customer_data/protect/output
      mkdir -p /home/<user>/customer_data/protect/meta
    
  • create a file named customer_data_with_header.csv in the /home/<user>/customer_data/protect/input folder and add the following content:

    Text Only
    1
    2
    3
      name,email
      ram,ram@gmail.com
      tom,tom@gmail.com
    
  • create a file named customer_data_meta.txt in the customer_data/protect/meta/ folder and add the following content:

    Text Only
      COLUMN_NAME|SCHEME_NAME
      email|SYSTEM_EMAIL
    
  • create scheme policy to give access to feu-integration-user to protect/unprotect and GetScheme for SYSTEM_EMAIL scheme.

  • Encrypt sample data fields using FEU

    Bash
      cd <local-folder-path>/privacera-feu/crypto-config
    
    Bash
      java -jar privacera-file-encryption.jar encryptdata --config_file=. -fi="/home/<user>/customer_data/protect/input/customer_data_with_header.csv" -fo="/home/<user>/customer_data/protect/output/customer_data_with_header_enc.csv" -mf="/home/<user>/customer_data/protect/meta/customer_data_meta.txt" -dl="," -out_dl="," -le="LF"
    
    After running the above command, the output file customer_data_with_header_enc.csv will be created in the /home/<user>/customer_data/protect/output/ folder with the email column encrypted.

  • Decrypt sample data fields using FEU

    Bash
      cd <local-folder-path>/privacera-feu/crypto-config
    
    Bash
      java -jar privacera-file-encryption.jar decryptdata --config_file=. -fi="/home/<user>/customer_data/protect/output/customer_data_with_header_enc.csv" -fo="/home/<user>/customer_data/protect/output/customer_data_with_header_dec.csv" -mf="/home/<user>/customer_data/protect/meta/customer_data_meta.txt" -dl="," -out_dl="," -le="LF"   
    

After running the above command, the output file customer_data_with_header_dec.csv will be generated in the /home/<user>/customer_data/protect/output/ directory, with the email column successfully decrypted. The above command will run the CLI for encryption of file with the following input parameters:

--config_file: Path to crypto configuration folder (folder contains crypto.properties, keystore.jceks, SSL certificate)

-fi: Path to the input file whose columns needs to be encrypted

-fo: Path where the encrypted output filename should be created

-mf: Path to meta file containing column names and schemes

-dl: Delimiter used in the input file (Eg: || or ~ or comma)

-out_dl: Delimiter used in the output file (Eg: || or ~ or comma)

-le: : input file line ending format, Expected Values: CRLF, CR, LF (Use LF for Unix/Linux/macOS, CRLF for Windows, and CR for older Mac systems)

Comments