Safer-SK64
James Massey's byte-oriented cipher family, including SAFER+ used in Bluetooth pairing
Source found and wired, correctness not fully proven. Root API only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.
About Safer-SK64
Safer-SK64 is one of 5 SAFER variants in the NextSSL registry, a block cipher. It uses an 8-byte (64-bit) key and an 8-byte (64-bit) block. NextSSL lists it in the unverified tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).
Overview
SAFER (Secure And Fast Encryption Routine) is a family of byte-oriented block ciphers designed by James Massey starting in 1993. Members include SAFER K-64, SAFER K-128, SAFER SK-64, SAFER SK-128 and the 128-bit-block SAFER+.
SAFER ciphers operate on bytes using exponentiation and logarithm tables modulo 257 as non-linear layers, alternating XOR and addition for key mixing, and a Pseudo-Hadamard Transform network for diffusion. The original K-64 had a 64-bit block and key. After Lars Knudsen found a key-schedule weakness, the SK (strengthened key) variants were introduced. SAFER+ extended the design to a 128-bit block as an AES candidate, and a modified version is used in Bluetooth's legacy authentication functions.
NextSSL includes SAFER K-64, K-128, SK-64, SK-128 and SAFER+ entries wired from source and not yet verified. SAFER+ is no longer used in modern Bluetooth Secure Connections, which rely on AES and elliptic curves instead. The family remains of interest mainly to researchers studying byte-oriented designs. Because the tier is unverified, outputs should be checked against independent reference values before they are relied on for anything beyond experimentation.
History
1993–1993SAFER published by James Massey
Security notes
The K variants have known key-schedule weaknesses and should not be used. No practical attack on full SAFER+ is known, but the family is dated and little analysed by modern standards.
Typical uses
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| key | 8 | Secret key |
| block | 8 | Block |
Use it
from nextssl_demo import NextSSL
root = NextSSL(root=True) # tier 'unverified' is reachable from the root API only
block = root.call("blockcipher_encrypt", "safer-sk64", None, key, plaintext_block)[0]
nextssl_root_blockcipher_encrypt("safer-sk64", 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, "safer-sk64", &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 SAFER variants
4More block ciphers
All 84Frequently asked questions
What is Safer-SK64?
Safer-SK64 is a block cipher in the SAFER family. SAFER (Secure And Fast Encryption Routine) is a family of byte-oriented block ciphers designed by James Massey starting in 1993.
What are the Safer-SK64 sizes?
In NextSSL, Safer-SK64 uses: key 8 bytes, block 8 bytes.
Who designed Safer-SK64 and when?
Safer-SK64 belongs to the SAFER family, first published in 1993 by James Massey.
Is Safer-SK64 safe to use?
Safer-SK64 is in the unverified tier. Source found and wired, correctness not fully proven. Root API only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).
What other SAFER variants are there?
NextSSL also registers safer-k128, safer-k64, safer-plus, safer-sk128 in the SAFER family.