AES-256 Encryption Guide: Military-Grade File Protection
Understand AES-256 encryption and why it's the gold standard for file protection. Learn how this military-grade cipher keeps your transfers secure.
AES-256 is a symmetric block cipher approved by the US NSA for TOP SECRET data under CNSSP-15. It encrypts 128-bit blocks with a 256-bit key across 14 rounds of substitution, permutation, and mixing operations. Brute-forcing a single AES-256 key would require roughly 2^255 operations on average — a number so large that every computer on Earth running for the age of the universe wouldn't crack it. That's why every serious file transfer service, from SwissTransfer to Tresorit, uses AES-256 as the bulk cipher. Here's how it actually works.
Where the "256" comes from
AES comes in three key sizes: 128, 192, and 256 bits. The number refers only to the key length, not the block size (which is always 128 bits). The key size determines how many rounds the cipher runs: 10 for AES-128, 12 for AES-192, 14 for AES-256.
More rounds mean more diffusion — each output bit depends on more input bits — and more resistance to cryptanalytic attacks like the biclique attack published in 2011, which theoretically reduced AES-256's effective security from 256 to 254.4 bits. That's still well beyond any practical attack.
Federal Information Processing Standard FIPS 197 defines AES, and NIST SP 800-38A through 800-38G define the operating modes.
Modes of operation: GCM vs CBC vs ECB
AES is a block cipher, meaning it only knows how to encrypt one 128-bit block. To encrypt a file of arbitrary size, you need a mode of operation. The choice matters enormously:
- ECB (Electronic Codebook): identical plaintext blocks produce identical ciphertext. Never use this. The infamous "ECB penguin" image shows Tux's outline visible through ECB-encrypted pixels.
- CBC (Cipher Block Chaining): XORs each block with the previous ciphertext. Secure if paired with HMAC for authentication, but CBC alone is vulnerable to padding oracle attacks (POODLE hit SSL in 2014).
- GCM (Galois/Counter Mode): encrypts with a counter and produces a 128-bit authentication tag in the same pass. Tampering with ciphertext breaks decryption loudly. This is what modern services use.
AES-256-GCM is the default in TLS 1.3, Signal, WireGuard, and every credible file transfer service. If a service mentions "AES-256" without specifying the mode, assume GCM and check.
The IV (nonce) you should never reuse
GCM requires a unique 96-bit initialization vector per encryption with a given key. Reuse an IV with the same key even once, and an attacker can XOR two ciphertexts together to recover plaintext — a catastrophic failure famously exploited against WEP Wi-Fi.
Best practice: generate the IV with a cryptographically secure RNG (crypto.getRandomValues() in browsers, /dev/urandom on Linux) and prepend it to the ciphertext. A 96-bit random IV has a collision probability of about 2^-48 after encrypting 2^32 files — acceptable for a file transfer service. For key reuse across billions of files, use a deterministic counter instead.
Key derivation: turning passwords into keys
Users want passwords like mydog2024. AES wants 256 bits of uniform randomness. The bridge is a key derivation function (KDF). Three are in common use:
- PBKDF2 with HMAC-SHA-256 and 600,000 iterations (OWASP 2023 recommendation). Widely supported, available in Web Crypto API.
- scrypt adds memory-hardness, raising GPU attack costs. Bitcoin and LastPass use it.
- Argon2id is the current best practice, winner of the 2015 Password Hashing Competition. Parameters:
memory=64 MB, iterations=3, parallelism=4.
A 12-character random password through Argon2id takes a modern GPU roughly a billion years to brute force. A weak password like password123 falls in milliseconds regardless of the KDF.
AES in the browser: the Web Crypto API
Browsers expose AES-256-GCM natively through window.crypto.subtle. A typical flow:
const key = await crypto.subtle.generateKey(
{ name: "AES-GCM", length: 256 },
true,
["encrypt", "decrypt"]
);
const iv = crypto.getRandomValues(new Uint8Array(12));
const ciphertext = await crypto.subtle.encrypt(
{ name: "AES-GCM", iv },
key,
fileBytes
);
Modern CPUs have AES-NI instructions that accelerate this to roughly 3–5 GB/s per core. A 1 GB file encrypts in under a second on a mid-range laptop. On mobile, Apple A-series and Qualcomm Snapdragon chips include ARMv8 Crypto Extensions for similar throughput.
What AES-256 protects against (and doesn't)
AES-256 solves one specific problem: confidentiality of data at rest or in transit, given that the key is secret. It doesn't solve:
- Key management. If you email the password alongside the file, AES-256 adds nothing.
- Endpoint compromise. Malware reading the plaintext before encryption bypasses the cipher entirely.
- Implementation bugs. The 2018 BEAST, CRIME, and Lucky13 attacks all targeted TLS implementations, not AES itself.
- Side-channel attacks. Cache timing and power analysis have extracted AES keys from constrained devices. AES-NI largely mitigates this on desktops.
AES-256 also doesn't prove who sent the file. For that, pair it with digital signatures using Ed25519 or ECDSA.
Why "military-grade" is mostly marketing
The phrase gets thrown around because NSA CNSSP-15 approved AES-256 for TOP SECRET data in 2003. That's real, but it's also 23 years old at this point — AES-128 is approved for SECRET and would serve most civilian use cases identically. The jump from 128 to 256 is a hedge against future advances in quantum computing: Grover's algorithm theoretically halves symmetric key security, reducing AES-256's effective strength to 128 bits, which is still secure.
In practice, AES-256 costs maybe 40% more CPU than AES-128 with AES-NI and is universally supported, so it's become the default even when 128 would suffice.
How to verify a service actually uses AES-256-GCM
Three ways to check:
- Read the security whitepaper. Credible services (Tresorit, Proton Drive, SwissTransfer, HexaTransfer) publish the exact mode and IV handling.
- Inspect the client code. Open DevTools, search the JavaScript bundle for
AES-GCMoraes-256-gcm. You should see it explicitly. - Check for third-party audits. Cure53, NCC Group, and Trail of Bits publish audits that name the algorithms reviewed.
Red flags: "bank-grade encryption" with no mode specified, "proprietary algorithm" of any kind, or references to AES-128-ECB.
Putting it to work
For sending a sensitive file today: choose a service that states AES-256-GCM explicitly, uses a 96-bit random IV per file, and runs the encryption in your browser (not on their server). Pair that with a 16+ character passphrase derived through Argon2id or PBKDF2 at 600,000+ iterations.
Try it at hexatransfer.com — free, no account, 10 GB max.
Send large files securely with end-to-end encryption
Transfer files up to 10 GB for free with end-to-end encryption. No account required. Your files are encrypted in your browser before upload — no one else can read them.
Send a file