8200 Cyber Bootcamp

© 2026 8200 Cyber Bootcamp

CNN Based Electromagnetic Side Channel Attacks on SoC

CNN Based Electromagnetic Side Channel Attacks on SoC

This article explores how convolutional neural networks (CNNs) are used for electromagnetic side channel attacks on AES implementations in system-on-chip (SoC) environments, profiling vulnerabilities and considering digital forensic implications.

CNN Based Electromagnetic Side Channel Attacks on SoC: Techniques, Forensics, and Cybersecurity Implications

Table of Contents


Introduction to Electromagnetic Side Channel Attacks

Hardware security breaches have evolved far beyond exploiting software flaws. Side-channel attacks, particularly those based on electromagnetic (EM) emanations, have emerged as potent threats to the confidentiality of cryptographic operations. These attacks operate by silently eavesdropping on the physical byproducts of computation in complex devices like System-on-Chip (SoC) units found in smartphones, tablets, and embedded systems.

In this blog post, we explore how modern deep learning, especially Convolutional Neural Networks (CNNs), empower electromagnetic side channel attacks (EMSCAs) against SoC devices. We break down the science, practical deployment, digital forensic implications, and real-world impacts of these attacks, backed with code samples and actionable insights for cybersecurity professionals and digital forensics investigators.


System-on-Chip (SoC) Security Overview

System-on-Chip (SoC) architectures integrate CPU, memory, communications, and peripherals on a single silicon die. Popular in smartphones (e.g., Qualcomm Snapdragon, HiSilicon Kirin), IoT devices, and automotive systems, SoCs are ubiquitous—and under assault.

Key Security Considerations:

  • Hardware Root of Trust: SoCs often store cryptographic keys and manage secure boot.
  • Resource Constraints: Optimized for power/performance, not always for side-channel resistance.
  • Complexity: Increased surface for subtle physical attacks (timing, power, EM).

Typical Targets:

  • Advanced Encryption Standard (AES) and other cryptographic primitives.
  • Firmware loaders and secure boot sequences.
  • Secure enclave or Trusted Execution Environment (TEE) operations.

Electromagnetic (EM) Emanations: The Side Channel

Every active device emits a unique electromagnetic (EM) signature due to rapid current changes within its circuitry—especially during intensive cryptographic computations.

Why EM Emanations?

  • Non-invasive: Attackers do not need to physically tamper with the chip.
  • Remote Potential: EM fields can be captured at a distance, unlike direct power analysis.
  • Distinctive Patterns: Each computation yields minute but reproducible EM variations attributable to processed data and secret keys.

Physical Principle:

  • When transistors switch, changing currents generate fluctuating magnetic fields.
  • Faraday's Law: Rapid switching induces detectable EM fields, which propagate beyond chip packaging.

How EM Side Channel Attacks Work

Electromagnetic Side Channel Attacks (EMSCA) exploit the correlation between processed data (often cryptographic keys) and an SoC's EM emanations.

Attack Phases:

  1. Acquisition: Capture EM traces using a small antenna and an oscilloscope while the target device performs cryptographic operations.
  2. Preprocessing: Clean and align traces, possibly using filtering and normalization techniques.
  3. Feature Extraction: Identify trace segments ("points of interest") reflecting sensitive computations.
  4. Classification/Analysis: Apply statistical or deep learning techniques to link trace features to secret data.
  5. Key Recovery: Use models to predict or recover cryptographic keys byte by byte.

Profiled Side Channel Attacks: The Power of Deep Learning

What Are Profiled Attacks?

Profiled attacks assume the attacker has a similar device and can gather labeled traces (with known keys) to train a predictive model. This model is then applied to traces from the target device to infer secret keys during a real attack.

Classical Techniques:
  • Template Attacks: Use multivariate Gaussian modeling of side-channel emissions.
  • Machine Learning Approaches: Support Vector Machines, Random Forests.
Deep Learning Revolution:
  • CNNs and other neural architectures can directly learn subtle, nonlinear relationships between raw EM traces and secret values—often outperforming handcrafted approaches.

Convolutional Neural Networks (CNNs) in EM Side Channel Analysis

CNNs, originally designed for 2D image processing, excel at extracting hierarchical features from dense, structured data. In EM SCA, they serve two purposes:

  1. Automated Feature Extraction: CNN layers "discover" points of interest and data leaks.
  2. Nonlinear Classification: They model complex, non-obvious relationships between trace structure and secret data.

CNN Architecture for EM SCA

Key points:

  • 1D CNN Layers: Ideal for processing temporal EM traces, where the "width" is the time axis.
  • Stacked Convolutions and Pooling: Extract feature hierarchies at different time scales.
  • Dense Output: Final layers predict probability scores for secret key hypotheses (e.g., AES S-box outputs).
