Documentation
¶
Overview ¶
Package p25crypto generates the keystreams P25's link-layer encryption algorithms produce from a key and a Message Indicator (IV). It exists so the assessment harness can actually *attempt decryption* — generate the real keystream for a candidate/known/weak key and XOR it onto captured ciphertext — rather than only detecting structural weaknesses.
The constructions follow the common open P25 implementations (OP25, DSD-FME):
- ADP (RC4, ALGID 0xAA): RC4 keyed with the 5-octet key followed by the first 8 octets of the MI, discarding the first 256 keystream bytes.
- DES-OFB (0x81): single-DES in OFB, IV = first 8 octets of the MI.
- AES-128/256 (0x85 / 0x84 / 0x89): AES in OFB, IV = the MI left-justified into a 16-byte block.
These are the byte-stream keystreams; mapping them onto a specific protocol payload (e.g. the exact IMBE voice-bit positions) is the caller's concern. The package performs no key recovery — it only realises a keystream for a key the caller already has or is testing.
Index ¶
Constants ¶
const ( AlgDESOFB = 0x81 AlgTDES2 = 0x83 // two-key Triple-DES (K1,K2 → K1K2K1) AlgAES256 = 0x84 AlgAES128 = 0x85 AlgTDES = 0x86 // three-key Triple-DES AlgAES256OFB = 0x89 AlgADP = 0xAA )
P25 algorithm identifiers (TIA-102.AACE-A). Mirrors internal/radio/p25/algorithm.go; duplicated here to keep the engine dependency-light.
Variables ¶
This section is empty.
Functions ¶
func DefaultKeys ¶
DefaultKeys returns a small dictionary of weak / default / test keys to try for algid: the all-zero key, the all-FF key, and a simple incrementing pattern. These are the keys a misconfigured or factory-default radio is most likely to carry. Returns nil for unsupported algorithms.
func KeySize ¶
KeySize returns the key length in bytes p25crypto expects for algid, or 0 when the algorithm is not supported here.
Types ¶
This section is empty.