FEATURES

Stream large files

Large files can be encrypted, played and exported in chunks.

Large files are not pushed through memory in one piece: XChaCha20-Poly1305 secretstream encrypts in individually authenticated 1-MiB blocks — up to 64 GiB per file, without a RAM limit.

How CryptArx protects large files

You do not encrypt a 30-GB video file by loading it completely into memory — an iPhone has only a few gigabytes. Apps that “just apply AES” fail exactly here: either they load everything at once and crash, or they cut the file and lose the integrity of the whole.

CryptArx uses libsodium secretstream: the algorithm splits the file into 1-MiB blocks and authenticates each one — cryptographically chained so that blocks can neither be swapped, removed nor appended without decryption failing.

The result: memory usage stays constantly small, no matter how large the file is. Export, backup and playback run block-wise — a video jumps to the target without decrypting the complete file.

The difference

“The file is AES encrypted” says nothing about how it is treated in memory. Secretstream is an algorithm for exactly this problem: unlimited length, constant memory, every block individually authenticated.

How it works, step by step

  1. 01

    The stream is initialized

    On import, CryptArx creates a secretstream context from the file key: header and initial state define the beginning of the chain.

  2. 02

    Every block individually authenticated

    The file runs through XChaCha20-Poly1305 in 1-MiB steps — every block gets its own authentication tag and a chained state.

  3. 03

    The stream closes

    The last block carries an end marker: the chain is complete or invalid — a truncated end is not a valid end.

  4. 04

    Playback and export stream the same way

    Playback, .vaultbackup export and restore run block-wise: data is read, processed and passed on — never all held at once.

The encryption flow

Your fileany size
SecretstreamXChaCha20-Poly1305
1-MiB blockseach authenticated
Encrypted fileup to 64 GiB

The math behind it — in plain text

1 MiBblock size
64 GiBmax. file size
0RAM limit

Why chaining secures integrity

Every block authenticates against the chain state: whoever deletes, swaps or replaces block 7 with a foreign one breaks the chain — decryption reports manipulation instead of silently delivering other data. Integrity is in the format, not in a separate checksum.

Constant memory instead of all at once

Memory holds only the current block plus stream state — megabytes instead of gigabytes. That is exactly what makes 64 GiB possible on a phone: the limit is free storage, not RAM.

libsodium, pinned

The implementation is libsodium 0.9.1, firmly pinned — no fluctuating dependency tree. XChaCha20 extends the nonce to 192 bits: random nonces are therefore safe even with billions of blocks.

What an attack would have to overcome

Manipulating blocks

Every block carries authentication and chain state — inserting, deleting, swapping or truncating fails. The attacker can destroy files but not alter them unnoticed.

Failing at size

There is no size at which protection gives up: memory stays constant, authentication applies per block. Whether 50 MB or 50 GB — the math is the same.

Attacking via playback

Streaming playback decrypts block-wise in the process — no complete plaintext file is created on disk that a second process could read along.

Honest limits

Free storage is the real limit

64 GiB is the format limit — what works in everyday life is determined by free storage and the device. And as everywhere: during playback, decrypted blocks exist in the app process.

CryptArx for iPhone

Requires iOS 17 or later. The App Store link is pending for this preview.