Protegrity Format Preserving Encryption
The Protegrity Format Preserving Encryption (FPE) encrypts input data of a specified format and generates output data, ciphertext, of the same format.
In the Protegrity’s Format Preserving Encryption (FPE), input data is encrypted using a block cipher method. A cryptographic key and algorithm are applied to a block of data at once, rather than one bit at a time. For example, using FPE, a 16-digit credit card number is encrypted such that the generated ciphertext is another 16-digit number. Since encrypted data retains its original format with FPE, there is no need for any schema-related changes to the database or application.
Protegrity supports FPE using NIST-approved Format preserving, Feistel based type 1 (FF1) mode of operation with AES-256 block cipher encryption algorithm.
Protegrity Format Preserving Encryption (FPE) currently supports encryption using AES-256 block cipher algorithm.
For more information about the AES-256 algorithm, refer to AES-256.
1 - FPE Properties
The FPE properties are specified when creating a data element with FPE method.
The following table describes the properties provided by FPE.
Table: FPE Properties
FPE Property | Description |
User configured FPE properties |
Name | Unique name that identifies the FPE data element. |
Protection Method | FPE NIST 800-38G NIST 800-38G is the recommended FPE specification by NIST that identifies the supported FPE cipher. |
Plaintext Alphabet | Plaintext alphabet type of the data that is to be encrypted. The following data types are supported for encryption:- Numeric
- Alpha
- Alpha-Numeric
- Unicode Basic Latin and Latin-1 Supplement Alpha
- Unicode Basic Latin and Latin-1 Supplement Alpha-Numeric
The plaintext alphabet maps to code points that denotes a range of accepted characters. For more information about code point mappings, refer to Code points. |
Minimum Input Length | The default minimum supported input data length is 2 bytes and configurable up to 10 bytes. The default minimum supported input length for Credit Card Number (CCN) is 8 bytes and configurable up to 10 bytes. |
Tweak Input Mode | The tweak input process ensures that the same data in different position encrypts to a unique value. Tweak input can be derived from the following options:- Extract from input message
- API Argument
|
From Left | Number of characters from left to retain in clear in encrypted output. |
From Right | Number of characters from right to retain in clear in encrypted output. |
Allow Short Data | Data is considered short when the amount of encrypted characters is less than the "Minimum Input Length". Based on whether the short data is supported or not, the possible options are "No, generate error", or "No, return input as it is". This is supported by Numeric and Alpha-Numeric data types only. The FPE does not support data less than 2 bytes, hence you can set the minimum input length value accordingly. For more information about short data support, refer to Length Preserving. |
Special numeric alphabet handling | Here are the specific options for numeric data type validation with different Credit Card Number (CCN) checks: |
Read-only FPE properties |
Ciphertext Alphabet | Ciphertext alphabet type of the encrypted data. This property value is same as the Plaintext Alphabet value. |
Key Input | Internally generated by the active Key Store. For more information about the key store, refer to Key Store. |
FPE Mode | Mode of operation for the block cipher algorithm with FF1 as the supported mode. |
Pseudorandom Function (PRF) | Block cipher algorithm that is used for encryption with AES-256 as the supported algorithm. |
Feistel Rounds | 10 |
Max tweak length | The maximum supported tweak input length is 256 bytes. |
Support Delimiters | Any input other than the supported data type is treated as a delimiter. If the input contains only delimiters, then the output value is equal to the input. By default, delimiters are supported for Numeric and Alpha-Numeric data type. Credit Card Number (CCN) data type does not support delimiters. |
Preserve Length | The length preservation setting is true for:- Numeric
- Alpha
- Alpha-Numeric
- Unicode Basic Latin and Latin-1 Supplement Alpha
- Unicode Basic Latin and Latin-1 Supplement Alpha-Numeric
|
Other FPE properties |
Maximum Input Length (including delimiters) | The following are the maximum input lengths for the supported data types:- Numeric – 2 GB
- Alpha – 2 GB
- Alpha-Numeric – 2 GB
- Unicode Basic Latin and Latin-1 Supplement Alpha – 2GB
- Unicode Basic Latin and Latin-1 Supplement Alpha-Numeric – 2 GB
- Credit Card – 4096 bytes
The recommended maximum input size for the FPE data elements is 4096 characters. The performance decreases as the input length increases. |
Table: Examples of Format Preserving Encryption
| Input Value | Encrypted Value | Comments |
|---|
| 123456789012345 | 187868154999435 | Plaintext alphabet – Numeric
Tweak Input – Extract from Input Message
Left=1, Right=1
Allow Short Data = No, return input as it is
Minimum Input Length=3 |
| Protegrity1234567 | PyNqSJybYp1234567 | Plaintext alphabet – Alpha
Tweak Input – API Argument
Left=1, Right=0
Allow Short Data = No, generate error
Minimum Input Length=2 |
| Protegrity1234567 | ProZSNbyADNoPb2ns | Plaintext alphabet – Alpha-Numeric
Tweak Input – Extract from Input Message
Left=3, Right=0
Allow Short Data = No, return input as it is
Minimum Input Length=10 |
| 43211234567890 | 76454340562108 | Plaintext alphabet – CCN
Tweak Input – Extract from Input Message
Left=0, Right=0
Allow Short Data = No, generate error
Minimum Input Length=9
Invalid Card Type=True |
| þrõtégrîtÝ@123456789 | þràñTÿwõùÞ@123456789 | Plaintext alphabet – Unicode Basic Latin and Latin1 Supplement Alpha
Tweak Input – Extract from Input Message
Left=2, Right=1
Allow Short Data = No, generate error
Minimum Input Length=4 |
| þrõtégrîtÝ@123456789 | þrWtçjÑHÿÖ@9íKLksvp9 | Plaintext alphabet – Unicode Basic Latin and Latin1 Supplement Alpha-Numeric
Tweak Input – API Argument
Left=2, Right=1
Allow Short Data = No, return input as it is
Minimum Input Length=6 |
FPE Support for Protectors
- The maximum supported input length differs for different protectors based on the input length supported by the protector.
For more information maximum supported input length for different protectors, refer to Minimum and Maximum Input Length. - The maximum input length supported by the PTY.INS_UNICODENVARCHAR2 UDF for the Oracle Database Protectors is 2000 characters.
- If you are using Format Preserving Encryption (FPE) with Teradata UDFs, you can extend the maximum data length size provided by these UDFs, which is up to 47407 bytes by default.
- Starting from v10.0.x, the Format Preserving Encryption (FPE) is only supported by the following UDFs in Teradata Protector:
- pty_varcharunicodeins
- pty_varcharunicodesel
- pty_varcharunicodeselex
The maximum data length size for these UDFs can be modified in the createvarcharunicode.sql file.For more information about updating the output buffer parameter, refer to Updating the Output Buffer for the Teradata UDFs.
- The REPLACE_UDFVARCHARTOKENMAX parameter value for these functions can be set up to 64000. Teradata supports the maximum row size length of approximately 64000 bytes.
- Starting from v10.0.x, Masking is not supported for FPE data elements as the default encoding set is UTF-8.
- For FPE data elements, the External IV is only supported with the Alpha, Numeric, and Alpha-Numeric plaintext alphabets.
- The string as an input and byte as an output API is unsupported by FPE data elements for the AP Java and AP Python.
For more information about empty string handling by protectors, refer to Empty String Handling by Protectors.
2 - Code Points
The code points are coded character sets, where each character maps to unique numeric values for representation of that character.
The Unicode Standard is a character encoding system that supports the processing and representation of text from diverse languages. It includes various character encoding schemes, such as UTF-8 and UTF-16, which use character code points as input and generate encoded numeric values using pre-defined formulas.
The Unicode code space is divided into 17 planes:
- Basic Multilingual Plane (BMP): Contains the most commonly used characters.
- 16 Supplementary Planes
Format-Preserving Encryption (FPE) supports encryption for BMP with Basic Latin (ASCII) and Latin-1 supplement blocks of characters.
For more information about the Unicode Standard and code points, refer to http://www.unicode.org/ and http://www.unicode.org/charts/ respectively.
The following table represents the Unicode code points for FPE-supported plaintext alphabet types and encodings.
Table: Unicode Code Points for FPE-supported Plaintext Alphabet Types
| Plaintext Alphabet | Codepoint range |
|---|
| Numeric | U+0030 - U+0039 |
| Alpha | U+0041 - U+005A
U+0061 - U+007A |
| Alpha-Numeric | U+0030 - U+0039
U+0041 - U+005A
U+0061 - U+007A |
| Unicode Basic Latin and Latin-1 Supplement Alpha | U+0041 - U+005A
U+0061 - U+007A
U+00C0 - U+00FF (excluding U+00D7 and U+00F7) |
| Unicode Basic Latin and Latin-1 Supplement Alpha-Numeric | U+0030 - U+0039
U+0041 - U+005A
U+0061 - U+007A
U+00C0 - U+00FF (excluding U+00D7 and U+00F7) |
3 - Tweak Input
The tweak input can be used to encrypt the same input plaintext that results in different ciphertexts.
The tweak input is derived through either of the following methods:
- Extract from input message - If the tweak is set to be derived from input message, then the left and right property settings are used as a configurable tweak option.
- API argument - If the tweak is set to be derived through API argument, then the tweak value is provided as an input parameter through the API during the protect or unprotect operation.
The resultant tweak input is zero for the following conditions:
- When extracting the tweak from input message, the left and right property settings are set to zero.
- When tweak input is to be derived as an API argument, the tweak input parameter is empty or not specified.
The maximum supported tweak input length is 256 bytes.
4 - Left and Right Settings
The Left and Right Settings property indicates the number of characters from left and right that will remain in the clear and are excluded from format preserving encryption.
Starting from v10.0.x, the new FPE data elements created with the Left and Right settings cannot be deployed to the previous versions of protectors.
It is recommended not to use the Left and Right settings for the FPE token as these settings are not present in the version of FPE that has been approved by NIST. If you use the Left and Right settings, then it reduces the strength of the FPE token.
A maximum of 99 characters can be retained in clear with the left and right setting. These characters are used to generate the tweak.
5 - Handling Special Numeric Credit Card Data
The Handling Special Numeric Data process involves gathering a set of special numeric data and representing it in a different format.
The Format Preserving Encryption (FPE) for Credit Card Number (CCN) is handled by configuring numeric data type as the plaintext alphabet. The following default settings for CCN are applicable:
- Credit Card Number (CCN) data type does not support delimiters.
- Short Data Encryption is not supported by CCN. The CCN supports a minimum input length of 8 bytes.
For more information about Invalid Card Type (ICT), Invalid Luhn, and Alphabet Indicator validation for CCN, refer to Credit Card.