Side-channel monitoring of a monitored device
Patent Information
- Application Number
- PCT/EP2025/054489
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2026-08-27
Smart Images

Figure EP2025054489_27082026_PF_FP_ABST
Abstract
Description
[0001] SIDE-CHANNEL MONITORING OF A MONITORED DEVICE TECHNICAL FIELD
[0002] Embodiments presented herein relate to a method, a monitoring device, a computer program, and a computer program product for side-channel monitoring of a monitored device.
[0003] BACKGROUND
[0004] In general terms, a communication device which has been infected by a malware can act normally towards a controller by detaching the internal measurements with the status data supplied to the controller. Typical communication devices that can be affected by malware are smartphones, which are highly susceptible due to their widespread use, constant internet connectivity, and the installation of third-party applications that may contain malicious code. Tablets are similarly vulnerable, especially when used for browsing the web, downloading apps, or connecting to unsecured networks. Laptops and desktop computers are also common targets for malware, as they often store sensitive data and are used for a wide range of online activities, including email communication, file sharing, and accessing cloud services. Routers and network switches can be compromised by malware to intercept or redirect network traffic, enabling attackers to eavesdrop on communications or disrupt network services. In addition, smart home devices such as voice assistants, smart TVs, and connected appliances can be affected by malware, particularly if they lack robust security measures. These devices are part of the Internet of Things (loT) ecosystem and often communicate with each other over local networks, making them potential entry points for cyberattacks. Wearable devices, like smartwatches and fitness trackers, which sync with smartphones and other devices, can also be targeted by malware to harvest personal information. Lastly, enterprise communication systems, including Internet Protocol (IP) phones, video conferencing equipment, and corporate messaging platforms, are vulnerable to sophisticated malware attacks aimed at espionage or data theft within organizational networks. Smart sensors and actuators, which are part of the Industrial Internet of Things (IIoT) or Cyber-Physical Systems, are increasingly targeted by malware due to their connectivity and often limited security features. Compromising these devices can lead to inaccurate data reporting, process inefficiencies, or physical damage to equipment. Industrial equipment is highly susceptible to malware attacks, particularly in environments where operational technology (OT) systems are integrated with information technology networks. A notable example is the Stuxnet malware, which targeted industrial control systems (ICS) to disrupt operations in critical infrastructure. Typical industrial equipment that can be affected by malware includes programmable logic controllers (PLCs), which are used to automate machinery in manufacturing plants, water treatment facilities, and power generation stations. Malware targeting PLCs can alter the behavior of physical equipment, leading to productionerrors, equipment damage, or safety hazards. Further, malware attacks using botnets infect communication devices and turn them into remotely controlled nodes. In this way, the thus compromised communication devices can be coordinated to launch large-scale attacks, such as distributed denial of service (DDoS) attacks, data theft, or system disruptions, etc.
[0005] Side-channel emission, or leakage, can be defined as a non-intended information channel from a communication device. The side-channel emission may pertain to, be indicative of, or represent, e.g., power consumption, electromagnetic (EM) emissions, thermal signatures, sound and optical emissions. Side-channel emissions can be used to reverse engineer software running on a processor. The side-channel emissions are typically unintendedly emitted by the communication device, and although sometimes maliciously exploited by attackers to extract secrets, sidechannel emissions can also be used to monitor the state of the communication device as a means of detecting malicious software alterations. For this purpose, an external monitoring device registers the side-channel emissions from the communication device and concludes if the communication device behaves normally according to some pre-defined criteria. The communication device is here commonly referred to as a device under monitoring (DuM) or simply as a monitored device. For this reason, the communication device will hereinafter be referred to as a monitored device.
[0006] Reference is here made to the block diagram too of Fig. 1 in which is illustrated a monitored device 110 and a monitoring device 120. The monitored device 110 is located in a physical environment 150. The monitored device 110 is executing a sequence of software instructions and therefore as a biproduct generates side-channel information, represented by emissions 130 in the illustrative example of Fig. 1. The side-channel information 130 is observed by the monitoring device 120 obtaining a sequence of measurements 140 of the side-channel. The sequence of measurements 140 thus represents an observation of the side-channel for the sequence of instructions executed by the monitored device 110.
[0007] There exist several techniques for side-channel monitoring. In some examples the monitoring device is oblivious to the internal state of the monitored device and is, by analyzing the observations, only configured to distinguish between “normal” or “abnormal” side-channel emissions. In other examples, the monitor device is, by analyzing the observations, capable of connecting certain states or operations within the monitored device to certain side-channel emission patterns. In the latter example, the monitoring device may also detect “illegal” state transitions within an execution in the monitored device, i.e., where the execution flow of the monitored device is abnormal.One advantage of monitoring of side-channel emissions is that it is very hard to avoid or intentionally (re-)shape side-channel emissions, thus preventing the attacker, to via malware, shape the side-channel emissions such that they appear to represent benign code. Another advantage is that the monitoring device can be kept physically separated from the monitored device, thus reducing the risk of the monitored device infecting the monitored device with malware, etc. All in all, this makes it difficult for an attacker to remain undetected as a malware attack on a monitored device unavoidably will cause abnormal changes into the side channel emissions.
[0008] However, current side-channel monitoring techniques require the monitor to have observed the expected side-channel beforehand for making a comparison. In other words, two observations of side-channel emissions are needed: a first observation to be used as a reference and a second observation to be used for live monitoring of the monitored device. It must here be guaranteed that the monitored device is executing benign code when the first observation is made.
[0009] Otherwise, the first observation cannot be used as a reference. Requiring two observations is thus an issue as the side-channel emission monitoring becomes less flexible. Requiring two observations also makes the monitoring process vulnerable when software updates are applied. This is because the monitoring device will have to relearn the golden trace (i.e., the expected side-channel emissions for a given sequence of instructed to be executed by the monitored device), without knowing if unintended software components have been snuck into the updated software or not.
[0010] Hence, there is still a need for improved side-channel monitoring techniques.
[0011] SUMMARY
[0012] An object of embodiments herein is to provide side-channel monitoring that does not suffer from the above issues, or at least where the above issues have been mitigated or reduced.
[0013] A particular object is to enable side-channel monitoring of a monitored device that only requires the monitoring device to make one observation.
[0014] According to a first aspect there is presented a method for side-channel monitoring of a monitored device. The method is performed by a monitoring device. The method comprising obtaining a sequence of instructions to be executed by the monitored device. The method comprising obtaining a side-channel representation reference sequence for the sequence of instructions from a machine learning model. The machine learning model upon is fed the sequence of instructions as input produces the side-channel representation reference sequence as output. The method comprising obtaining a side-channel measurements sequence from the monitored device. The method comprising evaluating whether the monitored device executesthe sequence of instructions or not by comparing the side-channel representation reference sequence to the side-channel measurements sequence.
[0015] According to a second aspect there is presented a monitoring device for side-channel monitoring of a monitored device. The monitoring device comprising processing circuitry. The processing circuitry is configured to cause the monitoring device to obtain a sequence of instructions to be executed by the monitored device. The processing circuitry is configured to cause the monitoring device to obtain a side-channel representation reference sequence for the sequence of instructions from a machine learning model. The machine learning model upon is fed the sequence of instructions as input produces the side-channel representation reference sequence as output. The processing circuitry is configured to cause the monitoring device to obtain a sidechannel measurements sequence from the monitored device. The processing circuitry is configured to cause the monitoring device to evaluate whether the monitored device executes the sequence of instructions or not by comparing the side-channel representation reference sequence to the side-channel measurements sequence.
[0016] According to a third aspect there is presented a computer program for side-channel monitoring of a monitored device. The computer program comprises computer code which, when run on processing circuitry of a monitoring device, causes the monitoring device to perform actions. One action comprises the monitoring device to obtain a sequence of instructions to be executed by the monitored device. One action comprises the monitoring device to obtain a side-channel representation reference sequence for the sequence of instructions from a machine learning model. The machine learning model upon is fed the sequence of instructions as input produces the side-channel representation reference sequence as output. One action comprises the monitoring device to obtain a side-channel measurements sequence from the monitored device. One action comprises the monitoring device to evaluate whether the monitored device executes the sequence of instructions or not by comparing the side-channel representation reference sequence to the side-channel measurements sequence.
[0017] According to a fourth aspect there is presented a computer program product comprising a computer program according to the third aspect and a computer readable storage medium on which the computer program is stored. The computer readable storage medium could be a non-transitoiy computer readable storage medium.
[0018] Advantageously, the herein disclosed side-channel monitoring does not suffer from the above issues, or at least the above issues are mitigated or reduced.
[0019] Advantageously, the herein disclosed side-channel monitoring only requires the monitoring device to make one observation. The machine learning model can be trained based onmeasurements obtained from another device of same or similar type as the monitored device. Hence, the herein disclosed side-channel monitoring does not require any enrollment phase where ground truth side-channel sequences are obtained from the monitored device, making side-channel monitoring more flexible compared to the prior art. The herein disclosed sidechannel monitoring can therefore be combined with software updates, where prior art would require a new enrollment phase.
[0020] Advantageously, the herein disclosed side-channel monitoring enables determination of whether an observed set of side-channel measurements obtained during execution of software on a monitored device corresponds to specific code (or set of instructions).
[0021] Other objectives, features and advantages of the enclosed embodiments will be apparent from the following detailed disclosure, from the attached dependent claims as well as from the drawings.
[0022] Generally, all terms used in the claims are to be interpreted according to their ordinary meaning in the technical field, unless explicitly defined otherwise herein. All references to "a / an / the element, apparatus, component, means, module, step, etc." are to be interpreted openly as referring to at least one instance of the element, apparatus, component, means, module, step, etc., unless explicitly stated otherwise. The steps of any method disclosed herein do not have to be performed in the exact order disclosed, unless explicitly stated.
[0023] BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The inventive concept is now described, by way of example, with reference to the accompanying drawings, in which:
[0025] Fig. 1 is a block diagram of a monitored device and a monitoring device according to embodiments;
[0026] Fig. 2 is a block diagram of a monitored device, a monitoring device, and a server according to embodiments;
[0027] Fig. 3 is illustrated code to side-channel model according to an embodiment;
[0028] Fig. 4 is a flowchart of methods according to embodiments;
[0029] Fig. 5 is a flowchart of a method according to an embodiment;
[0030] Fig. 6 is shown an example of sequences of instructions and a corresponding trained sidechannel emission patterns according to an embodiment;Fig. 7 is a schematic diagram showing structural units of a monitoring device 120, according to an embodiment; and
[0031] Fig. 8 shows one example of a computer program product comprising computer readable storage medium according to an embodiment.
[0032] DETAILED DESCRIPTION
[0033] The inventive concept will now be described more fully hereinafter with reference to the accompanying drawings, in which certain embodiments of the inventive concept are shown. This inventive concept may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided by way of example so that this disclosure will be thorough and complete, and will fully convey the scope of the inventive concept to those skilled in the art. Like numbers refer to like elements throughout the description. Any step or feature illustrated by dashed lines should be regarded as optional.
[0034] As noted above, there is still a need for improved side-channel monitoring techniques, and particular object is to enable side-channel monitoring of a monitored device that only requires the monitoring device to make one observation.
[0035] At least some of the herein disclosed embodiments are therefore based on enabling efficient and accurate side-channel monitoring of a monitored device without requiring any enrolment phase. At least some of the herein disclosed embodiments are based on using a machine learning model to generate synthetic side-channel information based on knowledge of the sequence of instructions to be executed on the monitored device and on a code to side-channel representation model. The thus generated side-channel information acts as side-channel representation reference sequences that can be compared to an actual side-channel measurements sequence produced by the monitored device as a side product when executing a given sequence of instructions. The monitoring device can thereby determine whether an observed execution of software in the monitored device is legitimate or malicious.
[0036] Reference is next made to the block diagram 200 of Fig. 2, which comprises a monitored device 210, a monitoring device 220, and a server 230 according to embodiments.
[0037] The monitoring device 220 is configured to perform side-channel monitoring of the monitored device 210 according to the herein disclosed embodiments and comprises, or implements, components that collectively facilitate this functionality. These components will be described next. The monitoring device 220 comprises a processor 221, which may be implemented as a central processing unit (CPU), graphics processing unit (GPU), microprocessor, applicationspecific integrated circuit (ASIC), or field programmable gate array (FPGA). The processor is responsible for executing the code necessary to control the operation of the monitoring device 220 and manage its various components. The monitoring device 220 comprises a side-channel measurement component 222 configured to obtain side-channel measurements from the monitored device 210. This component may comprise both hardware and software elements. The hardware element maybe defined by devices such as electromagnetic probes or other suitable measurement instruments capable of capturing side-channel emissions from the monitored device 210. The software element is responsible for processing and storing the captured side-channel measurements for further analysis. The monitoring device 220 comprises an evaluation component 223, which may be implemented as either a software-element or a hardware-based element. Its primary function is to compare a generated set of side-channel representation reference sequences to an obtained set of measurements to detect discrepancies or anomalies. The monitoring device 220 further comprises a code to side-channel representation model 224 and optionally also a jointly trained side-channel to representation model 225. Both models are sequence-to-sequence models (usually with an encoder-decoder style architecture) trained on datasets consisting of pairs of sequence of instructions and their corresponding side-channel sequence. Further aspects of the code to side-channel representation model and side-channel to representation model will be disclosed below with reference to Fig. 3. In one example, the monitoring device 220 obtains the machine-level code (instructions) directly. However, in other examples, the monitoring device 220 receives high-level source code. In the latter examples, the monitoring device 220 comprises functionality to convert, or compile, the higher-level source code into machine-level code (or instructions) before performing side-channel analysis. The monitoring device 220 comprises a communication component 226 configured for communication with the server 230.
[0038] The monitored device 210 is configured to execute code that is subject to side-channel monitoring by the external monitoring device 220. The monitored device 210 comprises components that will be described next. The monitored device 210 comprises a processor 211, which may be implemented as a CPU, GPU, microprocessor, ASIC, or FPGA, and is responsible for executing the code within the monitored device 210. The processor carries out the instructions and processes the data according to the code it receives. Side-channel emissions are generated as a byproduct of this execution. The code executed by the monitored device 210 consists of machine-level instructions and associated data. This code is executed while the monitoring device 220 performs side-channel measurements to capture the physical emission patterns generated during code execution. These emissions are then analyzed by the monitoring device 220 to evaluate behavior, performance, security characteristics, etc. of the monitored device 210. The code may be kept in a storage 212.The server 230 is configured to support the monitoring process by supplying code and, optionally, metadata to the monitoring device 220. In some examples, the server 230 is also capable of receiving evaluation results generated by the monitoring device 220 based on the obtained side-channel measurements. The server 230 therefore comprises a communication component 231 configured for communication at least with the monitoring device 220 and possibly also with the monitored device 210. In a distributed implementation, certain functionalities of the monitoring process maybe outsourced to the server 230. This can include tasks such as data processing, analysis, or management of monitoring operations. The server 230 therefore comprises a storage component 232 configured to store a set of instructions, which may include higher-level programming language code (source code) or machine-level instructions (machine code), representing the code intended for execution on the monitored device 210. The server 230 may further be configured to send these instructions to the monitored device 210 for execution. This allows the server 230 to manage and distribute code efficiently within the monitoring system. In other implementations, the server 230 functions primarily as a data repository or storage unit, responsible for maintaining code, metadata, sidechannel measurement data, and evaluation results.
[0039] In Fig. 3 is illustrated a code to side-channel representation model 300 according to embodiments. In general terms, the code to side-channel representation model 300 is a sequence-to-sequence model where a machine learning (ML) model 320 is trained on datasets in terms of pairs, where each pair consists of a sequence of instructions and its corresponding side-channel sequence. One respective ML model 320 may be trained for each type of monitored device (e.g., based on an expected emission model for each type of monitored device). In short, the ML model 320 can be trained on pairs of training sequences of instructions and corresponding training side-channel measurements sequences to implement the code to sidechannel model 300. Further aspects of the training of the ML model 320, or the code to sidechannel model 300 in general, will be disclosed below. The description of Fig. 3 therefore focuses on the use of the side-channel model 300 for generating side-channel representation reference sequences for different sequences of instructions. The ML model 320 is configured to receive as input sequences of instructions 310, which, if necessary, are translated into respective sequences of machine-level instructions that will be executed on the monitored device 210. Based on these instructions, the ML model 320 generates an output, in terms of side-channel representation reference sequences 330, that represent the expected side-channel measurement pattern, either explicitly or as an intermediary expressive representation output from the encoder part of the model for each sequence of instructions. The ML model 320 comprises an encoder part 322 and depending on how the comparison will be conducted it may also comprise a decoder part 324 and has access to a waveform model 326. The encoder part 322 is configuredto generate a contextual representation of each of the sequences of instructions and in some examples this representation will be used to compare to a similar contextual representation generated by a similar, but reverse, model that generates the representations from the measured side-channel measurements. In case a decoder part 324 is present, it is configured to map each contextual representation to a respective spectrogram representation. The decoder part 324 is further configured to, according to the waveform model 326, convert a given spectrogram representation to a waveform that represents the side-channel representation reference sequence. As will be disclosed below, different types of metadata 340 can be used by the ML model 320 to further specify the side-channel representation reference sequence to be generated for a given sequence of instructions.
[0040] Fig. 4 is a flowchart illustrating embodiments of methods for side-channel monitoring of a monitored device 110, 210. The methods are performed by the monitoring device 120, 220. The methods are advantageously provided as computer programs.
[0041] S104: The monitoring device 120, 220 obtains a sequence of instructions to be executed by the monitored device 110, 210.
[0042] S110: The monitoring device 120, 220 obtains a side-channel representation reference sequence for the sequence of instructions from the machine learning model 320. The machine learning model 320 upon being fed the sequence of instructions as input produces the side-channel representation reference sequence as output (which can be in latent space form or side-channel measurement form).
[0043] In some aspects, the machine learning model 320, upon being fed the sequence of instructions as input, produces multiple candidate side-channel representation reference sequences as output. Further aspects of the machine learning model 320 will be disclosed below.
[0044] S112: The monitoring device 120, 220 obtains a side-channel measurements sequence from the monitored device 110, 210. Different ways in which the side-channel measurements sequence can be obtained will be disclosed below.
[0045] By means of steps S104 and S110, the monitoring device 120, 220 has obtained a sequence of instructions and therefrom generated a side-channel representation reference sequence using the machine learning model 320. The side-channel measurements sequence obtained in step S112 represents an observation of the side-channel as generated upon the monitored device 110, 210 executing a sequence of instructions. The side-channel representation reference sequence as produced in step S110 can therefore be regarded as a synthetic side-channel sequence that can be compared to the side-channel measurements sequence as obtained in step S112.Ideally, the synthetic side-channel representation sequence will be identical to the side-channel measurements representation sequence. However, it could be that the actual sequence of instructions executed by the monitored device 110, 210 has been affected by malware. As disclosed above, side-channel information is generated as a biproduct when the monitored device 110 is executing any sequence of instructions. The monitoring device 120, 220 can therefore check whether the monitored device 110, 210 actually executes the assumed sequence of instructions or not by comparing the generated side-channel information to the side-channel representation reference sequence, as in step S114.
[0046] S114: The monitoring device 120, 220 evaluates whether the monitored device 110, 210 executes the sequence of instructions or not by comparing the side-channel representation reference sequence to the side-channel measurements sequence. Different ways in which the side-channel representation reference sequence can be compared to the side-channel measurements sequence will be disclosed below.
[0047] In case the machine learning model 320 produces multiple candidate side-channel representation reference sequences as output upon being fed the sequence of instructions as input, the side-channel measurements sequence can in step S114 be compared to more than one of the candidate side-channel representation reference sequences in order to evaluate whether the monitored device 110, 210 executes the sequence of instructions or not.
[0048] Embodiments relating to further details of side-channel monitoring of a monitored device 110, 210 as performed by the monitoring device 120, 220 will now be disclosed with continued reference to Fig. 4.
[0049] In general terms, training of the machine learning model 320 may be performed for the machine learning model 320 to provide appropriate side-channel representation reference sequences as output. Therefore, in some embodiments, the monitoring device 120, 220 is configured to perform (optional) step S102 prior to obtaining the side-channel representation reference sequence in step S104.
[0050] S102: The monitoring device 120, 220 trains the machine learning model 320 to provide sidechannel representation reference sequences as output as well as the ML model (321) to provide side-channel representation reference sequences as output from side-channel measurements. The machine learning model 320 is trained by feeding to it pairs of training sequences of instructions 310 and corresponding side-channel measurements sequences 330 as input. The machine learning model 321 can be jointly trained by feeding the same pairs of side-channel measurements but with the representation reference sequence as output.There can be different ways to train the machine learning model 320. Some aspects have already been disclosed with reference to Fig. 3 and apply here as well. In general terms, the machine learning model 320 is trained with instruction sequences and actual side-channel measurements of these instruction sequences. Hence, in some embodiments, the side-channel training sequences 330 are obtained from executing the training sequences of instructions 310 on the monitored device 110, 210 in a controlled environment.
[0051] Further, in some aspects, the machine learning model 320 is trained for evaluation of several monitored devices 110, 210 and / or types of monitored devices 110, 210. The monitoring device 120, 220 may therefore receive additional information during step S104 and then pick a machine learning model 320 that corresponds to the particular monitored device 110, 210. This additional information may pertain to a device model type, a processor type, specifications of the processor, etc.
[0052] In these aspects, the training of the machine learning model 320 therefore requires additional labeling of the side-channel information. In addition to sequences of instructions, the device, device type and / or processor should therefore be labeled to enable the machine learning model 320 to correctly learn to represent the differences between different execution environments. Therefore, in some embodiments, the monitoring device 120, 220 is configured to perform (optional) step S106 and step S108 prior to obtaining the side-channel representation reference sequence in step S104.
[0053] S106: The monitoring device 120, 220 obtains metadata 340 for retraining of the machine learning model 320.
[0054] Here, the metadata 340 pertains either to the monitored device 110, 210 or to properties of a physical environment 150 in which the monitored device 110, 210 is located. For example, the metadata 340 comprises at least one of: device model type of the monitored device 110, 210, processor information of the monitored device 110, 210, expected clock frequency of the monitored device 110, 210, expected signal strength of the side-channels, noise level of the physical environment 150, physical relation between the monitored device 110, 210 and a measurement device used for obtaining the sequence of measurements 140, type of measurement device used for obtaining the sequence of measurements 140.
[0055] S108: The monitoring device 120, 220 finetunes the machine learning model 320 by retraining the machine learning model 320 with the metadata 340.
[0056] Finetuning here implies that the output of the machine learning model 320, i.e., the sidechannel representation reference sequence representing synthetic measurements, can be fine-tuned to better match the general properties of the obtained measurements. This can, for example, be achieved by modifying the amplitude, samples per clock cycle, noise levels, etc. of the side-channel representation reference sequences.
[0057] As disclosed in step S104, the monitoring device 120, 220 obtains a sequence of instructions to be executed by the monitored device 110, 210. There could be different types of such sequences of instructions. Aspects related thereto will be disclosed next.
[0058] In some aspects, it is assumed that the sequence of instructions is machine-level instructions which can be executed directly by a processor. I.e., the monitoring device 120, 220 receives the exact instructions assumed to be executed on the monitored device 110, 210. Particularly, in some embodiments, the sequence of instructions is a binary file containing sequences of machine-level instructions.
[0059] However, in other embodiments, the sequence of instructions is obtained as high-level source code that, by the monitoring device 120, 220, is compiled to a set of machine-level instructions. For example, the sequence of instructions can be received as code written in a high-level language (such as C / C++, Rust, Lua, etc.), i.e., as so-called source code. Hence, the sequence of instructions can be received in a format which needs to be transformed into instructions to be executed on the monitored device 110, 210. The monitoring device 120, 220 may therefore need to compile high-level source code into machine code suitable for the device type / processor type. In this respect, the source code should be compiled in a way which represent the machine code on the monitored device 110, 210. This can, for example, be achieved by the monitoring device 120, 220 using the same compiler and compiler settings as used to create the executable code for the monitored device 110, 210. To ensure this, the monitoring device 120, 220 may obtain metadata containing the instructions that were given to the compiler when transforming the source code into machine-level instructions. Hence, in some embodiments, the monitoring device 120, 220 has access to information about compiler settings used by the monitored device 110, 210. The high-level source code is then, by the monitoring device 120, 220, compiled to set of machine-level instructions using same compiler settings as used by the monitored device 110, 210. In other examples, the source code is in a language (such as Java) which stores the code in a machine-agnostic intermediary format which is compiled into machine-level instructions just-in-time of its usage. As these kinds of programming language may perform runtime optimization of the code, depending on collected metrics during the execution, the monitoring device 120, 220 may use a digital twin representation of the monitored device 110, 210 to ensure the same optimizations are done in both environments.As disclosed above, the monitoring device 120, 220 in step S112 obtains a side-channel measurements sequence from the monitored device 110, 210. Further aspects relating thereto will be disclosed next. In some embodiments, the side-channel measurements sequence is obtained from a measurement device. The measurement device comprises at least one sensor, such as an electromagnetic probe, temperature sensor, acoustic sensor, or a power meter over a shunt resistor placed in a power supply of the monitored device 110, 210.
[0060] There can be different ways for the monitoring device 120, 220 to compare the side-channel representation reference sequence to the side-channel measurements sequence. In some aspects, multi-head attention, or more particularly a sequential model with an encoder / decoder structure employing for instance transformers to obtain a contextualized representation, can be used to compare a side-channel representation reference sequence to a side-channel measurements sequence by capturing multiple relationships between the sequences simultaneously. The reference and measurement sequences can be processed as queries, keys, and values. The attention mechanism assigns weights to different parts of the sequences based on their relevance to each other. Multiple attention heads operate in parallel, each focusing on distinct features or patterns within the data. The outputs from these attention heads are combined to create a comprehensive representation of the similarity between the sequences. For example, the reference and measurement sequences can be encoded as query (<?), key (X), and value (F) matrices. The attention mechanism may then compute the similarity as:
[0061] softmax
[0062]
[0063] where dkis the dimensionality of the key vectors, and T denotes transpose. Multiple attention heads analyze different aspects of the sequences, and their outputs are concatenated to form a comprehensive similarity representation.
[0064] Further non-limiting examples of different similarity measures that can be used to compare a side-channel representation reference sequence (e.g., synthetically generated side-channel emissions) to a side-channel measurements sequence (e.g., an observation of true side-channel emissions from a device under monitoring) will be disclosed next. In these examples, it is assumed that Xi and Yi are elements of the side-channel reference and measurement sequences, respectively, and Xmand Ymare their means. Further, “S” denotes the summation operator and denotes the scalar multiplication operator.
[0065] According to a first example, the Pearson Correlation Coefficient is used as similarity measure. In short, the Pearson Correlation Coefficient measures the linear correlation between two sequences. It quantifies the degree to which variations in one sequence correspond to variationsin another. The coefficient ranges from -1 to 1, where 1 indicates perfect positive correlation, -1 indicates perfect negative correlation, and o indicates no correlation. It is computed as:
[0066] r = S((Xi - X”)(Yi - Y“)) / V(S(Xi - X"1)2) * V(S(y. . Y“)2)
[0067] According to a second example, the Euclidean Distance is used as similarity measure. In short, the Euclidean Distance quantifies the dissimilarity between two sequences by measuring the straight-line distance between them in multi-dimensional space. It is defined as:
[0068] d = V(S(Xj - Yd2)
[0069] A smaller distance indicates higher similarity.
[0070] According to a third example, Dynamic Time Warping (DTW) is used as similarity measure. In short, DTW aligns two sequences that may vary in time or speed. It identifies an optimal nonlinear alignment by minimizing the cumulative distance between the sequences. DTW is computed through dynamic programming, using a cost matrix to find the least-cost path.
[0071] According to a fourth example, Cosine Similarity is used as similarity measure. In short, Cosine Similarity measures the cosine of the angle between two sequences when viewed as vectors in multi-dimensional space. It is defined as:
[0072] cos(0) = S(Xi * Yi) / (V(SXi2) * V(X2))
[0073] A value of 1 indicates identical orientation, while o indicates orthogonality, and -1 indicates opposite orientation.
[0074] According to a fifth example, the Mean Squared Error (MSE) is used as similarity measure. In short, the MSE quantifies the average squared difference between corresponding elements of two sequences. It is defined as:
[0075] MSE = (i / n) * S(Xi - Y;)2
[0076] where n is the number of elements in the sequences. A lower MSE indicates greater similarity.
[0077] Further in this respect, the obtained side-channel representation reference sequence may not necessarily have the appearance of a side-channel measurement, and may thus be of an intermediary representation. This representation, often referred to as a latent representation, could be the middle ground in both a side-channel measurement to instruction model and an instruction to side-channel measurement model, such that both the measurements and the instructions will be processed to this intermediary representation. Furthermore, the comparisonin step S114 may then start by conversions into the latent representation. Hence, the comparison, as part of the evaluation in step S114, could start by converting the actual measurements to a common representation format. Thus, in some embodiments, the sidechannel representation reference sequence is compared to the side-channel measurements sequence in a common representation space by using the machine learning model 320 to convert the sequence of instructions to the common representation space and using the machine learning model 320 to convert the side-channel measurements sequence to the common representation space.
[0078] In some aspects, the obtained side-channel measurements sequence is stored, e.g., for further processing and / or for use as a training sequence for re-training the machine learning model. In particular, in some embodiments, the monitoring device 120, 220 is configured to perform (optional) step S116.
[0079] S116: The monitoring device 120, 220 stores the obtained side-channel measurements sequence.
[0080] Here, the storing in step S116 maybe performed either prior or after the evaluation in step S114.
[0081] In some aspects, the monitoring device 120, 220 performs an action performed responsive to the side-channel measurement representation sequence deviating more than a threshold difference from the side-channel representation reference sequence. That is, in some embodiments, the monitoring device 120, 220 is configured to perform (optional) step S118.
[0082] S118: The monitoring device 120, 220 performs an action that pertains to the obtained sidechannel measurement representation sequence (responsive to the side-channel measurement representation sequence deviating more than a threshold difference from the side-channel representation reference sequence).
[0083] In some embodiments, the action comprises at least one of: issuing an alarm event, fully or partially control the monitored device 110, 210. For example, the monitoring device 120, 220 may have partial control over the monitored device 110, 210. For example, the monitoring device 120, 220 may be operatively connected to the monitored device 110, 210 in way which enables the monitoring device 120, 220 to control reset functionality of the monitored device 110, 210, enabling the monitoring device 120, 220 to restart or shut down the monitored device 110, 210 if the measurements indicate that the monitored device 110, 210 is not executing the correct source code. Additionally, or alternatively, the monitoring device 120, 220 may further halt processes within the monitored device 110, 210, terminate processes within the monitored device 110, 210 or perform factory reset of the monitored device 110, 210 if the measurements indicate that the monitored device 110, 210 is not executing the correct source code. An alarmevent may be issued in case the monitoring device 120, 220 is not enabled to alter or interact with the monitored device 110, 210.
[0084] A first particular embodiment for side-channel monitoring of a monitored device 110, 210 based on at least some of the above disclosed embodiments will now be disclosed in detail with reference to the flowchart of Fig. 5.
[0085] A training phase involves steps S201-S202.
[0086] S201: The monitoring device 120, 220 obtains side-channel measurements sequences for a set of sequence of instructions (with one side-channel measurements sequence for each sequence of instructions) and attaches label sequences for each sequence of instructions. The set of sequence of instructions may comprise a single or plurality of sequences of instructions.
[0087] S202: The monitoring device 120, 220 trains the machine learning model 320 to provide sidechannel representation reference sequences as output using pairs {side-channel measurements sequence, sequence of instructions} as obtained in step S201. In some examples, the machine learning model 321 is jointly trained to provide side-channel measurement representation sequences as output using the same pairs.
[0088] An evaluation phase involves steps S203-S210.
[0089] S203: The monitoring device 120, 220 obtains a sequence of instructions to be executed by the monitored device 110, 210. As disclosed above, in some examples, the sequence of instructions is a binary file containing sequences of machine-level instructions. In other examples, the sequence of instructions is obtained as high-level source code that, by the monitoring device 120, 220, is compiled to a set of machine-level instructions.
[0090] S204 (optional): The monitoring device 120, 220 obtains metadata 340 for retraining of the machine learning model 320, and finetunes the machine learning model 320 by retraining the machine learning model 320, 321 with the metadata 340 or finetunes the output from the machine learning model 320 with the metadata 340.
[0091] S205: The monitoring device 120, 220 feeds the obtained sequence of instructions as input to a machine learning model 320. The machine learning model 320, upon being fed the sequence of instructions as input, produces a side-channel representation reference sequence as output.
[0092] S206: A sequence of instructions stored on the monitored device 110, 210 is executed by at least one processor on the monitored device 110, 210.S207: The monitoring device 120, 220 obtains a side-channel measurements sequence from the monitored device 110, 210. The monitoring device 120, 220 also feeds the obtained side-channel measurement as input to a machine learning model 321. The machine learning model 321, upon being fed the side-channel measurements as input, produces a side-channel representation sequence as output.
[0093] S208: The monitoring device 120, 220 evaluates whether the monitored device 110, 210 executes the sequence of instructions or not by comparing the side-channel representation reference sequence to the side-channel measurements sequence.
[0094] 5209 (optional): The monitoring device 120, 220 either stores the obtained side-channel measurements sequence and / or communicates the obtained side-channel measurements sequence to a server 230.
[0095] 5210 (optional): The monitoring device 120, 220 performs an action that pertains to the obtained side-channel measurements sequence (responsive to the side-channel measurements sequence deviating more than a threshold difference from the side-channel representation reference sequence).
[0096] The evaluation phase can then be repeated for another monitored device 110, 210, for another sequence of instructions to be executed by the monitored device 110, 210, and / or for the same monitored device 110, 210 and the same sequence of instructions after some time delay to ensure that the monitored device 110, 210 has not been affected by malware.
[0097] Further aspects of generating side-channel emission patterns based on source code or machinelevel instructions will be disclosed next. In general terms, for ease of description, but without loss of generality, the generation is split into a number of operations, pertaining to data collection, data preprocessing, model design, training phase, and evaluation phase. Further aspects of each operation will be disclosed next.
[0098] The data collection operation involves obtaining a dataset of instruction-emission pairs, {sidechannel measurements sequence, sequence of instructions}. Source code is first compiled into machine-level instructions using a compiler configured for the instruction set architecture of the monitored device. The compiled instructions are executed on the monitored device whilst sidechannel information is obtained. Side-channel information may pertain to power consumption traces, electromagnetic radiation patterns, or other physical signals generated during code execution. Measurement equipment, such as oscilloscopes or electromagnetic probes, can be used to capture this information. Each measurement is labeled with the corresponding sequenceof machine-level instructions. The dataset thus consists of labeled instruction-emission pairs, providing the basis for training the machine learning model 320.
[0099] Data preprocessing operations prepare the collected dataset for use in model training. For example, side-channel measurements sequences could be normalized to ensure consistency in time duration and amplitude across measurements. Time-series alignment techniques can be applied to correlate side-channel measurements sequence with specific instruction sequences. Instruction sequences can be encoded into numerical representations suitable for input into the machine learning model 320. This encoding may involve creating embeddings for operation codes and operands. Data augmentation techniques are applied to enhance the dataset. These techniques include adding simulated noise, introducing clock jitter, or varying device parameters to improve model robustness. The processed dataset can thereby be standardized and diversified for effective model training.
[0100] The model design operation defines the architecture of the machine learning model 320 used to generate side-channel representation patterns. The input to the machine learning model 320 comprises encoded instruction sequences and, optionally, device-specific parameters such as clock frequency or memory latency. Similarly, the input to the learning model 321 comprises side-channel measurements and optionally device-specific parameters such as clock frequence or memory latency. The model architecture is configured to capture temporal dependencies within instruction sequences and their corresponding emissions. This maybe achieved using recurrent neural networks (RNNs) with gated recurrent units (GRUs) or long short-term memory (LSTM) cells. Alternatively, attention-based models such as transformers may be employed to learn relationships within complex instruction sequences. Convolutional neural networks (CNNs) may be used for feature extraction from time-series emission data. The output of the model is a side-channel emission representation in form of a time-series.
[0101] The training phase involves optimizing the machine learning model 320 using the processed dataset, as in step S102 (and steps S201-S202). The machine learning model 320 can be trained in a supervised manner, with instruction sequences as inputs and corresponding emission patterns as target outputs. A loss function, such as mean squared error (MSE), quantifies the difference between predicted and actual emissions. The model parameters are updated iteratively to minimize this loss. Regularization techniques are applied to prevent overfitting, ensuring the model generalizes well to unseen data. Early stopping criteria may be used to halt training when performance on a validation set ceases to improve. The result is a trained model capable of accurately predicting side-channel emissions from new instruction sequences. In Fig.
[0102] 6 is provided an example of three sequences of instructions 600a (denoted “Sequence 1”, “Sequence 2”, “Sequence 3”) and corresponding trained side-channel emission patterns 600b(denoted “Pattern 1”, “Pattern 2”, “Pattern 3”) as generated by the machine learning model 320 using the sequences of instructions as input. As can be seen, each sequence of instructions yields a unique side-channel emission pattern. Sequence 1 represents a 16-bit decrement operation. Sequence 2 represents a bitwise operation involving logic AND and logic XOR operations on a 16-bit value stored in memory. Sequence 3 represents a bitwise logic OR operations between two 16-bit values stored in memory.
[0103] The evaluation phase involves application of the trained model to generate side-channel emission patterns for new sequences of instructions, as in above steps S104-S118 (and steps S203-S210). The sequence of instructions is encoded and provided as input to the trained machine learning model 320. The machine learning model 320 outputs predicted side-channel representation patterns corresponding to the sequence of instructions. A post-processing step may be applied to simulate real -wo rid conditions, such as environmental noise or device variability.
[0104] Fig. 7 schematically illustrates, in terms of a number of structural units, the components of a monitoring device 700 according to an embodiment. Processing circuitry 710 is provided using any combination of one or more of a suitable central processing unit (CPU), multiprocessor, microcontroller, digital signal processor (DSP), etc., capable of executing software instructions stored in a computer program product 810 (as in Fig. 8), e.g. in the form of a storage medium 730. The processing circuitry 710 may further be provided as at least one ASIC or FPG.
[0105] Particularly, the processing circuitry 710 is configured to cause the monitoring device 700 to perform a set of operations, or steps, as disclosed above. For example, the storage medium 730 may store the set of operations, and the processing circuitry 710 may be configured to retrieve the set of operations from the storage medium 730 to cause the monitoring device 700 to perform the set of operations. The set of operations may be provided as a set of executable instructions.
[0106] Thus the processing circuitry 710 is thereby arranged to execute methods as herein disclosed. The storage medium 730 may also comprise persistent storage, which, for example, can be any single one or combination of magnetic memory, optical memory, solid state memory or even remotely mounted memory. The monitoring device 700 may further comprise a communications (comm.) interface 720 at least configured for communications with other entities, functions, nodes, and devices, such as the server 230, measurement devices, and even the monitored device, etc. As such the communications interface 720 may comprise one or more transmitters and receivers, comprising analogue and digital components. The processing circuitry 710 controls the general operation of the monitoring device 700 e.g. by sending dataand control signals to the communications interface 720 and the storage medium 730, by receiving data and reports from the communications interface 720, and by retrieving data and instructions from the storage medium 730. Other components, as well as the related functionality, of the monitoring device 700 are omitted in order not to obscure the concepts presented herein.
[0107] The monitoring device 700 maybe provided as a standalone device or as a part of at least one further device. For example, in some examples, functionalities of the monitoring device 700 has a distributed implementation where some tasks (such as data processing, analysis, or management of monitoring operations) of the monitoring device 700 are delegated to, or performed jointly with, the server 230. In this respect, a first portion of the instructions performed by the monitoring device 700 may be executed in a first device, and a second portion of the of the instructions performed by the monitoring device 700 may be executed in a second device; the herein disclosed embodiments are not limited to any particular number of devices on which the instructions performed by the monitoring device 700 maybe executed. Hence, the methods according to the herein disclosed embodiments are suitable to be performed by a monitoring device 700 residing in a cloud computational environment. Therefore, although a single processing circuitry 710 is illustrated in Fig. 7 the processing circuitry 710 may be distributed among a plurality of devices, or nodes. The same applies to the computer program 820 of Fig. 8.
[0108] Fig. 8 shows one example of a computer program product 810 comprising computer readable storage medium 830. On this computer readable storage medium 830, a computer program 820 can be stored, which computer program 820 can cause the processing circuitry 710 and thereto operatively coupled entities and devices, such as the communications interface 720 and the storage medium 730, to execute methods according to embodiments described herein. The computer program 820 and / or computer program product 810 may thus provide means for performing any steps as herein disclosed.
[0109] In the example of Fig. 8, the computer program product 810 is illustrated as an optical disc, such as a CD (compact disc) or a DVD (digital versatile disc) or a Blu-Ray disc. The computer program product 810 could also be embodied as a memory, such as a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), or an electrically erasable programmable read-only memory (EEPROM) and more particularly as a non-volatile storage medium of a device in an external memory such as a USB (Universal Serial Bus) memory or a Flash memory, such as a compact Flash memory. Thus, while the computer program 820 is here schematically shown as a track on the depicted optical disk, thecomputer program 820 can be stored in any way which is suitable for the computer program product 810.
[0110] The inventive concept has mainly been described above with reference to a few embodiments. However, as is readily appreciated by a person skilled in the art, other embodiments than the ones disclosed above are equally possible within the scope of the inventive concept, as defined by the appended patent claims.
Claims
CLAIMS1. A method for side-channel monitoring of a monitored device (110, 210), the method being performed by a monitoring device (120, 220, 700), the method comprising:obtaining (S104) a sequence of instructions to be executed by the monitored device (110, 210);obtaining (S110) a side-channel representation reference sequence for the sequence of instructions from a machine learning model (320), wherein the machine learning model (320) upon being fed the sequence of instructions as input produces the side-channel representation reference sequence as output;obtaining (S112) a side-channel measurements sequence from the monitored device (110, 210); andevaluating (S114) whether the monitored device (110, 210) executes the sequence of instructions or not by comparing the side-channel representation reference sequence to the side-channel measurements sequence.
2. The method according to claim 1, wherein the machine learning model (320) has been trained on pairs of training sequences of instructions (310) and corresponding training sidechannel measurements sequences to implement a code to side-channel representation model (300).
3. The method according to any preceding claim, wherein the method, prior to obtaining the side-channel representation reference sequence for the sequence of instructions, further comprises:obtaining (S106) metadata (340) for retraining of the machine learning model (320); andfinetuning (S108) the machine learning model (320) by retraining the machine learning model (320) with the metadata (340).
4. The method according to claim 3, wherein the metadata (340) pertains either to the monitored device (110, 210) or to properties of a physical environment (150) in which the monitored device (110, 210) is located.
5. The method according to claim 3 or 4, wherein the metadata (340) comprises at least one of: device model type of the monitored device (110, 210), processor information of the monitored device (110, 210), expected clock frequency of the monitored device (110, 210),expected signal strength of the side-channels, noise level of the physical environment (150), physical relation between the monitored device (110, 210) and a measurement device used for obtaining the sequence of measurements (140), type of measurement device used for obtaining the sequence of measurements (140).
6. The method according to any preceding claim, wherein the method, prior to obtaining the side-channel representation reference sequence, further comprises:training (S102) the machine learning model (320) to provide side-channel representation reference sequences as output, wherein the machine learning model (320) is trained by feeding to it pairs of training sequences of instructions (310) and corresponding side-channel measurements sequences (330) as input.
7. The method according to claim 6, wherein the side-channel training sequences (330) are obtained from executing the training sequences of instructions (310) on the monitored device (110, 210) in a controlled environment.
8. The method according to claim 6, wherein training (S102) the machine learning model (320) also comprises jointly training a reverse machine learning model (321) that produces a common latent sequence representation from a side-channel measurement trace.
8. The method according to any preceding claim, wherein the sequence of instructions is a binary file containing sequences of machine-level instructions.
9. The method according to any of claims 1 to 7, wherein the sequence of instructions is obtained as high-level source code that, by the monitoring device (120, 220, 700), is compiled to a set of machine-level instructions.
10. The method according to claim 9, wherein the monitoring device (120, 220, 700) has access to information about compiler settings used by the monitored device (110, 210), and wherein the high-level source code is compiled to set of machine-level instructions using same compiler settings as used by the monitored device (110, 210)11. The method according to any preceding claim, wherein the side-channel representation reference sequence is compared to the side-channel measurements sequence in a common representation space by using the machine learning model (320) to convert the sequence of instructions to the common representation space and using the machine learning model (320) to convert the side-channel measurements sequence to the common representation space.
12. The method according to any preceding claim, wherein the side-channel measurements sequence is obtained from a measurement device, wherein the measurement device comprises at least one sensor, such as an electromagnetic probe, temperature sensor, acoustic sensor, or a power meter over a shunt resistor placed in a power supply of the monitored device (110, 210).
13. The method according to any preceding claim, wherein the method further comprises:storing (S116) the obtained side-channel measurements sequence.
14. The method according to any preceding claim, wherein the method further comprises:performing (S118) an action that pertains to the obtained side-channel representation measurement sequence, responsive to the side-channel measurements sequence deviating more than a threshold difference from the side-channel representation reference sequence.
15. The method according to claim 14, wherein the action comprises at least one of: issuing an alarm event, fully or partially control the monitored device (110, 210).
16. The method according to claim 2, wherein the machine learning model (320) upon being fed the sequence of instructions as input produces multiple candidate side-channel representation reference sequences as output, and wherein the side-channel measurements sequence is compared to more than one of the candidate side-channel representation reference sequences when evaluating whether the monitored device (110, 210) executes the sequence of instructions or not.
17. A monitoring device (120, 220, 700) for side-channel monitoring of a monitored device (110, 210), the monitoring device (120, 220, 700) comprising processing circuitry (710), the processing circuitry being configured to cause the monitoring device (120, 220, 700) to:obtain a sequence of instructions to be executed by the monitored device (110, 210);obtain a side-channel representation reference sequence for the sequence of instructions from a machine learning model (320), wherein the machine learning model (320) upon being fed the sequence of instructions as input produces the side-channel representation reference sequence as output;obtain a side-channel measurements sequence from the monitored device (110, 210); andevaluate whether the monitored device (110, 210) executes the sequence of instructions or not by comparing the side-channel representation reference sequence to the side-channel measurements sequence.
18. The monitoring device (120, 220, 700) according to claim 17, further being configured to perform the method according to any of claims 2 to 16.
19. A computer program (820) for side-channel monitoring of a monitored device (110, 210), the computer program comprising computer code which, when run on processing circuitry (710) of a monitoring device (120, 220, 700), causes the monitoring device (120, 220, 700) to:obtain (S104) a sequence of instructions to be executed by the monitored device (110, 210);obtain (S110) a side-channel representation reference sequence for the sequence of instructions from a machine learning model (320), wherein the machine learning model (320) upon being fed the sequence of instructions as input produces the side-channel representation reference sequence as output;obtain (S112) a side-channel measurements sequence from the monitored device (110, 210); andevaluate (S114) whether the monitored device (110, 210) executes the sequence of instructions or not by comparing the side-channel representation reference sequence to the side-channel measurements sequence.
20. A computer program product (810) comprising a computer program (820) according to claim 19, and a computer readable storage medium (830) on which the computer program is stored.