File encryption
File encryption techniques
Technical explanation of the file encryption scheme and cryptographic methods used.
We implement a file encryption scheme where you encrypt a file (AES-256 CBC PKCS#7) and sign it (AES-256 CMAC) by using unique keys per file. The keys, along with information about the encrypted file contents, are stored in a header at the beginning of the file. The file is encrypted and signed in 48-kilobyte chunks that are chained together by using SHA-512 hashes. Each chunk contains a header with a unique initialization vector.
Currently, we support two versions of the file encryption algorithm. The main difference between the versions is how the keys that encrypt and sign the file are protected and used.
Version 1 uses keys that the HSM protects directly as X9.24 keys (referred to as HSM Trusted keys in the 6.3.1.x nomenclature). To decrypt and verify the file, you must stream the whole file to the HSM because the value of these keys is only accessible on the HSM. Version 6.1.4.x handles all keys in this way.
Version 2 uses keys that the HSM data encryption keys protect. The data encryption keys are X9.24 keys, but you can decrypt the keys they protect into clear values outside of the HSM (known as HSM Protected keys in 6.3.1.x nomenclature). This enables you to perform encryption and decryption without streaming the file to the HSM. These files are commonly encrypted or decrypted on the client side for performance. You must have appropriate access to the HSM to retrieve the clear values of the keys from the encrypted file header, and any client should destroy the clear key values immediately after the encryption or decryption finishes.

