K011 / Symmetric ciphers (block and stream)
RC5
RC5 is a fast symmetric block cipher suitable for hardware and software implementations.
CRYPTOGRAPHY LAB / K011
Cryptography Lab · RC5
Run real computations and inspect intermediate states step by step.
Educational only. Never enter real passwords or secret keys. Computation stays in your browser; input and trace values are not sent to a server. Do not use this implementation in production.
RC5-32/12/16
See the scope above for fixed examples, reduced parameters and supported variants. Standard operation names and formulas are retained.Output
Previous state
- Definition and overview
- RC5 is a fast symmetric block cipher suitable for hardware and software implementations. Source document ↗
- Classification and reversibility
- A symmetric block cipher supporting reversible encryption and decryption. Source document ↗
- Key or secret requirements
- Requires a variable-length secret key. Source document ↗
- Operating principle and structure
- A two-branch Feistel structure using ARX (modular addition, rotation and XOR), with extensive data-dependent rotations. Source document ↗
- Key size, block size and parameters
- Variable block sizes of 32/64/128 bits, keys of 0–2040 bits and rounds of 0–255; the original proposal used a 64-bit block, 128-bit key and 12 rounds. Source document ↗
- Security strength and recommendation
- Primarily historical or legacy; AES-GCM is recommended for new data. Source document ↗
- Known attacks and vulnerabilities
- 12-round RC5 with 64-bit blocks is vulnerable to differential attacks; 18–20 rounds are proposed for sufficient protection. 64-bit blocks limit data volume. Source document ↗
- Standards and certification
- RFC 2040 defines RC5 and modes as Informational, not an Internet Standard. Source document ↗
- Typical uses
- Used for interoperability definitions and legacy systems. Source document ↗
- Implementations, libraries and tools
- RC5 libraries exist for Rust and other languages. Source document ↗
- Decryption or decoding
- Decrypt by reversing the encryption rounds and applying inverse operations (subtraction, right rotation and XOR). Source document ↗
- Advantages
- Fast in hardware and software, simple structure and flexible parameters. Source document ↗
- Limitations and cautions
- 64-bit blocks limit large data volumes and short rounds are vulnerable; caution is required for new use. Source document ↗
- Distinguishing encryption, encoding and hashing
- RC5 is reversible encryption, distinct from one-way hashing or simple encoding. Source document ↗
Practical examples
Example
Initialize plaintext block and key with chosen w/r/b parameters and encrypt using RC5. Decrypt with the same key and parameters using inverse operations. No actual keys are shown.
Procedure
Encryption: select w/r/b and secret key, create key schedule, split block into two words and apply addition, rotation and XOR rounds. Decrypt by reversing rounds with identical parameters. Encoding/decoding changes format without keys and is separate.
Scenario
For legacy or educational interoperability, decrypt existing RC5 data using agreed w/r/b and mode. For new security designs replace RC5 with modern ciphers such as AES-GCM.
Pitfalls and alternatives
Distinguish RC5 from Base64 and hashing. The 12-round/64-bit configuration has weaknesses and data-volume limits; use vetted AEAD such as AES-GCM for new systems. Maintain proper key, IV/mode, padding and fixed-parameter management.
References
- The RC5 encryption algorithm ↗
- CryptoLUX > Lightweight Block Ciphers ↗
- RC5 ↗
- How to use RC5 (0-2040 bits) to encrypt and decrypt in NodeJS | Encryption Methods in Programming Languages ↗
- RC5 - Wikipedia ↗
- RFC 2040: The RC5, RC5-CBC, RC5-CBC-Pad, and RC5-CTS Algorithms | RFC Editor ↗
- rc5_cipher::rc5 - Rust ↗
- RC5: A Symmetric‑Key Block Cipher | Every Algorithm ↗
- The RC5 and RC6 Algorithms: Interactive Visualizer ↗