A5-1
The GSM voice-encryption stream ciphers A5/1 to A5/4, two of them broken and two legacy
Practical attacks exist. Present for compatibility and research only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.
About A5-1
A5-1 is one of 4 A5 (GSM stream ciphers) variants in the NextSSL registry, a stream cipher. It uses an 8-byte (64-bit) key and a 4-byte nonce. Its registry entry cites GSM 03.20. NextSSL lists it in the broken tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).
Overview
A5 is the family of stream ciphers used to encrypt GSM and early 3G voice traffic, listed here as A5/1, A5/2, A5/3 and A5/4. A5/1 and A5/2 are broken, and A5/3 and A5/4 are legacy. NextSSL carries all four variants with 8-byte or 16-byte keys and 4-byte frame nonces.
A5 is the family of stream ciphers specified for GSM mobile telephony, where it encrypts each radio frame under a session key. A5/1 was the main GSM cipher, and A5/2 was a deliberately weakened export variant. Both are based on irregularly clocked linear feedback shift registers, and both have been broken by published attacks on the keystream.
NextSSL carries four variants. A5/1 and A5/2 have 8-byte keys and 4-byte nonces and are marked broken. A5/3 and A5/4 are specified in 3GPP TS 55.216 and the GSM 03.20 documents, have 8-byte and 16-byte keys respectively and 4-byte nonces, and are marked legacy. A5/3 is the KASUMI-based cipher used in 3G, and KASUMI itself has published related-key attacks.
The family is kept for historical comparison and for interoperability with legacy networks. It should not protect new communication, and any system still running A5 should be treated as exposed.
History
1987–2009A5/1 designed for GSM
A5/1 design leaks
A5/1 and A5/2 fully reverse engineered
A5/3 (KASUMI) specified
Rainbow-table attacks on A5/1 published
How it works
- The session key and a 4-byte frame number are loaded into the cipher's state.
- The cipher clocks its registers or block cipher for each frame and generates a keystream for that frame.
- The keystream is XORed with the plaintext for the frame, and the receiver regenerates it from the same key and frame number.
Security notes
A5/1 and A5/2 are broken by published ciphertext-only and known-plaintext attacks. A5/3 and A5/4 are legacy, and their KASUMI basis has related-key attacks in the literature. Do not use any A5 variant for new systems.
Typical uses
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| key | 8 | Secret key |
| nonce | 4 | Nonce / IV |
Use it
from nextssl_demo import NextSSL
root = NextSSL(root=True) # tier 'broken' is reachable from the root API only
ct = root.call("stream_apply", "a5-1", None, key, nonce, b"secret")[0] # same call decrypts
nextssl_root_stream_apply("a5-1", NULL, key, nonce, data, out);
use nextssl_core::Params;
use nextssl_registry::{self as reg, Policy};
let alg = reg::new_streamcipher_in(reg::all(), Policy::Any, "a5-1", &Params::new())?;
let ct = alg.apply_keystream(&key, &nonce, b"secret")?;
Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.
Other A5 (GSM stream ciphers) variants
3Similar names
Looking for something else?More stream ciphers
All 37Frequently asked questions
What is A5-1?
A5-1 is a stream cipher in the A5 (GSM stream ciphers) family. A5 is the family of stream ciphers used to encrypt GSM and early 3G voice traffic, listed here as A5/1, A5/2, A5/3 and A5/4.
What are the A5-1 sizes?
In NextSSL, A5-1 uses: key 8 bytes, nonce 4 bytes.
Which standards define A5-1?
A5-1 is referenced by GSM 03.20.
Is A5-1 safe to use?
A5-1 is in the broken tier. Practical attacks exist. Present for compatibility and research only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).
What other A5 (GSM stream ciphers) variants are there?
NextSSL also registers a5-2, a5-3, a5-4 in the A5 (GSM stream ciphers) family.
Related families
The 3GPP block cipher behind A5/3, derived from MISTY1
GEA (GPRS encryption algorithms)The GPRS stream ciphers GEA1 to GEA4, one broken, one unverified and two legacy
RC4Rivest's 1987 byte-oriented stream cipher, once ubiquitous and now prohibited in TLS
SNOW 2.0A word-oriented LFSR stream cipher, standardised in ISO/IEC 18033-4 and parent of SNOW 3G
TriviumA minimal hardware stream cipher in the eSTREAM portfolio, standardised in ISO/IEC 29192-3