Skip to main content

OTF Decryption in Hive

Perform the following steps to execute OTF decryption in Hive:

  1. Open HDFSAgentConfig.properties file located at

    ‘/opt/Dataguise/DgSecure/Agents/HDFSAgent/expandedArchive/WEB-INF/classes’ and provide values for the below mentioned properties:

    1. OTF.decryption.metadata.path: Provide the path where you want to generate the metadata files in HDFS.

    2. OTF.decryption.configuration: Set the value of this property to ‘Y’. This property will generate the metadata files at the path specified above. By default, the value is set to ‘N’.

  2. After successfully executing the FP encryption task, the metadata files get generated at the path specified in the OTF.decryption.metadata.path property. The encrypted or output file gets stored at the destination directory specified in the Domain screen. Below is the domain screen:

     

  3. Create a file temp_dg_220195138 in the /tmp location of the HDFS. This file will point to the location where the actual metadata files reside.

  4. Connect to the Hive using the Beeline client, and create a decryption function using the below mentioned command:

    Syntax: 

    CREATE FUNCTION <Function Name> AS 'com.dataguise.decrypterlib.hive.udf.DgFPDecrypter' using jar 'hdfs:///tmp/dataguise/DgDecrypter.jar';

    Sample function call:

    CREATE FUNCTION DgFpdecrypt AS ‘com.dataguise.decrypterlib.hive.udf.DgFPDecrypter' using jar 'hdfs://tmp/dataguise/DgDecrypter.jar';

  5. Call the decryption function using the below command. The function will decrypt the encrypted data and return the actual content of the file.

    Syntax:
    SELECT <function name><column name>FROM <table name>; 

    Sample function call:
    SELECT DgFpdecrypt (NAME) FROM EMP;

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.