Visual Representation:
[Input Trace] → [Conv1D + ReLU] → [Pooling] → [Conv1D + ReLU] → [Pooling] → [Dense] → [Softmax Output]
Benefits Over Classic Methods:
  • Less reliance on feature engineering
  • Handles trace misalignment and noise better
  • Automatic learning of data-dependent leakages

Case Study: CNN-Based Attack on AES in Kirin 620 SoC

Target: HiSilicon Kirin 620 SoC

  • Processor: ARM Cortex-A53 octa-core, 1.2GHz
  • Task: AES encryption
  • Accessibility: Black-box mode, EM traces acquired via near-field probe
Attack Workflow
  1. Data Collection:

    • Setup: Near-field EM probe placed close to SoC.
    • Triggering: Software-controlled AES encryption with triggered oscilloscope captures.
    • Trace Count: Thousands of EM waveforms per key byte.
  2. Preprocessing & Alignment:

    • Filter noise, align traces using correlation with software triggers.
  3. CNN Training:

    • Collect traces with known plaintexts and keys (profiling).
    • Labels: Intermediate values (e.g., output of the first AES S-box, related to the first key byte).
    • Loss Function: Cross-entropy.
  4. Key Recovery:

    • Apply trained model to unknown traces from target device.
    • Recover probabilities for each key byte hypothesis.
    • Combine outputs across multiple traces (majority vote, Bayesian aggregation).
Reported Results (source):
  • Key bytes can be recovered with fewer traces compared to classic template attacks.
  • Outperforms template and other classical profiled attacks in noisy, real-world conditions.

Practical EM Side-Channel Data Acquisition

Equipment Requirements

  • EM Probe: Small active loop antennas (e.g., Langer RF-R 400-1).
  • Oscilloscope: High bandwidth (≥500 MHz), fast sampling.
  • Signal Processing: Pre-amplifiers, differential probes for enhanced sensitivity.
  • Faraday Cage: Mitigate environmental EM noise.

