Course contentsShow
← Security
Lesson 2772 of 3,05252. Embedded and IoT SecurityFree lesson

Side-Channel Attacks: Power Analysis

How power consumption analysis can leak cryptographic keys and countermeasures like masking and constant-time operations.

Side-Channel Attacks: Power Analysis

What you'll learn: How attackers can steal cryptographic keys by measuring a device's power consumption during cryptographic operations, and the defenses that stop them.

The Invisible Leak

Imagine trying to crack a safe by listening to the tumblers inside—that's the essence of side-channel attacks. Unlike attacking encryption algorithms mathematically, power analysis exploits what the hardware accidentally reveals through its electrical behavior. When processors execute cryptographic operations, different instructions and data values cause measurable variations in power consumption. An attacker with physical access and a simple oscilloscope can record these tiny fluctuations and extract secret keys.

How It Works

During encryption operations, processing a "1" bit typically consumes different power than processing a "0". By capturing thousands of power traces during repeated encryptions, attackers use statistical techniques like Differential Power Analysis (DPA) to correlate power patterns with specific key bits. Even randomized implementations can leak information through Simple Power Analysis (SPA), where distinctive operation patterns become visible in a single trace.

Think of it like watching someone's electricity meter spike every time they microwave a specific food—eventually, you can deduce their meal schedule.

Countermeasures

Masking randomizes intermediate values during computation so power consumption doesn't correlate directly with secret data—like shuffling cards before each deal. Constant-time operations ensure all code paths take identical time and power regardless of input values, eliminating timing and power differences. Hardware countermeasures include adding noise generators or using power-balanced logic gates that consume uniform power.

These defenses are critical for embedded devices like payment cards, IoT sensors, and hardware security modules where physical access enables power monitoring.

Key Takeaway: Power analysis side-channel attacks extract cryptographic keys by analyzing electrical consumption patterns; defenses include masking intermediate values and ensuring constant-time, constant-power operations across all execution paths.