Compressed and RC4 Transport (CaRT) is a file format and an associated Python library used to 'neuter' files for secure distribution, particularly in the malware analysis community. It encrypts and compresses files, optionally embedding metadata, to prevent execution and detection by antivirus software. The library provides functionalities for packing and unpacking CaRT files and currently supports format version 1. It is actively maintained by Cybercentre Canada, with the latest stable release being 1.2.3.
pip install cartVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to pack a simple text file into the CaRT format and then unpack it using the synchronous API. The library handles compression and default ARC4 encryption.
Ensure your project runs on Python 3.6 or newer. Upgrade your Python environment if necessary.
When unpacking a CaRT file created with a private key, pass the identical key to the `key` argument of `unpack_file` or `unpack_stream` functions. For example: `unpack_file(cart_path, output_path, key=b'your_private_key')`.
Upgrade to `cart` version 1.2.3 or higher to benefit from the fix that prevents root path possibilities from metadata filenames.
No dependency data recorded yet.