"Physical-layer security exploits the randomness of the wireless channel to provide confidentiality, authentication, and key agreement without requiring a shared secret." — Sklar, Digital Communications, 3rd ed., Ch 14
Lecture (90 min)
4.1 The RF Security Surface
RF security operates at a layer below cryptographic protocols. Before a 5G UE sends its first NAS message, before a WiFi client performs a TLS handshake, the radio transmitter emits a physical signal that carries physical-layer information: its RF fingerprint. The physical-layer security surface includes:
- RF fingerprinting: identifying a specific transmitter from its hardware imperfections
- TRANSEC (transmission security): hiding the fact that a transmission is occurring (LPI/LPD, Chapter 9)
- Physical-layer authentication: authenticating a transmitter from signal characteristics rather than (or in addition to) cryptographic credentials
- Physical-layer key agreement: using channel reciprocity to derive shared secret keys without a public-key exchange
This chapter covers items 1, 3, and 4. TRANSEC is covered in Chapter 9 (anti-jamming and LPI/LPD).
Why this matters at RF-301 register: An attacker who clones a legitimate device's MAC address and cryptographic credentials but uses a different hardware radio chip can be detected at the physical layer -- because the RF fingerprint is determined by the hardware, not the software. Conversely, an IMSI catcher can be detected from its RF imperfections even when it perfectly mimics a legitimate base station's protocol messages. Physical-layer security is the defense (and attack) layer below the protocol stack.
4.2 RF Fingerprinting: Hardware Imperfections as Identity
Every radio transmitter has unique hardware imperfections: oscillator frequency offset, I/Q imbalance, phase noise, power amplifier nonlinearity, transient characteristics at turn-on and turn-off. These imperfections are determined by manufacturing tolerances and are difficult to replicate exactly.
Fingerprinting features:
| Feature | Physical cause | Measurement method |
|---|---|---|
| Carrier frequency offset (CFO) | Crystal oscillator tolerance | Phase difference between received and nominal carrier |
| I/Q imbalance | Gain/phase mismatch in I and Q mixers | Constellation asymmetry; sideband suppression |
| Phase noise | VCO phase jitter | Phase noise spectrum (dBc/Hz vs. offset) |
| Transient fingerprint | Power amplifier turn-on / turn-off | Envelope amplitude during preamble |
| Spectral flatness | Filter rolloff variation | Spectral comparison across sub-carriers |
CFO estimation in GNU Radio / Python:
import numpy as np
from scipy.signal import correlate
def estimate_cfo(received, pilot, fs):
"""
Estimate carrier frequency offset from a known pilot sequence.
received: received IQ samples (complex)
pilot: known pilot sequence (complex)
fs: sample rate Hz
Returns: CFO in Hz
"""
# Correlate received with pilot replica
corr = correlate(received, pilot, mode='valid')
# Peak location gives timing; phase slope gives CFO
peak_idx = np.argmax(np.abs(corr))
phase_at_peak = np.angle(corr[peak_idx])
# For OFDM, CFO shows up as phase rotation per OFDM symbol
# Simple estimate: compare phase between two pilot positions
if peak_idx + len(pilot) < len(received):
corr2 = np.sum(received[peak_idx:peak_idx+len(pilot)] * np.conj(pilot))
corr3 = np.sum(received[peak_idx+len(pilot):peak_idx+2*len(pilot)] * np.conj(pilot))
phase_delta = np.angle(corr3 * np.conj(corr2))
cfo_hz = phase_delta * fs / (2 * np.pi * len(pilot))
return cfo_hz
return phase_at_peak # fallback
# Simulate two transmitters with different CFOs
np.random.seed(42)
fs = 1e6
t = np.arange(1000) / fs
pilot = np.exp(2j * np.pi * np.array([0,1,0,-1,1,0,1,-1]) * 0.1) # simple pilot
# Transmitter A: CFO = +1.5 kHz
cfo_A = 1500.0 # Hz
tx_A = np.exp(2j * np.pi * cfo_A * t[:len(pilot)]) * pilot
# Transmitter B: CFO = -0.8 kHz (different hardware)
cfo_B = -800.0 # Hz
tx_B = np.exp(2j * np.pi * cfo_B * t[:len(pilot)]) * pilot
noise = 0.1 * (np.random.randn(len(pilot)) + 1j*np.random.randn(len(pilot)))
cfo_est_A = estimate_cfo(tx_A + noise, pilot, fs)
cfo_est_B = estimate_cfo(tx_B + noise, pilot, fs)
print(f"Estimated CFO A: {cfo_est_A:.0f} Hz (true: {cfo_A:.0f} Hz)")
print(f"Estimated CFO B: {cfo_est_B:.0f} Hz (true: {cfo_B:.0f} Hz)")
Machine learning for RF fingerprinting: Modern RF fingerprinting uses convolutional neural networks or LSTM networks trained on I/Q samples. The network learns the fingerprint implicitly -- it does not need explicit feature extraction. Published work (e.g., O'Shea et al. 2018, "Over-the-Air Deep Learning Based Radio Signal Classification") demonstrates >90% device identification accuracy for 20 same-model WiFi adapters at SNR > 10 dB. At SNR < 5 dB, accuracy degrades significantly.
4.3 I/Q Imbalance: Measurement and Correction
I/Q imbalance is one of the most consistent fingerprinting features because it derives from the physical mismatch between two analog chains. In a direct-conversion receiver, the in-phase (I) and quadrature (Q) channels are produced by mixing the received signal with two copies of the LO at 0° and 90°. Any mismatch in the gain or phase of the two mixers produces I/Q imbalance.
Mathematical model:
I'(t) = I(t) # reference channel
Q'(t) = A · Q(t) + B · I(t) # imbalanced channel
where A is the gain imbalance and B is the cross-coupling term (phase imbalance contribution).
The effect in the frequency domain: a signal at f_offset produces a mirror image (image sideband) at -f_offset. The image rejection ratio (IRR) quantifies the imbalance:
IRR [dBc] = -20·log₁₀(|ε|)
where ε = (A·e^{jφ} - 1) / (A·e^{jφ} + 1) (gain A, phase φ imbalance)
For a "good" SDR with 1% gain error and 1° phase error: IRR ≈ -34 dBc. For a "bad" SDR: IRR can be -20 dBc or worse -- the mirror image appears 100× stronger than ideal.
def iq_imbalance_model(iq_signal, gain_imbalance_db, phase_deg):
"""Apply I/Q imbalance to a complex baseband signal."""
A = 10**(gain_imbalance_db / 20) # gain ratio (linear)
phi = np.deg2rad(phase_deg)
I = iq_signal.real
Q = iq_signal.imag
# Imbalanced signal
I_out = I
Q_out = A * np.cos(phi) * Q + A * np.sin(phi) * I
return I_out + 1j * Q_out
def estimate_iq_imbalance(x):
"""
Estimate I/Q imbalance from a received signal.
Uses second-order statistics (covariance of I and Q).
"""
I = x.real
Q = x.imag
# Correlation between I and Q channels
E_II = np.mean(I**2)
E_QQ = np.mean(Q**2)
E_IQ = np.mean(I * Q)
# Gain imbalance
gain_ratio = np.sqrt(E_II / E_QQ)
gain_db = 20 * np.log10(gain_ratio)
# Phase imbalance
phase_rad = np.arcsin(2 * E_IQ / (E_II + E_QQ))
phase_deg = np.degrees(phase_rad)
return gain_db, phase_deg
# Generate QPSK signal and apply I/Q imbalance
symbols = np.array([1+1j, -1+1j, -1-1j, 1-1j]) / np.sqrt(2)
data = np.tile(symbols, 100)
# Transmitter A hardware: 0.5 dB gain imbalance, 2° phase
imbalanced_A = iq_imbalance_model(data, gain_imbalance_db=0.5, phase_deg=2.0)
g_est, p_est = estimate_iq_imbalance(imbalanced_A)
print(f"Estimated I/Q imbalance: gain={g_est:.2f} dB, phase={p_est:.2f}°")
print(f"True: gain=0.50 dB, phase=2.00°")
4.4 Physical-Layer Key Agreement via Channel Reciprocity
WiFi, LTE, and 5G all use cryptographic key agreement (Diffie-Hellman derivatives, ECDH, 5G-AKA) -- protocols that are secure but require computational overhead and a public-key infrastructure. Physical-layer key agreement uses an alternative: the radio channel itself as the source of randomness.
Channel reciprocity: In a time-division duplex (TDD) system, Alice transmits to Bob and Bob transmits to Alice using the same frequency at different times. If the channel changes slowly relative to the TDD period, Alice and Bob observe nearly the same channel response -- they see the same fading, multipath, and attenuation. An eavesdropper at a different location sees a statistically independent channel.
Key generation protocol:
- Alice and Bob exchange pilots (probe the channel)
- Both measure the channel response (RSSI, phase, delay profile)
- Both quantize the channel measurements to bits (e.g., RSSI > median → 1, else → 0)
- Privacy amplification: hash the bit string to compress channel estimation noise
- Use the resulting bits as a symmetric key
Limitations: Channel reciprocity degrades in FDD (frequency-division duplex) systems (different frequencies, different channels); eavesdroppers close to Alice or Bob may observe similar channels; channel measurements have noise, so Alice and Bob need information reconciliation (error correction) to agree on the same key.
4.5 5G-AKA Cross-Reference: RF Security and the AKA Progression
The 5G-AKA handout (handouts/cross-chapter-wireless-aka-progression.md) traces the progression from 802.11i (2004) through WPA3/Dragonfly (2018) to 5G-AKA (3GPP Rel-15, 2018). Chapter 5 (cellular protocols) covers 5G-AKA in the protocol context. This chapter positions it from the RF security side:
The IMSI catcher threat at the RF layer: An IMSI catcher is a rogue base station that announces itself to nearby UEs with a strong signal, inducing them to register. In 2G and 3G, the UE transmits its IMSI in cleartext -- the rogue BS harvests it. In 4G LTE, the IMSI is sometimes transmitted in cleartext during the initial Attach procedure (particularly on first attach). In 5G, the SUCI (Subscription Concealed Identifier) is used instead -- the UE encrypts its SUPI (permanent identifier) with the home network's public key before transmitting it. The IMSI catcher cannot harvest the SUPI because it lacks the home network's private key.
RF fingerprinting applied to base station detection: A legitimate base station has a known RF fingerprint -- its power level, antenna configuration, and carrier offsets are consistent with a fixed infrastructure. A rogue base station (IMSI catcher) deployed in a vehicle has a different RF fingerprint: transmitted power inconsistency, carrier frequency instability (battery-powered oscillator vs. GPS-locked infrastructure oscillator), and potentially suspicious geographic mobility. Physical-layer authentication is the defense at the RF layer; 5G-AKA is the cryptographic defense at the protocol layer. They are complementary.
4.6 Anchor Weave: Sklar Ch 14
Bernard Sklar's Digital Communications (3rd ed., Pearson, 2017) Ch 14 (CDMA and Security) covers physical-layer security concepts including the spread-spectrum as a security primitive framing. The key Sklar argument at RF-301 register: physical-layer security (spread spectrum, frequency hopping, LPI/LPD) and cryptographic security are not alternatives -- they are complementary layers. Sklar traces the military origins of spread-spectrum techniques as transmission security (TRANSEC) mechanisms and the subsequent civilian adoption for spectral efficiency reasons, arguing that the security and efficiency motives produce the same engineering choices for different reasons.
Lab Introduction
Lab 4 (15 pts): Physical-layer authentication primer -- RF fingerprinting of two same-make transmitters. Students capture transmissions from two ANT-SDR E200 units (or two HackRF units), extract CFO and I/Q imbalance signatures, and build a simple classifier. See labs/lab-4.md.
Independent Practice
- Read the Mitola Cognitive Radio Architecture Ch 4 discussion of radio identification (Mitola frames transmitter identity as a cognitive radio capability). How does Mitola's framing connect to the RF fingerprinting lab?
- Compute the image rejection ratio for I/Q imbalance of 1 dB gain + 3° phase. What receiver-chain SNR penalty does this impose?
- Look up two published RF fingerprinting datasets (DeepSig RF challenge dataset or ORACLE dataset). What modulation types and transmitter counts are included? What accuracy do baseline ML classifiers achieve?