<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – Voltage SecureData integration function reference</title>
    <link>/en/voltage-securedata-integration/voltage-securedata-integration-function-reference/</link>
    <description>Recent content in Voltage SecureData integration function reference on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/voltage-securedata-integration/voltage-securedata-integration-function-reference/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Voltage-Securedata-Integration: VoltageSecureAccess</title>
      <link>/en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureaccess/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureaccess/</guid>
      <description>
        
        
        &lt;p&gt;Calls SecureData to decrypt ciphertexts encrypted with &lt;a href=&#34;../../../en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureprotect/#&#34;&gt;VoltageSecureProtect&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;VoltageSecureAccess(&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;ciphertext&lt;/span&gt;&amp;#39; [, &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;tweak&lt;/span&gt;&amp;#39;] USING PARAMETERS
                    format=&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;format_name&lt;/span&gt;&amp;#39;
                    [, mask=&lt;span class=&#34;code-variable&#34;&gt;is_masked&lt;/span&gt;]
                    [, config_dfs_path=&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;config_file&lt;/span&gt;&amp;#39;]
                    [, identity=&lt;span class=&#34;code-variable&#34;&gt;sd_identity&lt;/span&gt;]);
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;td &gt;
&lt;em&gt;&lt;code&gt;ciphertext&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;
A VARCHAR value that was encrypted using SecureData. You must cast other data types (for example DATE values) to VARCHAR when calling this function.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;em&gt;&lt;code&gt;tweak&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;













&lt;p&gt;VARCHAR value analogous to a &lt;a href=&#34;https://en.wikipedia.org/wiki/Salt_(cryptography)&#34;&gt;salt&lt;/a&gt; that allows equivalent *&lt;code&gt;plaintext&lt;/code&gt;*s to produce different ciphertexts. The same &lt;code&gt;tweak&lt;/code&gt; value must for encryption and decryption of a given plaintext.&lt;/p&gt;
&lt;p&gt;When encrypting or hashing an entire column, you can pass another column for a set of &lt;em&gt;&lt;code&gt;tweak&lt;/code&gt;&lt;/em&gt; values.&lt;/p&gt;
&lt;div class=&#34;admonition caution&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Caution&lt;/h4&gt;
&lt;p&gt;Never use two columns as tweak values for each other or else the original plaintext for both columns will be unrecoverable.&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;em&gt;&lt;code&gt;format_name&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;


A string specifying the original FPE format used to generate the ciphertext. Note that SecureData has no way to tell if the value passed to it was actually encrypted or not, or what FPE format was used.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;em&gt;&lt;code&gt;is_masked&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;




&lt;p&gt;A boolean, whether to mask the value when decrypting the &lt;em&gt;&lt;code&gt;ciphertext&lt;/code&gt;&lt;/em&gt;. Masking is defined on a per-format basis on the SecureData Appliance.&lt;/p&gt;
&lt;p&gt;Note that since masking is optional, you must specify whether to decrypt with masking enabled. If you omit the masking parameter, the plaintext will be unmasked by default:&lt;/p&gt;
&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;em&gt;&lt;code&gt;config_file&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;



String containing the file name of the configuration file to use when authenticating with the SecureData appliance. You must create this file using VoltageSecureConfigure. If you do not supply this parameter, you must set session parameters to configure access to SecureData. See &lt;a href=&#34;../../../en/voltage-securedata-integration/configuring-access-to-securedata/#&#34;&gt;Configuring access to SecureData&lt;/a&gt;. Any values set in session parameters override the values in this file.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;em&gt;&lt;code&gt;sd_identity&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;
A string containing the identity to use when decrypting the data. Because SecureData uses the identity to determine encryption keys, this identity much match the identity used to encrypt the data. If supplied, this value overrides any identity value set in the configuration file or session parameter.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following example decrypts a Social Security Number (SSN) originally encrypted with a predefined format.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
=&amp;gt; SELECT VoltageSecureAccess(&amp;#39;376-69-6789&amp;#39; USING PARAMETERS format=&amp;#39;ssn&amp;#39;);

 VoltageSecureAccess
---------------------
 123-45-6789
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This example demonstrates decrypting an encrypted column within a query.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT id,
          first_name,
          last_name,
          VoltageSecureAccess(ssn USING PARAMETERS format=&amp;#39;ssn&amp;#39;,
                              config_dfs_path=&amp;#39;/voltagesecure/conf&amp;#39;) AS ssn,
          dob
      FROM customers
      WHERE dob &amp;lt; &amp;#39;1970-1-1&amp;#39;
      ORDER BY id ASC
      LIMIT 10;

  id  | first_name | last_name  |     ssn     |    dob
------+------------+------------+-------------+------------
 5346 | Talon      | Wilkins    | 540-48-0784 | 1941-09-17
 5347 | Daquan     | Phelps     | 785-34-0092 | 1963-05-08
 5348 | Basia      | Lopez      | 011-85-0705 | 1940-04-29
 5349 | Kaseem     | Hendrix    | 672-57-0309 | 1942-03-11
 5350 | Omar       | Lott       | 825-45-0131 | 1956-02-17
 5352 | Illana     | Middleton  | 831-47-0929 | 1949-12-29
 5353 | Garrett    | Williamson | 408-73-0207 | 1955-11-06
 5354 | Hanna      | Ware       | 694-97-0394 | 1967-08-08
 5355 | Quinn      | Pruitt     | 818-91-0359 | 1965-11-14
 5356 | Clayton    | Santiago   | 102-56-0010 | 1958-02-02
(10 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following example decrypts Unicode using a predefined format. For a full list of predefined formats, consult the Voltage SecureData documentation.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
=&amp;gt; SELECT VoltageSecureAccess(&amp;#39;607-Òdìçç-ぶてぴねら&amp;#39; using parameters format=&amp;#39;PREDEFINED::JU_AUTO_TYPE&amp;#39;);

 VoltageSecureAccess
----------------------
 123-Hello-こんにちは
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Decrypt a SSN ciphertext with the original FPE format and tweak value:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT VoltageSecureAccess(&amp;#39;721-21-2913&amp;#39;, &amp;#39;tweakvalue123&amp;#39; USING PARAMETERS
                                  format=&amp;#39;ssn-tweak&amp;#39;,
                                  config_dfs_path=&amp;#39;voltage.conf&amp;#39;);
 VoltageSecureProtect
----------------------
 681-09-2913
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Decrypt a ciphertext that was encrypted with a masking format. This format obscures all but the last two characters of the decrypted plaintext.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
=&amp;gt; SELECT VoltageSecureAccess(&amp;#39;g3kbx6ru19&amp;#39;, USING PARAMETERS
                                  format=&amp;#39;maskedFormat&amp;#39;,
                                  config_dfs_path=&amp;#39;voltage.conf&amp;#39;);
 VoltageSecureAccess
----------------------
 1234567890

=&amp;gt; SELECT VoltageSecureAccess(&amp;#39;g3kbx6ru19&amp;#39;, USING PARAMETERS
                                  format=&amp;#39;maskedFormat&amp;#39;,
                                  config_dfs_path=&amp;#39;voltage.conf&amp;#39;,
                                  mask=true);
 VoltageSecureAccess
----------------------
 XXXXXXXX90
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureconfigure/#&#34;&gt;VoltageSecureConfigure&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureprotect/#&#34;&gt;VoltageSecureProtect&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureprotectallkeys/#&#34;&gt;VoltageSecureProtectAllKeys&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/voltage-securedata-integration/encrypting-decrypting-and-hashing-data/#&#34;&gt;Encrypting, decrypting, and hashing data&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/voltage-securedata-integration/best-practices-safe-unicode-fpe/#&#34;&gt;Best practices for safe unicode FPE&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Voltage-Securedata-Integration: VoltageSecureConfigure</title>
      <link>/en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureconfigure/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureconfigure/</guid>
      <description>
        
        
        &lt;p&gt;Saves SecureData user access configuration parameters to a file in the Vertica Distributed File System (DFS). You then pass the file&#39;s name to the other SecureData integration functions. This function can store the configuration file in the user&#39;s own DFS directory or in a globally-accessible file named &lt;code&gt;/voltagesecure/conf&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;VoltageSecureConfigure(USING PARAMETERS config_dfs_path=&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;filename&lt;/span&gt;&amp;#39;
                              [, identity=&lt;span class=&#34;code-variable&#34;&gt;sd_identity&lt;/span&gt;]
                              [, store_password=&lt;span class=&#34;code-variable&#34;&gt;Boolean&lt;/span&gt;]
                              [, store_shared_secret=&lt;span class=&#34;code-variable&#34;&gt;Boolean&lt;/span&gt;]
                              [, username=&lt;span class=&#34;code-variable&#34;&gt;sd_user&lt;/span&gt;]
                  ) OVER ();
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;paremeters&#34;&gt;Paremeters&lt;/h2&gt;

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;config_dfs_path&lt;/code&gt;=&#39;&lt;em&gt;filename&lt;/em&gt;&#39;&lt;/td&gt; 

&lt;td &gt;






&lt;p&gt;Required. A string containing the path for the configuration file in DFS. This is either:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;A file name (without any path information). The function automatically stores the file in a DFS directory named for the user. Creating this directory prevents different user&#39;s files from overwriting one another.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The absolute path &lt;code&gt;/voltagesecure/conf&lt;/code&gt;. All users can use this file in calls to the other functions in the SecureData library. This path is the only absolute one that VoltageSecureConfigure allows for this parameter.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;identity=&lt;/code&gt;&lt;em&gt;&lt;code&gt;sd_boolean&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;
A string containing identity to use with the SecureData Appliance. This is usually in the form of an email address. When SecureData uses LDAP authentication, it uses this value to authenticate the user.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;store_password=&lt;/code&gt;&lt;em&gt;&lt;code&gt;Boolean&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;
A Boolean value. When set to true, OpenText™ Analytics Database stores the LDAP password stored in the password session parameter in the configuration file. Defaults to false.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;store_shared_secret=&lt;/code&gt;&lt;em&gt;&lt;code&gt;Boolean&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;
A Boolean value. When set to true, the database stores the shared secret set in the shared_secret session parameter in the configuration file. Defaults to false.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;username=&lt;/code&gt;&lt;em&gt;&lt;code&gt;sd_user&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;
A string containing the user name for authenticating with SecureData.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Any SecureData session variables that are set override values from the configuration file. See &lt;a href=&#34;../../../en/voltage-securedata-integration/configuring-access-to-securedata/#&#34;&gt;Configuring access to SecureData&lt;/a&gt; for more information.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
The SecureData integration only supports one configuration for the SecureData Appliance at a time.
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Under normal circumstances, users are not able to directly read data from files stored in DFS. However, all users who have access to UDx functions that read from the DFS could access these files from within Vertica.&lt;/p&gt;
&lt;p&gt;In addition, these files are stored as plain text in every node&#39;s file system. Anyone with the proper file system access on the nodes can read the file&#39;s contents.&lt;/p&gt;
&lt;p&gt;You should take both of these facts into consideration when deciding whether to store sensitive information such as passwords or shared secrets in either the shared or per-user configuration files.&lt;/p&gt;

&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;example&#34;&gt;Example&lt;/h2&gt;
&lt;p&gt;The following example demonstrates saving configuration information to a configuration file named voltage.conf in the user&#39;s own OpenText™ Analytics Database DFS directory.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; \x
Expanded display is on.
=&amp;gt; SELECT VoltageSecureConfigure(USING PARAMETERS config_dfs_path=&amp;#39;voltage.conf&amp;#39;,
                                 username=&amp;#39;alice&amp;#39;, identity=&amp;#39;alice@example.com&amp;#39;, store_password=false
                                ) OVER ();
-[ RECORD 1 ]-----+----------------------------------------------------------------
config_dfs_path   | voltage.conf
identity          | alice@example.com
username          | alice
&lt;/code&gt;&lt;/pre&gt;

      </description>
    </item>
    
    <item>
      <title>Voltage-Securedata-Integration: VoltageSecureConfigureGlobal</title>
      <link>/en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureconfigureglobal/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureconfigureglobal/</guid>
      <description>
        
        
        &lt;p&gt;Saves global SecureData access configuration parameters for all users to a file in the Vertica Distributed File System (DFS). This function stores the configuration file file named &lt;code&gt;/voltagesecure/conf.global&lt;/code&gt; in the distributed file system (DFS). You must use this function to configure at least the SecureData policy URL before you can use any of the other Voltage SecureData integration functions.&lt;/p&gt;
&lt;p&gt;To refresh the client policy, see &lt;a href=&#34;../../../en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecurerefreshpolicy/#&#34;&gt;VoltageSecureRefreshPolicy&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;VoltageSecureConfigureGlobal(USING PARAMETERS policy_url=&lt;span class=&#34;code-variable&#34;&gt;url&lt;/span&gt;
                              [, allow_short_fpe=&lt;span class=&#34;code-variable&#34;&gt;Boolean&lt;/span&gt;]
                              [, allow_file_cache=&lt;span class=&#34;code-variable&#34;&gt;Boolean&lt;/span&gt;]
                              [, network_timeout=&lt;span class=&#34;code-variable&#34;&gt;Integer&lt;/span&gt;]
                            ) OVER ();
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;policy_url=&lt;/code&gt;&lt;em&gt;&lt;code&gt;url&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;
A string containing the URL of the SecureData policy file. The Vertica SecureData library uses the contents of this file, such as the formats that the SecureData Appliance supports. It also uses the URL of this file to determine the location of the SecureData Appliance.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;allow_short_fpe=&lt;/code&gt;&lt;em&gt;&lt;code&gt;Boolean&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;


A Boolean value. When set to True, SecureData ignores the lower length limit for encoding FPE values. Usually, SecureData does not use FPE to encrypt data shorter than a lower limit (usually, 8 bits). See the &lt;em&gt;SecureData Architecture Guide&lt;/em&gt;&#39;s section on Data Length Restrictions for more information.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;enable_file_cache=&lt;/code&gt;&lt;em&gt;&lt;code&gt;Boolean&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;


A Boolean value. When set to True, Vertica caches the SecureData policy file and encryption keys to disk, rather than just to memory. Defaults to false.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;network_timeout=&lt;/code&gt;&lt;em&gt;&lt;code&gt;Integer&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;


An Integer value. Configures the network timeout in seconds. Defaults to its maximum value of 300 seconds.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;h2 id=&#34;example&#34;&gt;Example&lt;/h2&gt;
&lt;p&gt;To set the policy URL to &lt;a href=&#34;https://voltage-pp-0000.example.com/policy/clientPolicy.xml&#34;&gt;https://voltage-pp-0000.example.com/policy/clientPolicy.xml&lt;/a&gt; and set the network timeout to 200 seconds:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT VoltageSecureConfigureGlobal(USING PARAMETERS
                                       policy_url=&amp;#39;https://voltage-pp-0000.example.com/policy/clientPolicy.xml&amp;#39;,
                                       NETWORK_TIMEOUT=200)
                                       OVER ();

                           policy_url                            | allow_short_fpe | enable_file_cache | network_timeout
-----------------------------------------------------------------+-----------------+-------------------+-----------------
 https://voltage-pp-0000.example.com/policy/clientPolicy.xml     |                 |                   | 200
(1 row)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To view the current policy:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT VoltageSecureConfigureGlobal() OVER();
                           policy_url                            | allow_short_fpe | enable_file_cache | network_timeout
-----------------------------------------------------------------+-----------------+-------------------+-----------------
 https://voltage-pp-0000.example.com/policy/clientPolicy.xml     |                 |                   | 200
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Manually refresh the client policy across the nodes:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT VoltageSecureRefreshPolicy() OVER ();
                                  PolicyRefresh
-------------------------------------------------------------------------------------
Successfully refreshed policy on node [v_sandbox_node0001]. Policy on other nodes
will be refreshed the next time a Voltage operation is run on them.
(1 row)
&lt;/code&gt;&lt;/pre&gt;

      </description>
    </item>
    
    <item>
      <title>Voltage-Securedata-Integration: VoltageSecureProtect</title>
      <link>/en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureprotect/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureprotect/</guid>
      <description>
        
        
        &lt;p&gt;Calls SecureData to encrypt or hash a value while preserving the structure of the original plaintext.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;VoltageSecureProtect(&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;plaintext&lt;/span&gt;&amp;#39; [, &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;tweak&lt;/span&gt;&amp;#39;] USING PARAMETERS
                    format=&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;format_name&lt;/span&gt;&amp;#39;
                    [, config_dfs_path=&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;config_file&lt;/span&gt;&amp;#39;]
                    [, identity=&lt;span class=&#34;code-variable&#34;&gt;sd_identity&lt;/span&gt;]);
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;td &gt;
&lt;em&gt;&lt;code&gt;plaintext&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;




&lt;p&gt;VARCHAR value to encrypt. You must cast other data types (for example DATE values) to VARCHAR when calling this function.&lt;/p&gt;
&lt;p&gt;NULL values return NULL.&lt;/p&gt;
&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;em&gt;&lt;code&gt;tweak&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;













&lt;p&gt;VARCHAR value analogous to a &lt;a href=&#34;https://en.wikipedia.org/wiki/Salt_(cryptography)&#34;&gt;salt&lt;/a&gt; that allows equivalent *&lt;code&gt;plaintext&lt;/code&gt;*s to produce different ciphertexts. The same &lt;code&gt;tweak&lt;/code&gt; value must for encryption and decryption of a given plaintext.&lt;/p&gt;
&lt;p&gt;When encrypting or hashing an entire column, you can pass another column for a set of &lt;em&gt;&lt;code&gt;tweak&lt;/code&gt;&lt;/em&gt; values.&lt;/p&gt;
&lt;div class=&#34;admonition caution&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Caution&lt;/h4&gt;
&lt;p&gt;Never use two columns as tweak values for each other or else the original plaintext for both columns will be unrecoverable.&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;em&gt;&lt;code&gt;format_name&lt;/code&gt;&lt;/em&gt;&#39;&lt;/td&gt; 

&lt;td &gt;















&lt;p&gt;String specifying a format-preserving encryption (FPE) or format-preserving hash (FPH) format to encrypt or hash the &lt;em&gt;&lt;code&gt;plaintext&lt;/code&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;To encrypt your data, pass an FPE format defined in your SecureData Appliance.&lt;/p&gt;
&lt;p&gt;To hash your data, pass an FPH format defined in your SecureData Appliance (version 6.6+). Note that hashing operations are one-way and cannot be reversed with &lt;a href=&#34;../../../en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureaccess/#&#34;&gt;VoltageSecureAccess&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&#34;admonition caution&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Caution&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Always use the same FPE format to encrypt data in a column.&lt;/strong&gt; If you use different FPE formats in the same column (such as loading some data using &lt;code&gt;ssn&lt;/code&gt; and other data using &lt;code&gt;auto&lt;/code&gt;) there is no way to tell which format was used for any particular row, and properly and improperly encrypted ciphertexts will be indistinguishable.&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;em&gt;&lt;code&gt;config_file&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;



String containing the file name of the configuration file to use when authenticating with the SecureData appliance. You must create this file using VoltageSecureConfigure. If you do not supply this parameter, you must set session parameters to configure access to SecureData. See &lt;a href=&#34;../../../en/voltage-securedata-integration/configuring-access-to-securedata/#&#34;&gt;Configuring access to SecureData&lt;/a&gt;. Any values set in session parameters override the values in this file.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;em&gt;&lt;code&gt;sd_identity&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;
String containing the identity to use when authenticating with SecureData. SecureData uses this value as a basis for the encryption key. This value usually takes the form of an email address. If supplied, it overrides any values set in the configuration file or session parameters.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;Encrypt a social security number (SSN) value using both the &lt;code&gt;ssn&lt;/code&gt; and &lt;code&gt;auto&lt;/code&gt; FPE formats (this example assumes that all of the necessary SecureData authentication information has been set in session variables):&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
=&amp;gt; SELECT VoltageSecureProtect(&amp;#39;123-45-6789&amp;#39; USING PARAMETERS format=&amp;#39;ssn&amp;#39;);
 VoltageSecureProtect
----------------------
 376-69-6789
(1 row)

=&amp;gt; SELECT VoltageSecureProtect(&amp;#39;123-45-6789&amp;#39; USING PARAMETERS format=&amp;#39;auto&amp;#39;);
 VoltageSecureProtect
----------------------
 820-31-5110
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Encrypt two table columns in a COPY statement, authenticating to the SecureData Appliance with the user&#39;s private configuration file saved in DFS:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
=&amp;gt; COPY customers (id, first_name, last_name, ssn_raw FILLER VARCHAR(11),
                   cc_num_raw FILLER VARCHAR(25), cvv, dob,
                   ssn AS VoltageSecureProtect(ssn_raw USING PARAMETERS
                                               format=&amp;#39;ssn&amp;#39;,
                                               config_dfs_path=&amp;#39;voltage.conf&amp;#39;),
                   cc_num AS VoltageSecureProtect(cc_num_raw USING PARAMETERS
                                                  format=&amp;#39;cc&amp;#39;,
                                                  config_dfs_path=&amp;#39;voltage.conf&amp;#39;))
        FROM &amp;#39;/home/dbadmin/customer_data.csv&amp;#39; DELIMITER &amp;#39;,&amp;#39;;
 Rows Loaded
-------------
         100
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Query for a particular value in an encrypted column:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT id, first_name, last_name FROM customers
       WHERE ssn = VoltageSecureProtect(&amp;#39;559-32-0670&amp;#39; USING PARAMETERS
                                        format=&amp;#39;ssn&amp;#39;,
                                        config_dfs_path=&amp;#39;voltage.conf&amp;#39;);

  id  | first_name | last_name
------+------------+-----------
 5345 | Thane      | Ross
(1 row)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Encrypting NULL values returns NULL:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
=&amp;gt; CREATE TABLE nulltable(n VARCHAR (20));
=&amp;gt; INSERT INTO nulltable VALUES (NULL);

=&amp;gt; SELECT VoltageSecureProtect(n USING PARAMETERS format=&amp;#39;auto&amp;#39;) FROM nulltable;
VoltageSecureProtect
---------------------

(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Encrypt a Unicode string using a predefined format. For a full list of predefined formats, consult the Voltage SecureData documentation.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
=&amp;gt; SELECT VoltageSecureProtect(&amp;#39;123-Hello-こんにちは&amp;#39; USING PARAMETERS format=&amp;#39;PREDEFINED::JU_AUTO_TYPE&amp;#39;);
VoltageSecureProtect
----------------------
607-Òdìçç-ぶてぴねら
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Encrypt a SSN with a tweak value:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
=&amp;gt; SELECT VoltageSecureProtect(&amp;#39;681-09-2913&amp;#39;, &amp;#39;tweakvalue123&amp;#39; USING PARAMETERS
    format=&amp;#39;ssn-tweak&amp;#39;);

 VoltageSecureProtect
----------------------
 721-21-2913

=&amp;gt; SELECT VoltageSecureAccess(&amp;#39;721-21-2913&amp;#39;, &amp;#39;tweakvalue123&amp;#39; USING PARAMETERS
    format=&amp;#39;ssn-tweak&amp;#39;);

 VoltageSecureProtect
----------------------
 681-09-2913
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Hash a SSN with a FPH format and a tweak value:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
=&amp;gt; SELECT VoltageSecureProtect(&amp;#39;681-09-2913&amp;#39;, &amp;#39;tweakvalue123&amp;#39; USING PARAMETERS
                                  format=&amp;#39;ssnHash&amp;#39;,
                                  config_dfs_path=&amp;#39;voltage.conf&amp;#39;);
VoltageSecureProtect
----------------------
841-68-2913
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureaccess/#&#34;&gt;VoltageSecureAccess&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureprotectallkeys/#&#34;&gt;VoltageSecureProtectAllKeys&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/voltage-securedata-integration/encrypting-decrypting-and-hashing-data/#&#34;&gt;Encrypting, decrypting, and hashing data&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/voltage-securedata-integration/best-practices-safe-unicode-fpe/#&#34;&gt;Best practices for safe unicode FPE&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Voltage-Securedata-Integration: VoltageSecureProtectAllKeys</title>
      <link>/en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureprotectallkeys/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureprotectallkeys/</guid>
      <description>
        
        
        &lt;p&gt;This function helps you locate values in a column encrypted using an Embedded Format Preserving Encryption (eFPE) format. These formats use key rotation, so the encrypted value you get back for a piece of plain text changes over time. You pass this function an unencrypted value. It returns a table consisting of two columns: the unencrypted value and the value encrypted with each of the keys defined for the eFPE. The number of rows in the table are determined by the number of keys the eFPE format contains. Usually, you use the output of this function in a join to locate a matching encrypted value in a table.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;VoltageSecureProtectAllKeys(value USING PARAMETERS format=&amp;#39;eFPE_format&amp;#39;
                            [, config_dfs_path=&lt;span class=&#34;code-variable&#34;&gt;config_file&lt;/span&gt;]
                            [, identity=&lt;span class=&#34;code-variable&#34;&gt;sd_identity&lt;/span&gt;] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;

&lt;table class=&#34;table table-bordered&#34; &gt;



&lt;tr&gt; 

&lt;td &gt;
&lt;em&gt;&lt;code&gt;value&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;
VARCHAR containing the value to encrypt. You must cast other data types (for example DATE values) to VARCHAR when calling this function.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;format=&lt;/code&gt;&lt;em&gt;&lt;code&gt;eFPE_format&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;


String containing the name of an eFPE format defined by SecureData. This format must be an eFPE format defined by your SecureData Appliance, or the function returns an error. This format must also match the format of value. VoltageSecureProtectAllKeys returns an error if &lt;em&gt;&lt;code&gt;value&lt;/code&gt;&lt;/em&gt;&#39;s format does not match the one you specify in &lt;em&gt;&lt;code&gt;eFPE_format&lt;/code&gt;&lt;/em&gt;.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;config_dfs_path=&lt;/code&gt;&lt;em&gt;&lt;code&gt;config_file&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;



String containing the file name of the configuration file to use when authenticating with the SecureData appliance. You must create this file using VoltageSecureConfigure. If you do not supply this parameter, you must set session parameters to configure access to SecureData. See &lt;a href=&#34;../../../en/voltage-securedata-integration/configuring-access-to-securedata/#&#34;&gt;Configuring access to SecureData&lt;/a&gt;. Any values set in session parameters override the values in this file.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt; 

&lt;td &gt;
&lt;code&gt;identity=&lt;/code&gt;&lt;em&gt;&lt;code&gt;sd_identity&lt;/code&gt;&lt;/em&gt;&lt;/td&gt; 

&lt;td &gt;
String containing the identity to use when authenticating with SecureData. SecureData uses this value as a basis for the encryption key. This value usually takes the form of an email address. If supplied, it overrides any values set in the configuration file or session parameters.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following example demonstrates a simple call to VoltageSecureProtectAllKeys.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT VoltageSecureProtectAllKeys(&amp;#39;376765616314013&amp;#39; USING PARAMETERS
                                      format=&amp;#39;cc_num&amp;#39;,
                                      config_dfs_path=&amp;#39;/voltagesecure/conf&amp;#39;)
          OVER ();

      data       |    protected
-----------------+-----------------
 376765616314013 | XMVMRU9RJVU4013
 376765616314013 | X5FD4KO1UEE4013
 376765616314013 | M7ZXTIQVCPB4013
 376765616314013 | UBOSC9K3EXZ4013
 376765616314013 | ZJ1C50C9L9R4013
(5 rows)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this example, the cc_num eFPE format has five keys defined for it, so the return value is a table containing five rows.&lt;/p&gt;
&lt;p&gt;The following example shows a more common use: querying a table column that is encrypted using an eFPE format.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT id, first_name, last_name FROM customers3 u
          JOIN (SELECT VoltageSecureProtectAllKeys(&amp;#39;376765616314013&amp;#39; USING PARAMETERS
                                                   format=&amp;#39;cc_num&amp;#39;,
                                                   config_dfs_path=&amp;#39;/voltagesecure/conf&amp;#39;)
          OVER ()) pak
          ON u.cc_num = pak.protected;

  id  | first_name | last_name
------+------------+-----------
 5345 | Thane      | Ross

(1 row)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the previous example, the customers3 table is joined to the output from VoltageSecureProtectAllKeys. Any rows in the customers3 table where the encryted cc_num column value matches values from the protected column of VoltageSecureProtectAllKeys matches appear in the output.&lt;/p&gt;
&lt;p&gt;This function returns an error if you use it on a non-eFPE format:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT first_name, last_name, ssn FROM customers u
        JOIN (
            SELECT VoltageSecureProtectAllKeys(&amp;#39;232-28-0657&amp;#39; USING PARAMETERS format=&amp;#39;ssn&amp;#39;,
                                               config_dfs_path=&amp;#39;/voltagesecure/conf&amp;#39;)
            OVER ()
        )
        pak ON u.ssn = pak.protected;
ERROR 5861:  Error calling processPartition() in User Function VoltageSecureProtectAllKeys
at [ProtectAllKeys.cpp:21], error code: 1711, message: Error getting key numbers:
eFPE format required
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/voltage-securedata-integration/configuring-access-to-securedata/#&#34;&gt;Configuring access to SecureData&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureaccess/#&#34;&gt;VoltageSecureAccess&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureprotect/#&#34;&gt;VoltageSecureProtect&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#&#34;&gt;VoltageSecureProtectAllKeys&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Voltage-Securedata-Integration: VoltageSecureRefreshPolicy</title>
      <link>/en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecurerefreshpolicy/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecurerefreshpolicy/</guid>
      <description>
        
        
        &lt;p&gt;Immediately refreshes the client policy on the initiator node. Policies on non-initiator nodes are refreshed the next time a Voltage function is called on them.&lt;/p&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;VoltageSecureRefreshPolicy()
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;p&gt;None&lt;/p&gt;
&lt;h2 id=&#34;example&#34;&gt;Example&lt;/h2&gt;
&lt;p&gt;Manually refresh the client policy across the nodes:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT VoltageSecureRefreshPolicy() OVER ();
                                  PolicyRefresh
-------------------------------------------------------------------------------------
Successfully refreshed policy on node [v_sandbox_node0001]. Policy on other nodes
will be refreshed the next time a Voltage operation is run on them.
(1 row)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureconfigure/#&#34;&gt;VoltageSecureConfigure&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureprotect/#&#34;&gt;VoltageSecureProtect&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/voltage-securedata-integration/voltage-securedata-integration-function-reference/voltagesecureprotectallkeys/#&#34;&gt;VoltageSecureProtectAllKeys&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../en/voltage-securedata-integration/encrypting-decrypting-and-hashing-data/#&#34;&gt;Encrypting, decrypting, and hashing data&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
  </channel>
</rss>
