Confidential  ·  Internal Use Only

NCryptAES
Application Security Review

Principal Security Engineer Audit  ·  Xojo Desktop Application  ·  AES-256-CBC + HMAC-SHA256

Revision  2.5
Date  2026-09-14
Auditor  Claude Code
Scope  Full Source
Open No open findings
Positive Security Controls
The following controls are correctly and robustly implemented — no action required
User Security Advice
Steps you can take to get the most protection from NCryptAES
Terminology
Plaintext
The readable, unencrypted data — the text you type or the original file — before NCryptAES protects it, and what you get back after a successful decrypt.
Ciphertext
The scrambled output produced by encryption. Without the shared secret it is indistinguishable from random noise and cannot be read.
Shared secret (passphrase)
The password both parties agree on. Everything NCryptAES protects rests on this one value: it is never stored, and the same secret used to encrypt must be supplied to decrypt.
AES-256-CBC
The encryption algorithm. AES (Advanced Encryption Standard) with a 256-bit key is the symmetric cipher; CBC (Cipher Block Chaining) is the mode that chains each block to the one before so identical blocks do not encrypt identically.
Symmetric encryption
A scheme where the same secret both locks and unlocks the data, as opposed to public-key systems that use a separate key for each direction.
IV (Initialization Vector)
A random 16-byte value mixed into the first block of CBC encryption. A fresh IV per encryption ensures the same plaintext and secret never produce the same ciphertext twice. It is not secret and is stored in the header.
Salt
A random 16-byte value combined with the passphrase before key derivation. It ensures two people using the same passphrase derive different keys and defeats pre-computed lookup tables. Like the IV, it is not secret and travels in the header.
PBKDF2
Password-Based Key Derivation Function 2 — the process that turns the passphrase into cryptographic keys by hashing it, together with the salt, many times over.
Iteration count / key stretching
The number of times PBKDF2 repeats its hashing (800,000 here). A high count makes each password guess deliberately slow, so brute-forcing a stolen file is expensive. This is called key stretching.
Key separation
Deriving two independent keys — one to encrypt, one to authenticate — rather than reusing a single key for both jobs, which is weaker cryptographic practice.
HMAC-SHA256 (MAC)
A Message Authentication Code: a keyed fingerprint of the data built on the SHA-256 hash. It proves the ciphertext was produced by someone who holds the secret and has not been altered in transit.
Encrypt-then-MAC
The order of operations used here: encrypt first, then compute the MAC over the result. On decrypt the MAC is checked before anything is decrypted, so tampered or forged data is rejected without being processed.
Padding-oracle attack
An attack against CBC in which an adversary learns the plaintext by submitting altered ciphertexts and observing whether the padding was valid. Verifying the MAC before decrypting closes this avenue.
PKCS7 padding
The standard scheme that pads the final block out to AES's fixed block size before encryption and is stripped after decryption.
Constant-time comparison
Comparing two values (such as MACs) in a way that always takes the same time regardless of where they differ, so an attacker cannot learn the correct value byte by byte from timing.
Side-channel / timing attack
An attack that infers secrets not from the algorithm itself but from indirect signals such as how long an operation takes. Constant-time comparison is a defence against the timing variety.
Zeroing
Deliberately overwriting keys, passphrases, and plaintext buffers in memory with zeros as soon as they are finished with, so they do not linger where they could later be recovered.
Header / versioned container
The fixed structure at the front of every encrypted output — a version byte, the iteration count, the salt, and the IV — all covered by the MAC. The version byte lets the format evolve while older files remain decryptable.
Base64
A text encoding that represents raw bytes using ordinary printable characters, so encrypted output from the Text tab can be safely pasted into email or chat. The file format skips this wrapper and stores the raw bytes.
Zip Slip
An attack where a malicious archive contains entry names like ../../file that, when extracted naively, write outside the intended folder. NCryptAES screens every archive path before extraction to prevent it.
Full-disk encryption
Operating-system encryption of the whole drive — FileVault, BitLocker, or LUKS — that protects data at rest, including temporary files and swap that individual applications cannot reliably erase.
Digital signature (Ed25519)
A cryptographic seal proving who produced a piece of data and that it has not been altered. The developer signs each licence with a private key; the app checks that signature with the matching public key. Ed25519 is a modern, fast elliptic-curve signature scheme. Here it authenticates the licence file — not the encrypted data, which is protected separately by the shared secret.
Public / private key pair
Two mathematically linked keys where one signs and the other verifies. The private (signing) key is kept secret by the developer; the public (verification) key can be shipped inside the application without weakening anything, because it can only check signatures, never create them.