Process Overview

  1. Positioning: Carefully place probe over processor region exhibiting the strongest signal.
  2. Triggering: Use GPIO or software triggers to align capture with cryptographic operation.
  3. Capture Script (e.g., using python's pyvisa and numpy):
import visa
import numpy as np

rm = visa.ResourceManager()
osc = rm.open_resource('USB0::0x0957::0x1796::MY1234567::INSTR')

osc.write(":RUN")
osc.write(":TRIG:EDGE:SOURCE CHAN1")
osc.write(":WAV:SOURCE CHAN1")
osc.write(":WAV:MODE NORMAL")
osc.write(":WAV:FORMAT BYTE")
osc.write(":WAV:DATA?")

data = osc.read_raw()
trace = np.frombuffer(data, dtype=np.uint8)
np.save('em_trace.npy', trace)
  1. Labeling and Storage: Store traces with metadata: key, plaintext, operation, timestamp.

Forensic Applications: Progressing Digital Forensic Analysis

EM side-channel analysis, traditionally seen as an "offensive" security tool, is now instrumental in digital forensics:

Why EMSCAs Matter in Forensics

  • Bypassing Device Encryption: Lawful access to criminal devices using EM-based key extraction where password brute force is impractical.
  • Non-invasive Memory Recovery: Reconstruct decrypted artifacts without altering device state or evidence.
  • IoT and Embedded Forensics: Many such devices lack secure enclaves or advanced side-channel shielding.

Case Example

Scenario: Law enforcement seizes an IoT controller suspected in a criminal network. The device encrypts logs using AES, and physical unlock is challenging.

Approach: Forensic analysts use a near-field probe to capture EM traces while the device processes sample plaintext. Deep learning models, ideally trained on similar chips, are used to recover AES keys, enabling access to encrypted forensic evidence.

Hindrances

  • Access to similar device models for profiling may be limited.
  • Strict chain-of-custody requirements require non-invasive, repeatable methods.

Countermeasures to EM Side Channel Attacks

As attacks advance, so do defenses. Countermeasures are critical at both hardware and software levels:

Hardware Countermeasures

  • Shielding: Metalized encapsulants/faraday cages to reduce stray EM fields.
  • Design Techniques: Dual-rail logic, randomized clocking to mask emissions.
  • On-chip noise generators: Deliberately inject non-informative signals.

Software/Algorithmic Defenses

  • Randomized Execution: Insert dummy operations or data shuffling.
  • Masked Arithmetic: Split computations into multiple randomized shares.
  • Blinding: Randomize cryptographic inputs irreversibly.

Limitations

  • Performance/energy overhead may be prohibitive for mobile and IoT devices.
  • Some countermeasures are vulnerable to advanced deep learning attacks (which can learn to “see through” naïve noise).

Example 1: Breaking Smartcards and Smartphones

  • Security researchers have extracted DES/AES keys from chip cards and smartphones by capturing EM traces during PIN authentication or encryption transactions.
  • Public demonstrations: Attacks conducted at conferences (e.g., Black Hat, CHES).

Example 2: Bypassing Secure Boot

  • Researchers have used EM SCA to recover keys from bootloaders in embedded Linux devices, enabling unauthorized firmware modification or extraction.

Example 3: Digital Evidence Recovery

  • Forensics labs have employed similar EM-based techniques, under judicial oversight, to access encrypted evidence in high-stakes criminal cases.

Practical Tools, Command-line Tricks, and Code Examples

1. Scanning for EM Emanations (Linux)

Install rtl-sdr and use rtl_power:

sudo apt-get install rtl-sdr
rtl_power -f 100M:1G:1M -g 30 -i 1s -e 1m em_scan.csv

Parse frequencies with largest amplitude (e.g., with Bash/AWK):

awk -F, '{print $5, $6, $7, $8}' em_scan.csv | sort -nk4 | tail -10

2. EM Trace Preprocessing with Python

Apply low-pass filtering and normalization before CNN processing:

from scipy.signal import butter, lfilter
import numpy as np

def lowpass(data, cutoff=10e6, fs=100e6, order=5):
    nyq = 0.5*fs
    normal_cutoff = cutoff/nyq
    b, a = butter(order, normal_cutoff, btype='low', analog=False)
    return lfilter(b, a, data)

raw_trace = np.load('em_trace.npy')
filtered = lowpass(raw_trace)
normalized = (filtered - np.mean(filtered)) / np.std(filtered)

3. CNN Model Example with Keras

import tensorflow as tf

model = tf.keras.Sequential([
    tf.keras.layers.Conv1D(32, 5, activation='relu', input_shape=(traces_len, 1)),
    tf.keras.layers.MaxPooling1D(2),
    tf.keras.layers.Conv1D(64, 5, activation='relu'),
    tf.keras.layers.MaxPooling1D(2),
    tf.keras.layers.Flatten(),
    tf.keras.layers.Dense(128, activation='relu'),
    tf.keras.layers.Dense(256, activation='softmax') # One output per key hypothesis
])

model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
# Fit: model.fit(X_train, y_train, epochs=50, batch_size=64, validation_split=0.1)

4. Bash Script to Automatically Acquire and Process Traces

#!/bin/bash
for i in {1..1000}; do
    python acquire_trace.py --output trace_$i.npy
    python preprocess_trace.py trace_$i.npy --output norm_$i.npy
done

python train_cnn.py --traces norm_*.npy --labels labels.csv

Advanced Topics: Future Directions and Open Challenges

1. Transferability and Generalization

  • Models trained on one device often underperform on variants (due to process noise, layout changes).
  • Research on domain adaptation and transfer learning for EMSCA is ongoing.

2. Remote EM Attacks

  • Early research suggests EM attacks may be feasible at many centimeters/meters in unshielded environments, raising surveillance and counter-intelligence concerns.

3. Countering Deep Learning-based SCA

  • "Adversarial training" and AI-driven shielding are areas of intense focus.

4. Legality and Ethics

  • Where do lawful forensics end and "spyware" begin?
  • Safe, forensically sound procedures are crucial for judicial acceptability.

Conclusion: The Ongoing Arms Race in Hardware Security

As System-on-Chip devices permeate every facet of modern life, their physical side channels—EM emissions among the most potent—have become rich hunting grounds for both attackers and forensic investigators. The marriage of deep learning (notably CNNs) and EM side channel analysis has dramatically lowered the bar for extracting cryptographic secrets from complex chips, sometimes with alarming efficiency.

However, it's not an uneven game. Countermeasures continue to evolve, and the broader cybersecurity and forensics communities are honing procedures to leverage—or defend against—these techniques ethically and effectively. The future of SoC security and digital forensics will hinge on our collective ability to advance tools and best practices in this rapidly shifting domain.


References

  1. CNN based profiled side-channel attacks on AES cipher implemented on HiSilicon Kirin 620 SoC
  2. Potential for Progressing Hindered Digital Forensic Analysis using EM Side Channels (Asayakkara et al.)
  3. The EM Side-Channel(s) | Revised Papers from the 4th Workshop on Cryptographic Hardware and Embedded Systems (CHES2002)
  4. Langer EM Probes – RF analysis tools for hardware security
  5. Deep Learning-based Side-channel Attacks and Countermeasures
  6. EM Side Channel Analysis for IoT and Embedded Devices - Black Hat Slides

🚀 READY TO LEVEL UP?

Take Your Cybersecurity Career to the Next Level

If you found this content valuable, imagine what you could achieve with our comprehensive 47-week elite training program. Join 1,200+ students who've transformed their careers with Unit 8200 techniques.

97% Job Placement Rate
Elite Unit 8200 Techniques
42 Hands-on Labs