Block ciphers

Safer-K128

James Massey's byte-oriented cipher family, including SAFER+ used in Bluetooth pairing

unverified Root API only
Unverified tier.

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-K128

Safer-K128 is one of 5 SAFER variants in the NextSSL registry, a block cipher. It uses a 16-byte (128-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–1993
  1. SAFER 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

Analysing legacy Bluetooth pairing (SAFER+)Research on byte-oriented designs

Sizes

FieldBytesMeaning
key16Secret key
block8Block

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-k128", None, key, plaintext_block)[0]

Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.

Frequently asked questions

What is Safer-K128?

Safer-K128 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-K128 sizes?

In NextSSL, Safer-K128 uses: key 16 bytes, block 8 bytes.

Who designed Safer-K128 and when?

Safer-K128 belongs to the SAFER family, first published in 1993 by James Massey.

Is Safer-K128 safe to use?

Safer-K128 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-k64, safer-plus, safer-sk128, safer-sk64 in the SAFER family.