← Cryptography guide

K011 / Symmetric ciphers (block and stream)

RC5

RC5 cipher · Survey date 2026-12-05

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.

Scope: Legacy / non-secure

RC5-32/12/16

See the scope above for fixed examples, reduced parameters and supported variants. Standard operation names and formulas are retained.

Reference ↗

Open lab →

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

Examples are illustrative; they are not execution-tested implementations or operational recommendations.

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.

Diagram source ↗

References