CAST6
Carlisle Adams and Stafford Tavares's Feistel ciphers, once default in PGP
Old but not broken. Kept for interoperability; root API only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.
About CAST6
CAST6 is one of 2 CAST-128 and CAST-256 variants in the NextSSL registry, a block cipher. It uses a 16–32-byte key and a 16-byte (128-bit) block. Its registry entry cites RFC 2612 and CAST-256. It is also known as cast-256 and cast256. NextSSL lists it in the legacy tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).
Overview
CAST-128 (also called CAST5) and CAST-256 (CAST6) are block ciphers designed using the CAST methodology of Carlisle Adams and Stafford Tavares. CAST5 was the default symmetric cipher in some versions of PGP and GnuPG.
CAST-128 is a 12- or 16-round Feistel network on a 64-bit block with keys from 40 to 128 bits. Its round functions mix modular addition, subtraction and XOR with key-dependent rotations and four large 8x32-bit S-boxes derived from bent functions. CAST-256 extends the design to a 128-bit block with keys up to 256 bits using a generalised Feistel structure of quad-rounds, and was an AES first-round candidate.
CAST-128 is specified in RFC 2144 and CAST-256 in RFC 2612. NextSSL includes both. CAST5 was used in OpenPGP, early SSH and some VPN products, and is still supported for decrypting old messages. CAST-256 was not selected as an AES finalist. Both were offered royalty-free by Entrust. It remains interoperable.
History
1996–1999CAST-128 published by Carlisle Adams and Stafford Tavares
Specified in RFC 2144
CAST-256 specified in RFC 2612
Security notes
No practical attacks on full CAST-128 or CAST-256 are known, but CAST-128's 64-bit block is vulnerable to birthday-bound attacks with large data volumes. Both are legacy choices.
Typical uses
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| key | 16 – 32 | Secret key |
| block | 16 | Block |
Use it
from nextssl_demo import NextSSL
root = NextSSL(root=True) # tier 'legacy' is reachable from the root API only
block = root.call("blockcipher_encrypt", "cast6", None, key, plaintext_block)[0]
nextssl_root_blockcipher_encrypt("cast6", NULL, key, block, out); /* exactly one block */
use nextssl_core::Params;
use nextssl_registry::{self as reg, Policy};
let alg = reg::new_blockcipher_in(reg::all(), Policy::Any, "cast6", &Params::new())?;
let out = alg.encrypt_block(&key, &block)?;
Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.
Other CAST-128 and CAST-256 variants
1More block ciphers
All 84Frequently asked questions
What is CAST6?
CAST6 is a block cipher in the CAST-128 and CAST-256 family. CAST-128 (also called CAST5) and CAST-256 (CAST6) are block ciphers designed using the CAST methodology of Carlisle Adams and Stafford Tavares. It is also known as cast-256, cast256.
What are the CAST6 sizes?
In NextSSL, CAST6 uses: key 16 to 32 bytes, block 16 bytes.
Who designed CAST6 and when?
CAST6 belongs to the CAST-128 and CAST-256 family, first published in 1996 by Carlisle Adams, Stafford Tavares. Its origin: RFC 2144; RFC 2612.
Which standards define CAST6?
CAST6 is referenced by RFC 2612, CAST-256.
Is CAST6 safe to use?
CAST6 is in the legacy tier. Old but not broken. Kept for interoperability; root API only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).
What other CAST-128 and CAST-256 variants are there?
NextSSL also registers cast5 in the CAST-128 and CAST-256 family.