Product Documentation

c-treeACE V11.0 Release Notes

Previous Topic

Next Topic

Improved Handling of Encryption Attributes During File Compact and Rebuild

The file compact utility (ctcmpcif) and the CompactIFile() API function now better handle file encryption The following improvements were made:

  1. The compact API function and utility can optionally change encryption attributes. To use this option when calling the compact API function, use the setIFILoptions() macro to set the setencryptIFILoption bit in the tfilno field of the IFIL structure whose address you pass to the compact API function, and call ctSETENCRYPT() with the desired encryption attributes before calling the compact API function. For example:

    NINT rc;

    myifil.tfilno = setIFILoptions(setencryptIFILoption);

    rc = ctSETENCRYPT(ctAES32, NULL, 32);

    rc = CMPIFIL(&myifil);

  2. The ctcmpcif utility now supports an option to specify the encryption cipher for the data and index files created by the compact operation. Usage:

    -encrypt=cipher - Create the compacted file using the specified cipher:

    • for AES, use aes16, aes24, or aes32
    • for Blowfish, use blf8, blf9, ..., or blf56
    • for DES, use des8, des16, or des24
    • for Twofish, use twf16, twf24, or twf32
    • for no encryption, use none
    • for the deprecated CAMO option, use camo:MY_ENCRYPTION_KEY Note: CAMO or "Camouflage" is an older, legacy method of hiding data, which is not a standards-conforming encryption scheme, such as AES. It is not intended as a replacement for Advanced Encryption or other security systems.

    Note: If an index file does not exist, the original data file's encryption attributes are used when creating that index file.

    To change the encryption attributes of a file using the compact API function from a client, you must add the option CHANGE_ENCRYPTION_ON_COMPACT YES to ctsrvr.cfg. Otherwise, the operation fails with error NSUP_ERR (454, not supported).

  3. Compact now always deletes and recreates index files after saving resources from the original index file. This provides the expected behavior of (possibly) reducing the size of the index file.

TOCIndex