Terminal-based RF signal analysis for automotive keyfobs
Rust module: src/protocols/psa.rs
Reference: REFERENCES/ProtoPirate/protocols/psa.c
PSA uses Manchester encoding with dual preamble pattern support. 128 bits total: key1 (64) + validation (16) + key2/rest (48). Modified TEA (XTEA-like) with dynamic key selection (key[sum & 3] and key[(sum >> 11) & 3]). Two decode modes: mode 0x23 (direct XOR decrypt with checksum validation) and mode 0x36 (TEA with BF1/BF2 key schedules). Brute-force decryption for mode 0x36 is deferred/partial.
| Parameter | Value | Notes |
|---|---|---|
| Symbol short | 250 us | +/-100 us |
| Symbol long | 500 us | +/-100 us |
| Preamble P1 | 250 us sub-symbols | Pattern 1 |
| Preamble P2 | 125 us sub-symbols | Pattern 2 |
| End marker | 1000 us (P1), 500 us (P2) | |
| Min bits | 128 |
Pattern type is auto-detected from the first preamble pulse duration.
Uses dynamic key word selection per round:
k_idx1 = sum & 3, then sum += DELTA, then k_idx2 = (sum >> 11) & 3k_idx2 = (sum >> 11) & 3, then sum -= DELTA, then k_idx1 = sum & 3(key[k_idx] + sum) ^ (((v >> 5) ^ (v << 4)) + v)(checksum ^ key2_high_byte) & 0xF0 == 0.psa_copy_reverse byte reordering.Direct TEA decrypt attempted with BF1 and BF2 key schedules. Full brute-force (16M iterations per schedule) is available in ProtoPirate but not fully ported to KAT.
Key schedules:
[0x4A434915, 0xD6743C2B, 0x1F29D308, 0xE6B79A64][0x4039C240, 0xEDA92CAB, 0x4306C02A, 0x02192A04]Supported (mode 0x23 only). XOR encrypt, then modified TEA encrypt with BF1 key schedule. Preamble: 70 cycles of 125/125 us + 250/250 us sync. Manchester encoded key1 (64 bits) + validation (16 bits). End marker: 1000 us LOW.
433.92 MHz.