Documentation
¶
Overview ¶
Package dmrcrypto generates the keystreams DMR's link-layer privacy algorithms produce, so the assessment harness and recipe pipeline can attempt DMR decryption the same way p25crypto handles P25.
Honesty note: DMR encryption is vendor-specific. The cipher *cores* are standard — Motorola "Enhanced Privacy" is RC4, and the DMRA types map to DES/3DES/AES — but the key and IV *derivation* from the air interface is proprietary and reverse-engineered, and differs between Motorola and Hytera. This package therefore implements the standard cores keyed with the material the caller supplies (the reconstructed key, and the frame's IV bytes used directly): it does not fabricate a vendor key schedule. An analyst who has recovered the key can decrypt; the package makes no claim to derive that key from the signalling.
Index ¶
Constants ¶
const ( AlgRC4 = 0x21 // Motorola "Enhanced Privacy" AlgDESOFB = 0x22 AlgTDES = 0x23 AlgAES128 = 0x24 AlgAES256 = 0x25 )
DMRA / vendor privacy algorithm identifiers, as surfaced by common decoders.
Variables ¶
This section is empty.
Functions ¶
func DefaultKeys ¶
DefaultKeys returns a small dictionary of weak/default/test keys to try for algid (all-zero, all-FF, and an incrementing pattern), or nil if unsupported.
func KeySize ¶
KeySize returns the canonical key length in bytes for algid (RC4 keys are variable; 5 bytes / 40 bits is the common Enhanced-Privacy size used for the default-key dictionary and brute), or 0 when unsupported.
func Keystream ¶
Keystream returns n keystream bytes for the algorithm, key, and IV. For RC4 the IV (if present) is appended to the key — the common Enhanced-Privacy model — and no warm-up bytes are discarded (unlike P25 ADP). For the block ciphers the IV seeds OFB directly. RC4 accepts a 1..256-byte key; the block ciphers require the exact KeySize.
Types ¶
This section is empty.