Table of Contents
1. Introduction: What Is Encryption, Really?
At its core, encryption is the process of transforming readable data (plaintext) into an unreadable format (ciphertext) using a mathematical algorithm and a secret value called a key. Only someone with the correct key can reverse the process (decryption) and recover the original data.
Modern encryption is not optional — it is a fundamental requirement for digital privacy. Every HTTPS connection, every password manager, every secure messaging app relies on encryption to protect data from unauthorized access. The same cryptographic primitives that secure bank transactions and government communications are available to anyone with a web browser, thanks to the Web Cryptography API (WebCrypto).
The two dominant encryption paradigms you will encounter are symmetric encryption (same key to encrypt and decrypt) and asymmetric encryption (a public key to encrypt, a private key to decrypt). The most widely used standards within these categories are AES-256 (symmetric) and RSA (asymmetric). Understanding the difference between them — and when each is appropriate — is essential for using any file encryption tool effectively.
2. Symmetric Encryption: AES-256 Explained
What Is AES?
The Advanced Encryption Standard (AES) is a symmetric block cipher adopted by the U.S. National Institute of Standards and Technology (NIST) in 2001. It replaced the aging Data Encryption Standard (DES) and has since become the global standard for symmetric encryption. AES is used by the U.S. government for classified information up to the TOP SECRET level.
How AES Works
AES operates on fixed-size blocks of data — 128 bits at a time. It applies a series of mathematical transformations (SubBytes, ShiftRows, MixColumns, AddRoundKey) across multiple "rounds." The number of rounds depends on the key size:
- AES-128: 10 rounds (128-bit key)
- AES-192: 12 rounds (192-bit key)
- AES-256: 14 rounds (256-bit key)
The "256" in AES-256 refers to the key length: 256 bits. A 256-bit key means there are 2256 possible key combinations — a number so astronomically large (approximately 1.16 × 1077) that brute-forcing it is computationally impossible with any foreseeable technology. To put that in perspective, there are estimated to be only 1080 atoms in the observable universe.
Modes of Operation
AES operates on fixed 128-bit blocks. When encrypting data larger than 128 bits, a mode of operation defines how each block is processed. The most common modes are:
- AES-CBC (Cipher Block Chaining): Each plaintext block is XORed with the previous ciphertext block before encryption. Requires an Initialization Vector (IV) that must be random and unique per encryption session.
- AES-GCM (Galois/Counter Mode): Provides both encryption and built-in authentication (integrity verification). GCM is widely preferred because it detects any tampering with the ciphertext. Envizion's Universal File Encryption tool uses AES-GCM.
- AES-CTR (Counter Mode): Turns AES into a stream cipher by encrypting incrementing counter values. Fast and parallelizable, but requires careful IV management.
Strengths and Limitations
AES-256 is extraordinarily secure, fast in hardware (modern CPUs have dedicated AES instruction sets), and widely implemented. Its main limitation is key distribution: because AES is symmetric, both the sender and receiver must possess the same secret key. Transmitting that key securely is itself an encryption problem — which is where asymmetric encryption comes in.
3. Asymmetric Encryption: RSA Explained
What Is RSA?
RSA (named after Rivest, Shamir, and Adleman, who published it in 1977) is an asymmetric encryption algorithm that uses a pair of mathematically related keys: a public key and a private key. The public key can be shared freely with anyone; the private key must be kept secret. Data encrypted with the public key can only be decrypted with the corresponding private key, and vice versa.
How RSA Works
RSA's security is based on the practical difficulty of factoring the product of two large prime numbers. The algorithm works as follows:
- Key generation: Two large prime numbers (p and q) are chosen randomly. Their product (n = p × q) forms part of the public key. A public exponent (e, commonly 65537) is selected, and a private exponent (d) is computed such that (e × d) ≡ 1 mod φ(n), where φ(n) = (p-1)(q-1).
- Encryption: The plaintext message m is converted to a number and encrypted as c = me mod n.
- Decryption: The ciphertext c is decrypted as m = cd mod n.
The critical insight is that while multiplying p and q to get n is trivial, factoring n back into p and q is computationally infeasible for sufficiently large primes. Modern RSA uses key sizes of 2048 or 4096 bits. A 2048-bit RSA key provides security roughly equivalent to a 112-bit symmetric key; a 4096-bit RSA key approximates AES-192.
Strengths and Limitations
RSA's primary advantage is solving the key distribution problem: anyone can encrypt data using a widely-shared public key, but only the private key holder can decrypt it. However, RSA has significant practical limitations:
- Speed: RSA is 100–1000x slower than AES for bulk data encryption. It is not designed for encrypting large files directly.
- Plaintext size: RSA can only encrypt data smaller than its key size (e.g., 256 bytes for a 2048-bit key).
- Quantum vulnerability: RSA (and other factoring-based cryptosystems) would be broken by a sufficiently large quantum computer using Shor's algorithm.
4. AES-256 vs RSA: When to Use Each
Rather than being competitors, AES-256 and RSA are complementary technologies that serve different roles. In practice, secure systems use both:
| Feature | AES-256 | RSA-2048/4096 |
|---|---|---|
| Type | Symmetric | Asymmetric |
| Key Relationship | Single shared key | Public/private key pair |
| Speed | Very fast (hardware-accelerated) | Slow (math heavy on large numbers) |
| Suitable for | Bulk file encryption | Key exchange, digital signatures |
| Security Level (2026) | Quantum-resistant | Vulnerable to quantum attacks |
| Typical Use Case | Encrypting files, disk volumes | SSL/TLS handshake, key transfer |
The most common secure pattern is hybrid encryption: use RSA to encrypt an AES key, then use AES-256 to encrypt the actual file data. This gives you the key distribution advantages of RSA with the speed and efficiency of AES for bulk data. Envizion's Universal File Encryption implements this hybrid approach automatically when password-based key derivation is used.
5. How the Web Cryptography API Works
The Web Cryptography API (WebCrypto) is a W3C-standard JavaScript API that exposes cryptographic primitives to web applications. It is built into all modern browsers (Chrome, Firefox, Safari, Edge) and provides standard, audited implementations of AES, RSA, SHA, HMAC, ECDSA, and other algorithms.
Key features of WebCrypto include:
- Subtle CryptoEngine access: WebCrypto delegates cryptographic operations to the browser's underlying secure crypto library (e.g., BoringSSL on Chrome, NSS on Firefox) — JavaScript code never directly handles raw key material in user-accessible memory.
- Key generation and management: Keys can be generated, imported, exported, and stored as CryptoKey objects. The
extractableflag controls whether the raw key bytes can be exported from the browser. - SubtleCrypto interface: All cryptographic operations are exposed through
window.crypto.subtle, which includes methods forencrypt(),decrypt(),sign(),verify(),digest(), and more.
Here is a simplified example of how the Universal File Encryption tool uses WebCrypto to encrypt a file:
// 1. Derive an AES-256 key from the user's password
const salt = crypto.getRandomValues(new Uint8Array(16));
const keyMaterial = await crypto.subtle.importKey(
'raw', encoder.encode(password), 'PBKDF2', false, ['deriveKey']
);
const aesKey = await crypto.subtle.deriveKey(
{ name: 'PBKDF2', salt, iterations: 600000, hash: 'SHA-256' },
keyMaterial, { name: 'AES-GCM', length: 256 }, false, ['encrypt']
);
// 2. Generate a random 12-byte initialization vector (IV)
const iv = crypto.getRandomValues(new Uint8Array(12));
// 3. Encrypt the file data
const encryptedData = await crypto.subtle.encrypt(
{ name: 'AES-GCM', iv }, aesKey, fileData
);
The key takeaway: the encryption never leaves the browser. The password, the derived key, and the plaintext file data exist only in the browser's memory. The encrypted output is returned to the user as a downloadable blob.
6. Why Browser-Based Encryption Is Safer
Many "secure" file encryption services operate by uploading your file to a server, encrypting it there, and sending the encrypted result back. This model has a fundamental security flaw: the server has access to your plaintext data at the moment of encryption.
Browser-based encryption eliminates this attack surface entirely:
- No data transmission: Your file never leaves your device. The encryption algorithm runs in your browser's JavaScript engine, operating on data loaded into the browser's memory.
- No server-side vulnerability: A compromised server cannot leak your plaintext data because the server never sees it.
- No residual copies: Server-side encryption services often retain logs, temporary files, or backup copies of uploaded data. Browser-based encryption avoids this.
7. Security Best Practices
- Use strong, unique passwords: Your encryption is only as strong as your password. Use a minimum of 16 characters.
- Never reuse encryption passwords: Each encrypted file should use a unique password to prevent widespread vulnerability.
- Keep your software updated: Browser updates include security patches for the WebCrypto implementation.
- Securely store your encrypted files: Losing the password means losing access to the data permanently — there is no "password reset".
8. Conclusion
Encryption is one of the most powerful tools available for protecting digital privacy. Understanding the difference between AES-256 and RSA — and knowing when to use each — transforms encryption from a black box into a comprehensible, controllable security measure.
The Envizion Universal File Encryption tool implements industry-standard AES-256-GCM encryption entirely in your browser using the Web Cryptography API. No files are uploaded, and no third party ever has access to your plaintext data.