Machine learning has changed side channel attacks from a niche lab technique into a repeatable engineering workflow, and embedded cryptography teams need to update their threat models, countermeasures, and validation methods. Traditional power analysis and EM analysis often relied on careful feature selection and alignment by an expert. Modern ML, especially deep learning, can learn features directly from raw traces, tolerate more noise and misalignment, and can reduce the number of traces needed for practical key recovery in some scenarios. For many products, the biggest change is not a new leak, it is that attackers can extract more value from leaks you already have.
For teams building embedded crypto in IoT devices, secure elements, automotive ECUs, medical devices, payment terminals, or industrial controllers, ML-based side channel analysis changes what “good enough” means. Countermeasures that were previously considered adequate against classical correlation power analysis may fail earlier than expected when the attacker can train models, apply data augmentation, and use automated hyperparameter searches. Evaluation practices also need to evolve, because a design that passes a basic leakage test might still be learnable by a profiled ML attacker.
What changes for embedded crypto, in practical terms
Immediate action checklist for embedded teams
QVLx Labs teams that treat side channel security as a lifecycle activity, rather than a one time test, tend to cope best with the ML shift. The rest of this article explains why ML is so effective, what leakage sources matter most in embedded crypto, which countermeasures still work, which ones are often oversold, and how to validate in a way that reflects the modern attacker.
Side channel attacks in one paragraph
Side channel attacks recover secrets by observing physical or microarchitectural effects of computation, instead of breaking the math. For embedded devices, common channels include power consumption, electromagnetic emissions, timing differences, and sometimes fault behavior that can be induced. Because crypto algorithms manipulate key dependent intermediate values, any correlation between those values and an observable signal can allow statistical key recovery. The classic examples are differential power analysis and correlation power analysis, where many traces are averaged and correlated with a leakage model.
Why machine learning is a step change, not just a faster CPA
Classical side channel analysis often depends on an analyst choosing a leakage model and selecting points in time where the leakage is strongest. That works well when leakage is simple and aligned, such as an 8 bit microcontroller writing an S-box output to a register. In more complex systems, leakage can be spread out, non-linear, and mixed with noise sources like caches, pipelines, buses, peripherals, power management, and clocking. ML replaces hand crafted feature engineering with automatic feature discovery, and it can learn non-linear relationships that a linear correlation test will miss.
Another key difference is that ML can treat side channel traces as classification or regression data. In a profiled setting, you collect traces where you know the key, or at least you know the sensitive intermediate value, then train a model to predict that intermediate from the trace. Once trained, you apply the model to an unknown target trace and get a probability distribution over hypotheses. That distribution can be combined across traces to rank key candidates. This probability based approach can remain effective even when each trace has very low signal to noise ratio.
The attacker models that matter most
Embedded crypto teams often plan for “non-profiled” attacks, where the attacker only has the target device and no labeled training data. In practice, many real attackers can profile, at least partially. They can buy the same device, or a development kit, or they can compromise one unit and extract firmware. Even if the exact key differs, many side channel attacks target intermediate values that depend on known plaintext or ciphertext and a small part of the key, which makes labeling feasible. ML makes this profiled workflow easier to automate and scale.
It helps to separate four common attacker models, because the right defenses and tests depend on which one is realistic for your product.
Embedded crypto leakage sources ML can exploit
Most embedded crypto leakage still comes from data dependent switching activity. When transistors switch, they draw current. That current flows through the power distribution network and radiates EM fields. The important detail is that leakage is often not localized to one instruction. It can appear in the instruction that computes the value, in a subsequent store, in a bus transfer, in cache line fills, or in memory contention. Deep models can integrate evidence across these dispersed effects.
Common leakage sources in embedded implementations include the following.
What “deep learning side channel attacks” actually do
A typical deep learning side channel attack trains a neural network to map an input trace, or a window of a trace, to a label such as an S-box output class, a masked share, or a byte hypothesis. Convolutional neural networks are common because they can detect local patterns and are somewhat robust to small shifts in time. Recurrent networks and attention based models can capture longer dependencies. Some attackers use feature extraction layers, then a classifier. Others learn end to end from raw samples.
In a profiled attack, the workflow often looks like this.
In a non-profiled setting, ML can still help by learning embeddings, denoising, alignment, or clustering. For example, autoencoders can reduce noise and extract representations that improve classical attacks. Unsupervised methods can separate trace segments or detect leakage regions automatically, which reduces the expertise required.
Why ML is good at defeating “cheap” countermeasures
Many embedded products rely on countermeasures like added noise, random delays, or simple shuffling of operation order. These techniques can raise the cost of an attack, but they often do not eliminate the underlying leakage. ML thrives when there is a consistent but weak signal. With enough data, a model can average out noise, learn invariances, and learn to align or ignore irrelevant parts of traces.
Random delays and jitter are particularly fragile. If the delay distribution is limited, a model can learn to be shift-invariant. If the jitter is correlated with other device states, the model can incorporate that as context. If the operation repeats many times, ML can exploit repeating structure. In short, desynchronization is not a replacement for provable leakage reduction like correct masking or hardware supported isolation.
What changes specifically for embedded cryptographic implementations
Embedded crypto used to be split into two worlds, algorithm designers and firmware implementers. ML-driven side channel attacks force a third world to be central, hardware and physical behavior. Decisions about board layout, decoupling, regulator choice, clock sources, and secure boot flows can influence whether leakage is exploitable. ML makes it more likely that even “small” physical artifacts become exploitable in aggregate.
Three concrete shifts matter most.
Case study patterns, where ML tends to win
Without naming specific vendors, ML often succeeds in the same recurring situations. First, when masking is applied at a high level but compiler optimizations reintroduce data dependent behavior, such as spilling shares to memory or combining them in registers. Second, when randomness is under provisioned, reused, or biased, so masked shares are not independent. Third, when the implementation has repeating structure that makes alignment easier, for example repeated rounds of AES or repeated ladder steps in ECC.
ML also performs well when leakage is multi-source. For instance, a power trace might contain a weak leakage of a key byte at several times, across multiple buses and stores. A linear correlation test might only catch one of those times. A neural network can integrate them all, increasing effective signal to noise ratio.
Embedded targets, what is realistically at risk
In many products, an attacker does not need to recover a long term device unique key to cause harm. Side channel extraction of session keys, authentication secrets, firmware update keys, or TLS private keys can be enough. For constrained devices that terminate secure channels, a single extracted private key can enable cloning, impersonation, or decryption of recorded traffic. For payment or access control systems, extracted secrets enable fraud. For industrial systems, extracted signing keys can enable malicious firmware distribution.
Even if your device uses a secure element, the overall system can still be affected. For example, if the host microcontroller runs cryptography in software for legacy reasons, or if it handles key derivation, password hashing, or application-layer crypto, those routines can leak. ML side channel attacks push teams to inventory every cryptographic computation path, not just the ones that were intended to be “security critical”.
How ML changes the economics of an attack
Side channel attacks used to be described as expensive, requiring specialized expertise. The hardware is still non-trivial, oscilloscopes, probes, amplifiers, and fixtures cost money. But the expertise barrier is dropping. Open datasets, open source toolchains, and reusable model architectures make it easier to apply ML. Training compute is widely available. Hyperparameter optimization and automated preprocessing can replace some of the manual intuition.
For defenders, this means the expected attacker skill distribution changes. You should assume that more attackers can run sophisticated analysis, and that they can iterate quickly. If your product has a large installed base, the payoff for an attacker to build a good model can be large, because the model transfers to many targets.
Metrics that embedded teams should adopt
A major validation gap is that teams measure the wrong thing. Passing a single test vector or passing functional compliance says nothing about side channel resistance. Similarly, a failed CPA run in one setup does not prove security. ML pushes defenders to adopt metrics that reflect real key recovery.
Leakage assessment, the role of TVLA
Test Vector Leakage Assessment, often called TVLA, is widely used because it is relatively fast and does not require guessing the key. It compares distributions of traces under two input classes, often fixed inputs versus random inputs. A statistically significant difference suggests leakage. However, ML changes how you should interpret TVLA. Passing a basic first order t-test does not guarantee resistance to higher order attacks, and it does not guarantee resistance under different operating conditions. Conversely, failing TVLA signals trouble, because if you can detect leakage, ML can often exploit it.
Teams should treat TVLA as a gate, not as a certificate. Use it early to catch gross leakage regressions, then follow with targeted attack evaluations, including profiled ML attacks if your threat model includes them.
Profiled attacks are the new baseline for many products
Profiled attacks used to be associated with smartcards and high assurance evaluations. Today, the ability to buy identical consumer devices makes profiling feasible for many targets. If your product is sold widely, assume an attacker can get multiple units. If your product is an industrial controller, assume a motivated attacker can get a spare part. If your device is part of a fleet, assume one device can be sacrificed to train an attack that works against the rest.
This is why deep learning based profiled attacks matter. They are strong in the exact scenario where the attacker has a training device and wants to attack many deployed devices. For embedded crypto, that often means a single compromised device can endanger a whole product line if the same cryptographic implementation and leakage characteristics are shared.
Countermeasures that still matter, and how ML affects them
Defending against ML-based side channel attacks is not fundamentally different from defending against classical side channel attacks. The core goal is to break the relationship between secret dependent intermediates and observable signals. What changes is that weak countermeasures provide less comfort, because ML can extract weaker signals. Strong countermeasures remain strong, but they must be implemented correctly.
Masking, why correctness dominates
Masking splits sensitive values into shares combined with randomness, so any single share is independent of the secret. In principle, correct first order masking prevents first order leakage, and higher order masking addresses multi-point leakage. In practice, many failures happen in the details, glitches in hardware, coupling between shares, reuse of masks, insufficient randomness, or software transformations that inadvertently recombine shares.
ML impacts masking in two ways. First, it can exploit small residual leakages that remain when masking is imperfect, making “almost masked” worse than you might expect. Second, it can make higher order exploitation more practical by learning complex combinations of samples. This does not mean masking is obsolete. It means you must treat masking as an engineering discipline with careful proofs, code reviews, compiler constraints, and validation, not as a library checkbox.
Hiding and noise, useful but easy to overestimate
Hiding techniques aim to reduce signal to noise ratio, for example by adding noise, balancing power, filtering, or randomizing execution. They can increase the trace count required for an attack. The risk is that teams interpret increased difficulty as security. ML can reduce the advantage you gain from hiding by learning denoising filters, learning to focus on invariant components, and integrating evidence across time. Hiding is best used as a complement to masking, not as the only defense.
When you do use hiding, measure it properly. Ask how many traces an ML attacker needs for key recovery under your expected access model. A countermeasure that turns 2,000 traces into 50,000 traces might still be inadequate if the attacker can collect 100,000 traces in a day from an automated fixture.
Constant-time, necessary but not sufficient
Constant-time coding is vital for preventing timing attacks and many microarchitectural attacks. It also improves side channel posture indirectly by reducing control flow variation. But constant-time does not prevent power and EM leakage from data dependent switching. ML based attacks target those physical channels effectively. For embedded crypto, constant-time is a baseline requirement, especially for public key crypto and protocol code, but you should not treat it as the final word on side channel resistance.
Randomization and shuffling, when it helps
Operation shuffling and random delays aim to misalign traces. They can help, particularly against simple attacks with limited preprocessing. ML reduces their value, but does not erase it. Randomization can still increase the complexity of the learning problem, especially if the randomization space is large and truly independent per operation. The lesson is to design randomization to be high entropy and hard to learn, and to combine it with leakage reduction techniques.
Hardware choices, secure elements and accelerators
Using a secure element or a hardware crypto accelerator can improve side channel resistance, but only if the hardware is designed for it. Some accelerators prioritize performance, not side channel safety, and they can leak heavily. Secure elements often include dedicated countermeasures and can be certified, but integration choices still matter. For example, if the host handles plaintext keys before sending to a secure element, the host can leak. If the host derives keys, the derivation can leak. If the system uses shared power rails, the secure element leakage might be measurable externally depending on board design.
For embedded teams, the key change is that you should treat hardware selection as a side channel decision, not just a performance decision. Ask for side channel evaluation reports, understand the scope, and validate in your own system context.
Practical guidance for building resistant embedded crypto
The right approach depends on your constraints, but a robust strategy usually includes a combination of design rules, implementation techniques, and test discipline.
1) Start with a threat model that includes ML
Define what the attacker can measure, power, EM near field, EM far field, timing, and what they can control, inputs, triggers, temperature, voltage. Define whether they can profile using identical devices. Define the maximum number of traces you think they can collect. These parameters guide whether you need masking, what order, and how much validation to invest in.
2) Prefer side channel hardened primitives and libraries
Whenever possible, use cryptographic libraries and primitives designed with side channels in mind, including masked implementations where appropriate. For symmetric crypto, consider implementations that avoid lookup tables on platforms with caches, and that keep operations regular. For public key crypto, use constant-time scalar multiplication, avoid secret dependent branches and memory accesses, and consider algorithmic forms that are more amenable to masking or regular execution.
3) Control the compiler and the build
Many side channel countermeasures can be broken by compilation. Inline decisions, register allocation, spilling, and instruction selection can change leakage. If you use masking, you may need compiler barriers, volatile semantics, or specialized toolchains. At minimum, lock down compiler versions, flags, and link time optimizations, and re-run leakage assessment when anything changes.
4) Treat randomness as a security dependency
Masking and shuffling depend on high quality randomness. Validate your RNG under real conditions, including temperature extremes and voltage variation. Ensure per operation fresh masks, avoid reuse across operations, and avoid correlations introduced by deterministic scheduling. Consider health tests, and define what the system should do if RNG quality degrades, for example fail closed, rate limit, or switch modes.
5) Design the board as part of the defense
Board layout, decoupling, and power distribution can affect both leakage amplitude and measurement ease. While you cannot rely on layout alone for security, you can avoid making attacks easy. Avoid exposing clean measurement points, consider separating noisy and sensitive domains thoughtfully, and consider how ground return paths and regulator placement affect observable signals. If your product includes debug headers or test pads, plan for how those can be abused for measurement and triggering.
6) Build an evaluation harness early
Side channel evaluation is much easier if you can repeat operations, control inputs, and collect traces reliably. Add a test mode in development builds that runs the target crypto routine repeatedly with controlled inputs and emits minimal other activity. Provide a trigger pin or a software marker if possible. The earlier you can measure, the easier it is to fix, because late fixes often require invasive redesign.
How to test with ML in mind, without becoming a research lab
You do not need to invent new neural networks to test effectively. The goal is to avoid false confidence. A practical approach is to implement a standard set of attacks and checks and run them consistently.
The key is consistency and coverage. An ML attack evaluation does not need to be exhaustive to be useful. Even a modest profiled model can reveal whether a countermeasure is fundamentally working or merely making classical correlation inconvenient.
Important details about data collection that defenders often miss
Attack quality depends heavily on trace quality, and defenders should understand what makes measurement easier. Good triggering and stable timing reduce the trace count required. Low noise power rails, accessible ground, and repeatable operations help attackers. If your device exposes a GPIO that toggles at the start of crypto, that is a gift. If your firmware runs the crypto operation in a quiet loop, that is also helpful to attackers. You can still have test hooks for development, but plan to remove or lock them down in production builds.
Another subtle factor is trace diversity. If the device runs the same operation on similar inputs, attackers can collect clean datasets. Protocol design can sometimes limit repeated encryptions under the same key, rate limit sensitive operations, or enforce re-keying. These are not replacements for side channel countermeasures, but they can meaningfully reduce practical risk in the field.
Embedded public key crypto, why it is ML-sensitive
Public key operations like ECDSA, EdDSA, RSA, and key exchange routines often involve long sequences of operations that depend on secret scalars. Constant-time ladder algorithms reduce leakage, but implementation mistakes are common, especially in big integer arithmetic, modular reduction, and conditional moves. ML can exploit long range dependencies and repeated patterns across the scalar multiplication loop. It can also learn device-specific characteristics that influence leakage at different stages of the computation.
For signatures, side channel leakage can be catastrophic because recovering the ephemeral nonce, or even partial information about it, can reveal the long term private key. Robust nonce generation, deterministic nonce schemes, and side channel hardened scalar multiplication are all important. ML does not create new math weaknesses here, it makes existing leakage more likely to be exploitable at feasible trace budgets.
Embedded symmetric crypto, the AES and friends reality
AES remains a prime target in embedded devices, especially when implemented in software on small microcontrollers. Table based implementations can leak via memory access patterns and via power. Bit-sliced implementations can reduce some forms of leakage, but they can still leak in power and EM. Hardware AES engines can be secure or leaky depending on design. ML can learn from the superposition of multiple rounds and from subtle board level artifacts, so defenders should not assume that “AES is fast, so it is safe”.
Similar considerations apply to lightweight ciphers and hashes. Lightweight does not mean side channel safe. In fact, compact implementations sometimes have more pronounced leakage because fewer operations dominate the signal.
Higher order attacks, and why ML matters
If an implementation uses first order masking, the attacker may need to combine information from multiple leakages to recover the secret, this is a higher order attack. Classical higher order attacks require careful preprocessing, such as multiplying centered samples or using combinations of points of interest. ML can implicitly learn these combinations, especially when the model has enough capacity and the training set is large enough. This can reduce the barrier for higher order attacks, particularly in profiled scenarios.
For defenders, the implication is that first order masking should be validated not only with first order leakage tests. You should consider second order and beyond, and you should include analysis that can detect multi-point leakage. You also need to ensure the masking scheme is implemented in a glitch-resistant manner if hardware coupling is involved.
Device variation, generalization, and what it means for both sides
One hope defenders sometimes have is that per-device variation will prevent a model trained on one device from working on another. In practice, transferability is often good enough, especially within the same product and revision. Attackers can also use techniques like domain adaptation, fine-tuning with a small number of traces from the target, or training on multiple devices to build a generalized model.
This cuts both ways. Defenders must test across devices, not just one golden unit, because some units may leak more. At the same time, defenders can sometimes benefit from introducing meaningful variation, for example per-device randomization of some internal parameters. However, do not rely on variation as the primary defense. Assume an attacker can collect at least a small calibration set from the target.
Common misconceptions that lead to insecure embedded crypto
What to document for a side channel aware embedded crypto design
Side channel security benefits from good documentation because it reduces accidental regressions. Embedded teams should document which cryptographic operations are expected to be side channel resistant, what threat model they target, what countermeasures are applied, and what assumptions exist about randomness, clocking, and board design.
Operational changes, how teams should adapt
ML-driven side channel risk is as much a process problem as a technical one. Teams should shift left, measuring early prototypes, and they should treat side channel security as continuous. Add side channel considerations to code review checklists, to hardware design reviews, and to supplier requirements. Plan for a “side channel budget” in performance targets, because adding countermeasures often costs cycles, memory, or silicon area. It is better to plan for that cost than to scramble after a late penetration test reveals leakage.
Another operational change is cross-discipline collaboration. Firmware, hardware, and security teams need a shared view of leakage risk. For example, a power saving feature that changes clock gating may alter leakage patterns. A PCB change that moves a regulator may change measurement quality. A compiler update may break masking assumptions. Treat these as security-relevant changes that require re-validation.
Future trends, what to expect next
ML side channel attacks are still evolving. Several trends are likely to increase pressure on embedded designs. Transfer learning will make it easier to reuse models across device families. Self-supervised learning can reduce the need for labels, widening the set of feasible targets. Multi-modal attacks that combine power and EM channels, or combine timing with EM, will become more common. Generative models can help synthesize or augment traces, improving training. Finally, automation will improve, making it easier for attackers to run many experiments and pick the best.
For defenders, this suggests a conservative stance. If your design only withstands the attacker you tested against, it may not withstand the attacker that exists a year from now. Favor countermeasures with strong theoretical grounding and robust validation evidence, and invest in regression testing so you can adapt as the threat landscape changes.
Conclusion, what embedded crypto teams should do now
Machine learning does not create side channel leakage, it makes leakage easier to exploit. For embedded crypto, the practical change is that weak countermeasures and shallow testing no longer provide reliable confidence. The most effective response is to update threat models to include profiled ML attackers, prioritize true leakage reduction techniques like correct masking and constant-time execution, treat randomness as a critical dependency, and build a repeatable validation pipeline that includes leakage detection and ML-aware evaluation. If you do those things, you can remain ahead of the curve as ML-based side channel analysis continues to mature.