WikiPlus

PDF Encryption Guide: AES-256 vs RC4 Explained

When you password-protect a PDF, the document is encrypted using a cryptographic algorithm. Two algorithms have historically been used for PDF encryption: RC4 and AES. Understanding the difference matters because not all encryption is equally strong. This guide explains both algorithms, why AES-256 is the current standard, what happens during PDF encryption, and how to ensure the tools you use are applying strong encryption.

How PDF Encryption Works

PDF encryption works by scrambling the document's content using a cryptographic key derived from your password. Without the correct password — and thus the correct key — the encrypted content cannot be read or even understood. When you open an encrypted PDF, the PDF viewer asks for your password. It uses that password, combined with metadata in the PDF file (such as a salt value), to derive the decryption key. With the correct key, the viewer decrypts the content on the fly and displays the document. With the wrong password, no valid key is produced and the document cannot be displayed. The security of this system rests on two things: the strength of the cryptographic algorithm and the strength of your password. The algorithm determines whether a brute-force or cryptanalytic attack is theoretically feasible. Your password determines whether a dictionary attack or intelligent guessing can succeed. PDF encryption affects the entire file content — all pages, images, fonts, and embedded objects are encrypted. Only the file's structural metadata (required for the PDF viewer to attempt decryption) is left unencrypted. Two encryption layers exist in PDF security: the open password (or user password) encrypts the document against reading. The owner password encrypts the permission data that governs what an authorized user can do (print, copy, edit). These two passwords use different encryption targets but the same underlying algorithm.

RC4 Encryption: The Legacy Standard

RC4 (Rivest Cipher 4) was the original encryption algorithm in the PDF specification, used in PDF versions 1.1 through parts of PDF 1.6. It is a stream cipher, meaning it encrypts data one byte at a time using a keystream generated from the encryption key. RC4 was the dominant encryption algorithm for many years across multiple applications — SSL/TLS, WEP Wi-Fi, and PDF files all used it. However, it has serious cryptographic weaknesses that have been known and documented since the mid-1990s and became practically exploitable in the 2000s and 2010s. Key weaknesses of RC4 in PDF context: the algorithm produces biased keystream bytes, meaning some byte values are more predictable than others. This allows statistical attacks that can recover the key with less computation than a true brute-force attack. The key scheduling algorithm has well-known weaknesses. RC4 is particularly weak when the same key is reused — not a problem for static documents, but a design vulnerability nonetheless. For PDF documents specifically, RC4 with 40-bit keys (PDF 1.1-1.3) is essentially trivial to break with modern hardware. RC4 with 128-bit keys (PDF 1.4-1.5) is more resistant but still considered insecure by modern cryptographic standards. Current guidance from security organizations including NIST (US National Institute of Standards and Technology) is that RC4 should not be used in new applications. PDF encryption tools should default to AES.

AES-256: The Modern Standard

AES (Advanced Encryption Standard) was standardized by NIST in 2001 after a five-year public competition to replace the aging DES algorithm. AES-256 refers to AES with a 256-bit key — the longest and strongest variant. AES is a block cipher, processing data in 128-bit blocks using a series of mathematical transformations. The 256-bit key version uses 14 rounds of these transformations. AES-256 has been studied intensively by cryptographers worldwide since its standardization and no practical attack has been found. It is approved for encrypting US government classified information up to TOP SECRET. In the PDF specification, AES-128 was introduced in PDF 1.6 (2004) and AES-256 was added in PDF 1.7 Extension Level 3 (2008), becoming part of PDF 2.0. All modern PDF applications support AES-256. Why AES-256 over AES-128: Both are considered secure by current standards. AES-128 has a 2^128 keyspace — far beyond any foreseeable brute-force capability. AES-256 has a 2^256 keyspace, providing an additional margin against future advances in computing (including quantum computing). For most practical purposes today, AES-128 is sufficient; AES-256 provides extra headroom for long-term document security. When using a PDF password tool, verify it specifies AES-256 encryption. Tools that use pdf-lib (a modern, actively maintained JavaScript library) default to AES-256. Older tools or tools using legacy PDF libraries may still produce RC4-encrypted PDFs without clearly stating this.

Choosing the Right Encryption for Your Documents

Understanding the algorithms helps you make informed choices about which tool to use and how to verify the encryption applied. Always choose AES-256: For any new encrypted PDF, AES-256 is the correct choice. There is no reason to use RC4 for new documents. Any quality modern PDF tool uses AES-256 by default. Verify after encrypting: After password-protecting a PDF, you can verify the encryption type by checking the document properties. In Adobe Acrobat Reader: open the file, enter the password, then go to File > Properties > Security. The Security Method section lists the encryption algorithm and key length. If it shows 'AES 256-bit', you have the strongest available protection. If it shows RC4, the tool you used applied legacy encryption. Re-encrypt legacy documents: If you have important documents that were previously protected with RC4 (particularly older documents created before 2008), consider re-encrypting them with AES-256. Open the document, remove the old password, and apply a new AES-256 password. Key length matters less than algorithm quality: 128-bit RC4 is less secure than 128-bit AES, and far less secure than 256-bit AES. Do not be misled by tools that advertise '128-bit encryption' without specifying the algorithm — 128-bit RC4 offers meaningfully weaker protection than 128-bit AES. Quantum computing considerations: Current quantum computers cannot practically break AES-256. The best known quantum attack (Grover's algorithm) effectively halves the key length, reducing AES-256 to the effective security of classical 128-bit AES — which remains computationally infeasible to break. For documents that need to remain secure for decades, AES-256 is the appropriate choice.

Frequently Asked Questions

How can I tell what encryption type a PDF already has?
In Adobe Acrobat Reader, open the PDF (entering the password if required), then go to File > Properties and click the Security tab. The Document Security section shows the encryption method — for example, 'AES 256-bit' or 'RC4 128-bit'. In other PDF viewers, look for Document Properties or equivalent. You can also examine the raw PDF structure with a text editor — the Encrypt dictionary entry will include a V value (version) and CF entries that indicate the algorithm, but this requires knowledge of PDF structure to interpret.
Is AES-128 sufficient or should I always use AES-256?
AES-128 is considered cryptographically secure against all known practical attacks as of 2026. The 2^128 keyspace is beyond any foreseeable brute-force capability even with significant advances in computing. AES-256 provides additional security margin for long-term document protection and quantum-resistant headroom. For most practical business documents, AES-128 is sufficient. For highly sensitive documents that must remain confidential for ten or more years, AES-256 is the conservative choice. When in doubt, use AES-256 — it adds no practical overhead.
Does encrypting a PDF change how it looks when opened?
No. Once the correct password is entered and the document is decrypted, it looks and functions exactly like the original unencrypted PDF. The encryption only affects access — it scrambles the file data so it cannot be read without the password, but the decrypted content is identical to the original. The only visible difference from the user's perspective is the password prompt that appears when the document is opened.