Generating a key for use as a shared secret

A communications device for generating a key for use as a shared secret in communications with another communications device is provided. Each of the communications devices comprises a sensor array for measuring a spatially-varying magnetic field originating from a first spatially-varying density of metallic particles comprised in a first battery, when subjected to an excitation magnetic field, and processing means operative to acquire a set of values from the sensor array, which set of values represents the spatially-varying magnetic field, and to derive the key from the set of values. The excitation magnetic field is generated by a magnetic-field generator comprised in one of the communications devices. Thereby, the two communications devices may, when in proximity, generate identical keys by probing the spatially-varying density of metallic particles comprised in the first battery.

TECHNICAL FIELD

The invention relates to a communications device for generating a key for use as a shared secret in communications with another communications device, a corresponding method, a corresponding computer program, and a corresponding computer program product.

BACKGROUND

Many applications of communications devices require secure communications to exchange data with one or more other communications devices or a communications network. In the present context, a communications device is an electronic device capable of effecting communications using a wired or wireless technology in combination with one or more suitable communication protocols.

A first example is to exchange a document, a message, an email, or an image, between a first mobile terminal, such as a mobile phone, a smartphone, a User Equipment (UE), a tablet, or a laptop, and a second mobile terminal. A second example is Machine-to-Machine (M2M) communications between a mobile terminal and a sensor or actuator. A third example is the communication between a mobile terminal and a payment terminal for effecting a financial transaction at a point-of-sale.

Encryption may be used to provide a certain level of security for data and messages transmitted between two or more communications devices, or a communications device and a communications network. Several encryption schemes, in particular symmetric schemes, are based on the availability of a shared secret, i.e., information such as a bit string or a string of symbols which is shared between, and only available to, the communications devices which are engaged in a communications sessions. Such a shared secret may be generated in software or hardware at one communications device, or at a separate network entity, and distributed to the other communications devices. The process of sharing the secret is not straightforward and is vulnerable to attacks. For instance, the shared secret may be revealed as a result of eavesdropping, man-in-the-middle attacks, or the like.

SUMMARY

It is an object of the invention to provide an improved alternative to the above techniques and prior art.

More specifically, it is an object of the invention to provide an improved solution for generating a key for use as a shared secret in communications between two or more communications devices, or between a communications device and a communications network.

These and other objects of the invention are achieved by means of different aspects of the invention, as defined by the independent claims. Embodiments of the invention are characterized by the dependent claims.

According to a first aspect of the invention, a communications device for generating a key is provided. The communications device may, e.g., be a handheld device such as a mobile terminal, a UE, a smartphone, a tablet, a laptop, a wearable device such as a smartwatch, a sensor, an actuator, or a device like a cash register or a payment terminal for effecting financial transactions at a point-of-sale. The key may be used as a shared secret in communications with another communications device. The communications device comprises a communications interface for effecting communications with the other communications device, a sensor array for measuring a spatially-varying magnetic field originating from a first spatially-varying density of metallic particles comprised in a first battery, when subjected to an excitation magnetic field, and processing means. The sensor array may, e.g., comprise sensors based on any one, or a combination, of inductors, magneto-resistive sensors, Hall-effect sensors, spin transistors, fluxgates, magneto-electrical sensors, and magneto-optical sensors. The processing means is operative to acquire a set of values from the sensor array and derive the key from the set of values. The set of values represents the spatially-varying magnetic field.

According to a second aspect of the invention, a method of a communications device of generating a key is provided. The key may be used as a shared secret in communications with another communications device. The method comprises measuring a spatially-varying magnetic field originating from a first spatially-varying density of metallic particles comprised in a first battery, when subjected to an excitation magnetic field, acquiring a set of values from the sensor array, and deriving the key from the set of values. The spatially-varying magnetic field is measured using a sensor array. The set of values represents the spatially-varying magnetic field.

According to a third aspect of the invention, a computer program is provided. The computer program comprises computer-executable instructions for causing a device to perform the method according to an embodiment of the second aspect of the invention, when the computer-executable instructions are executed on a processing unit comprised in the device.

According to a fourth aspect of the invention, a computer program product is provided. The computer program product comprises a computer-readable storage medium which has the computer program according to the third aspect of the invention embodied therein.

The invention makes use of an understanding that a key for use as a shared secret in communications between at least two communications devices may be established by utilizing a physical process which is characterized by a natural randomness. Thereby, true random numbers may be generated. Embodiments of the invention are advantageous in that each one of two or more communications devices may generate a copy of the key, thereby establishing a shared secret without necessitating the complex and vulnerable process of sharing a key generated by one communications device with other communications devices.

The invention is based on the concept of a Physical Unclonable Function (PUF), which may be described as a function with a set of input values leading to a set of output values which are defined by a physical process. The input space may be rather large, and it is considered impossible to fully characterize the function transforming the input values into the output values. A PUF may be realized by probing a physical system and measuring a set of physical quantities as a response.

Embodiments of the invention utilize metallic particles which arise as a consequence of chemical processes in at least one battery, the first battery, as PUF. The battery or batteries may, e.g., be of type lithium-ion or lithium-polymer, and the metallic particles may be lithium dendrites which are known to grow over the course of several battery charge/discharge cycles on the surface of the lithium electrode and spread across the battery's electrolyte until they reach the other electrode [K. J. Harry, D. T. Hallinan, D. Y. Parkinson, A. A. MacDowell, and N. P. Balsara, “Detection of subsurface structures underneath dendrites formed on cycled lithium metal electrodes”, in Nature Materials, vol. 13, pages 69-73, 2014]. Since the local density, composition, or concentration, of metallic particles, i.e., their spatial distribution in the battery, is the result of a stochastic process, keys which are derived by probing different batteries are different from each other with very high likelihood. Thereby, a shared secret may be established which is unique for the battery, or the combination of batteries, used for generating the key.

To this end, each of the communications devices measures the spatially varying density of metallic particles in the same battery by utilizing an array of magnetic-field sensors which allows measuring the spatially-varying magnetic field originating from the metallic particles, with a spatial resolution determined by the number of sensors in the array. The values which are used for deriving the key represent spatial variations of the measured magnetic field.

The spatially-varying magnetic field originating from the first battery arises in response to an excitation magnetic field which the first battery, and thereby the metallic particles contained therein, is subjected to. The excitation magnetic field penetrates the battery such that eddy currents are excited in the metallic particles. This excitation field may, e.g., be generated by one of the communications devices, subsequent to which each of the communications devices measures the spatially-varying magnetic field independently of the other communications device. As an alternative, each of the communications devices may generate the excitation magnetic field for exciting eddy currents in the metallic particles and subsequently measures the resulting spatially-varying magnetic field, one device at a time.

Since the spatial distribution of metallic particles in a battery changes over time, an identical copy of the key can only be re-generated during a certain time interval after a first communications device has generated the key. Thereby, the possibility to generate identical copies of the key at a later stage is limited. The time interval is determined by the rate of growth of the metallic particles, which is determined by the rate of charge/discharge cycles the battery is subjected to, and the algorithm used for deriving the key from the values representing the measured spatially-varying magnetic field. Advantageously, this is an assurance that a shared secret generated by two communications devices can only be re-generated during a limited time interval. This makes it more difficult for a malicious device to generate an identical copy of the key at a later point in time.

Moreover, since the at least two communications devices which establish a shared secret in accordance with embodiments of the invention need to be in proximity of the same battery during a limited time interval, from which battery each one of the communications devices derives a copy of the same key, an assurance can be made that the at least two communications devices have been in proximity when the shared secret was established. Thereby, the risk of a malicious device generating a copy of the shared secret is mitigated.

The set of values acquired from the sensor array are converted into a key or security token, e.g., a binary bit string or a string of symbols other than bits, and may be used in algorithms for security applications, in particular encryption, decryption, signing, hashing, and the like. The actual conversion from the measured physical quantity, which can often be represented by a set of real or complex numbers, to a bit string or string of symbols may be performed by a bit/symbol extraction algorithm. In the field of PUFs there are several well-known algorithms which are described further below.

It will be appreciated that the algorithm which is used for converting the measured values into the key is preferably substantially insensitive to small variations in the values used as input to the algorithm, and should allow generating the same key, with rather high likelihood, in both communications devices when in proximity of the first battery. For instance, the key may be derived from the set of values by means of base conversion. Optionally, in order to increase resilience against measurement noise and the like, only the most significant bits may be used. Alternatively, if each value of the set of values represents the spatially-varying magnetic field as measured by a respective sensor of the sensor array, the key may be derived from the set of values based on one or more indices of sensors which have measured one or more selected values of the set values. As an example, one more statistical values, such as a minimum, a maximum, an average, or a median, of the set of values may be identified, and the respective indices of the sensors which have measured these values may be utilized in deriving the key. As a further example, all values may be ordered, in ascending order, descending order, or any other order, and the corresponding sensor indices may be used for deriving the key. Preferably, the indices are assigned to the sensors in accordance with an order of the sensors within the sensor array.

According to an embodiment of the invention, the first battery is comprised in the communications device. That is, the communications device derives the key from its internal battery. Correspondingly, another communications device with which the communications device seeks to establish a shared secret may derive a copy of the key by measuring the spatially-varying magnetic field originating from the first battery, using its own sensor array.

According to an embodiment of the invention, the measured magnetic field originates from the first spatially-varying density of metallic particles comprised in the first battery and a second spatially-varying density of metallic particles comprised in a second battery when subjected to the excitation magnetic field. The second battery is comprised in the other communications device. Similar to the first battery, the second battery may be of type lithium-ion or lithium-polymer, the metallic particles may be lithium dendrites, and the second spatially-varying density of metallic particles may vary over time. This embodiment of the invention is advantageous in that the shared secret is unique for the combination of two batteries, or the two communications devices comprising these batteries. Thereby, the risk of generating a copy of the key by a malicious device is further mitigated.

According to an embodiment of the invention, the communications device further comprises a magnetic-field generator for generating the excitation magnetic field. The magnetic-field generator may, e.g., be a coil and a power supply arranged for driving a current through the coil. Advantageously, an inductor coil provided for the purpose of wireless charging may be utilized. To this end, the communications device generates the excitation magnetic field for exciting eddy currents in the metallic particles comprised in the first and, optionally, the second battery. Optionally, the excitation magnetic field may be generated in response to detecting that the other communications device is in proximity of the communications device. Alternatively, the excitation magnetic field may be generated in response to receiving an instruction from a user of the communications device. For instance, the user may press a button, start an app, shake the device, or perform a gesture, to initiate establishing a shared secret. As yet a further alternative, the excitation magnetic field may be generated in response to receiving a request from the other communications device. For instance, the other communications device may request establishing a secure communication session. This is particularly advantageous if the other communications device does not comprise a magnetic-field generator, or if each of the communications devices conducts an autonomous process for establishing a shared secret.

According to another embodiment of the invention, the excitation magnetic field may be generated by the other communications device. Optionally, the set of values may be acquired from the sensor array in response to detecting the excitation magnetic field generated by the other communications device. The sensor array may, e.g., measure the spatially-varying magnetic field either in response to receiving a request for the set of values or in response to detecting the excitation magnetic field. Alternatively, the spatially-varying magnetic field may be measured continuously or periodically.

In the case of two communications devices which are brought into proximity for the purpose of establishing a shared secret in accordance with embodiments of the invention, at least one of the communications devices comprises a magnetic-field generator for exciting eddy currents in the first battery and, optionally, the second battery, subsequent to which the spatially-varying magnetic field may be measured by both of the communications devices. As an alternative, each of the communications devices may, in a process separate from the other communications device, generate the excitation magnetic field and subsequently measure the spatially-varying magnetic field.

Even though advantages of the invention have in some cases been described with reference to embodiments of the first aspect of the invention, corresponding reasoning applies to embodiments of other aspects of the invention. Moreover, embodiments of the invention may be utilized for establishing a key for use as a secret shared by more than two communications devices which are in proximity of the same battery during measuring the spatially-varying magnetic field.

Further objectives of, features of, and advantages with, the invention will become apparent when studying the following detailed disclosure, the drawings and the appended claims. Those skilled in the art realize that different features of the invention can be combined to create embodiments other than those described in the following.

DETAILED DESCRIPTION

Cryptography is frequently used to secure communications between devices. One class of cryptography methods are asymmetric encryption methods, which are based on an underlying mathematical problem which is considered to be hard to solve with the levels of computational power currently available, such as factorization of large integers or discrete logarithm. Practical schemes based on public and private keys are in widespread use today, but suffer from the disadvantage that the required computational power may not be available, e.g., in constrained devices with limited battery capacity or processing power, such as M2M devices.

Another class of encryption methods is based on symmetric encryption. An example is the one-time pad method, in which a preferably random bit string is used as a secret shared between two devices which wish to exchange a message securely. The first device may perform an exclusive OR of the message and the random bit string to form an encoded message. The encoded message is the transmitted to the second device where it is decoded by performing an exclusive OR of the received message with the random bit string. The one-time pad method offers a stronger notion of security than asymmetric methods, such as public-private key cryptography. Furthermore, the computational requirements are comparatively low, so the method is suitable for implementation in constrained devices. A major disadvantage of the method is the need to distribute the random bit string to be used as shared secret among all devices engaged in a communications session, without revealing it to malicious devices.

In the following, embodiments of the communications device for generating a key for use as a shared secret in communications with another communications device are described.

InFIG. 1, two communications devices110and120which are brought into proximity are illustrated in top-view (top part) and side-view (bottom part), in accordance with embodiments of the invention. Each one of communications devices110and120is an embodiment of communications device200illustrated inFIG. 2, which is described in further detail below, and may, e.g., be a mobile terminal, a UE, a smartphone, a wearable device, a tablet, a smartwatch, a cash register or a payment terminal at a point-of-sale, an M2M device such as a sensor or an actuator, or a laptop. One of communications devices110and120may, e.g., be comprised in a vehicle, such as a car, truck, bus, boat, train, airplane, or drone, or in a household appliance, e.g., white goods, door locks, surveillance and alarm equipment, or autonomous vacuum cleaners and grass cutters.

Embodiments of the invention utilize the spatially-varying density of metallic particles in a first battery, and optionally a second battery, for generating a key which may be used as a shared secret in secure communications between two communications devices, such as communications devices110and120. The first battery and the second battery may, e.g., be lithium-polymer or lithium-ion batteries which are known to develop lithium dendrites over time. In particular, the first battery and optionally the second battery are preferably comprised in communications devices110and120, respectively. In other words, the first battery and the second battery correspond to batteries113and123illustrated inFIG. 1, or vice versa.

The first spatially-varying density of metallic particles comprised in the first battery, and optionally the second spatially-varying density of metallic particles comprised in the second battery, can be probed by exciting eddy currents in the metallic particles using an excitation magnetic field, e.g., a magnetic-field pulse or an alternating-current (ac) magnetic field, which is preferably generated by a magnetic-field generator114/124comprised in at least one of communications devices110and120. The eddy currents give rise to a magnetic field which is spatially varying, owing to the spatially-varying density of metallic particles in the first and the second battery, respectively. By measuring the spatially-varying magnetic field, a set of values can be derived which represent the spatially-varying density of magnetic particles in the first battery, or a combination of the first spatially-varying density of magnetic particles and the second spatially-varying density of magnetic particles. If the metallic particles are the result of a stochastic process, as is the case for lithium dendrites, their respective spatially-varying density, or spatial distribution, in each battery is unique. Accordingly, the measured values are a response from a PUF, from which a random key or a secret token can be derived for use as a shared secret.

The underlying concept of metal detection technology based on magnetic fields dates back to the 1930's, but has advanced with the advent of digital signal processing. Metal detectors typically comprise two coils or inductors, where the first inductor is fed with a current such that a magnetic field, the excitation magnetic field, is generated. The generated magnetic field induces eddy currents in any metallic particle which is subjected to the excitation magnetic field. The eddy currents in turn generate a magnetic field which may be picked up by the second inductor and measured. The resulting signal has a characteristic structure which may be used to detect and differentiate different metal particles.

One may distinguish two basic operating modes for metal detectors. The first operating mode is the pulse induction detection mode. In this mode the excitation magnetic field strength has a pulse shape (possibly periodic) of finite duration. The measured magnetic field strength follows the excitation magnetic field strength closely until the end of the pulse. At that point the measured magnetic field strength shows a characteristic decay. The shape of the decay and decay time depend on the amount and type of metal particles present. The second operating mode is a continuous wave detection mode where a periodically varying excitation magnetic field is used. In this mode, the difference in amplitude and phase between the excitation magnetic field and the measured magnetic field reflects the amount and type of metallic particles present.

As is illustrated inFIG. 1, communications devices110and120are brought into proximity of each other for the purpose of generating a key for use as a shared secret in communications between them, in accordance with embodiments of the invention. In order to be able to measure the spatially-varying magnetic field which originates from metallic particles in one or both of batteries113and123, communications devices110and120need to be arranged relative to each other so that the sensor array111/121comprised in one of the communications devices is able to measure the spatially-varying magnetic field originating from battery123/113comprised in the other communications device with sufficient accuracy. Moreover, if first communications device110additionally comprises a magnetic-field generator114for generating the excitation magnetic field, the relative arrangement of communications devices110and120should be such that the generated excitation field penetrates battery123comprised in the second communications device so as to excite eddy currents which give rise to a magnetic field of measurable strength. InFIG. 1, this is illustrated by means of a region130, which may be indicated on a face of communications devices110and120, or displayed on a display or touchscreen of devices110and120(not illustrated inFIG. 2), for guiding users in aligning communications devices110and120so as to facilitate generating a key in accordance with embodiments of the invention. In practice, region130indicates where sensor array111/121, and optionally battery113/123and/or magnetic-field generator114/124are arranged in communications device110or120, respectively. It will be appreciated that sensor array111/121, and optionally battery113/123and/or magnetic-field generator114/124, are preferably provided at, or in proximity of, an outer surface of communications device110/120. If an embodiment of communications device110/120is comprised in a vehicle, such as a car, sensor array111/121and optionally magnetic-field generator114/124may, e.g., be provided on the dashboard. Alternatively, if an embodiment of communications device110/120is comprised in a household appliance, such as white goods, sensor array111/121, and optionally battery113/123and/or magnetic-field generator114/124, may, e.g., be provided on a control panel of the white goods.

In order to further elucidate the invention, communications devices110and120brought into proximity are again shown inFIGS. 3 and 4, in which the process of generating a key based on probing the spatial distribution of metallic particles in the first battery, and optionally the second battery, is illustrated (side-view only).

InFIG. 3, first communications device110is illustrated as comprising sensor array111, first battery113, and magnetic-field generator114, and second communications device120is illustrated as comprising sensor array121. First communications device110may, e.g., be a smartphone, and second communications device120a payment terminal at a point-of-sale. Typically, a payment terminal may not comprise a battery but is powered by an electrical power supply. This is also the case if communications device120is embodied in a vehicle or a household appliance. Accordingly, smartphone110and payment terminal120may each generate the key by probing the first spatially-varying density of metallic particles comprised in first battery113. To this end, during an excitation phase, illustrated in the upper part ofFIG. 3, magnetic-field generator114generates an excitation magnetic field310which penetrates first battery113. Excitation magnetic field310may, e.g., be a magnetic-field pulse or an ac magnetic field. In response to excitation magnetic field310, eddy currents are excited in the metallic particles comprised in first battery113, which in turn give rise to a spatially-varying magnetic field320, illustrated in the lower part ofFIG. 3, which is representative of the spatially-varying density of metallic particles in first battery113. Spatially-varying magnetic field320may be measured by sensor array111comprised in first communications device110and, substantially simultaneously, by sensor array121comprised in second communications device120. Alternatively, one of sensor arrays111and121may measure spatially-varying magnetic field320subsequent to a first excitation magnetic field310, and the other sensor array may measure spatially-varying magnetic field320subsequent to a second excitation magnetic field310.

FIG. 4is similar toFIG. 3, with the exception that also second communications device120is illustrated as comprising a battery, second battery123. The configuration illustrated inFIG. 4applies, e.g., if communications devices110and120both are smartphones. Accordingly, first110and second smartphone120may each generate the key by probing the first spatially-varying density of metallic particles comprised in first battery113in combination with the second spatially-varying density of metallic particles comprised in second battery123. This is the case since sensor arrays111and121cannot separate the contributions from batteries113and123but can only measure the total magnetic field. To this end, during an excitation phase, illustrated in the upper part ofFIG. 4, magnetic-field generator114generates an excitation magnetic field410which penetrates first battery113and second battery123. Excitation magnetic field410may, e.g., be a magnetic-field pulse or an ac magnetic field. In response to excitation magnetic field410, eddy currents are excited in metallic particles comprised in first battery113and second battery123, which in turn give rise to spatially-varying magnetic fields420and430, respectively, illustrated in the lower part ofFIG. 4. Spatially-varying magnetic fields420and430are representative of the first spatially-varying density of metallic particles in first battery113and the second spatially-varying density of metallic particles in second battery123, respectively. The combination of spatially-varying magnetic fields420and430may be measured by sensor array111comprised in first communications device110and, substantially simultaneously, by sensor array121comprised in second communications device120. Alternatively, one of sensor arrays111and121may measure spatially-varying magnetic fields420and430subsequent to a first excitation magnetic field410, and the other sensor array may measure spatially-varying magnetic fields420and430subsequent to a second excitation magnetic field410.

Subsequent to measuring the spatially-varying magnetic field originating from first battery113, and optionally second battery123, each one of communications devices110and120derives the key from the set of values acquired from its sensor array111/121. It will be appreciated that the magnetic fields measured by sensor arrays111and121are not identical, owing to the different relative arrangement of the source of the excitation magnetic field, such as magnetic-field generator114with respect to first battery113and second battery123, as well as the different relative arrangement of sensor arrays111and121with respect to first battery113and second battery123. However, due to the flat form factor of the type of batteries which are typically provided with modern communications devices, in particular smartphones, tablets, and laptops, and the ability to design the magnetic-field generator such that excitation magnetic field310/410is substantially homogenous in the near-field range, the difference in strength of the excitation magnetic field experienced by metallic particles in first battery113as compared to metallic particles in second battery123is negligible. Likewise, by proper arrangement of sensor arrays111/121relative to internal battery113/123as compared to an external battery123/113, the difference between measurements performed by sensor array111and sensor array121are sufficiently small.

Further with reference toFIGS. 3 and 4, a magnetic-field generator124comprised in second communications device120may be used instead of, or in addition to, magnetic-field generator114comprised in first communications device110. For instance, rather than utilizing an excitation magnetic field generated by first communications device110, embodiments of the inventions may utilize an excitation magnetic field generated by second communications device120. In particular, if sensor arrays111and121do not measure spatially-varying magnetic field(s)320, or420and430, simultaneously, each one of communications devices110and120may generate the key in a separate process. More specifically, first communications device110may generate excitation magnetic field310or410using magnetic-field generator114and measure the resulting spatially-varying magnetic field(s)320, or420and430, based on which it derives the key. Subsequently, second communications device120may generate an excitation magnetic field using its magnetic-field generator124(not shown inFIGS. 3 and 4) and measure the resulting spatially-varying magnetic field, based on which it derives the key.

With reference toFIG. 2, embodiments200of the communications device for generating a key for use as a shared secret in communications with another communications device, such as communications devices110and120, are now described in more detail.

Communications device200comprises a communications interface205for effecting communications with another communications device, a sensor array201for measuring a spatially-varying magnetic field originating from a first battery, and processing means206.

Communications interface205may, e.g., be a network interface, such as an Ethernet card, a serial or parallel port such as Universal Serial Bus (USB), FireWire, Lightning, or a radio interface supporting communications over a cellular mobile network, such as Global System for Mobile Communications (GSM), Universal Mobile Telecommunications System (UMTS), or Long Term Evolution (LTE), a Wireless Local Area Network (WLA)/WiFi, Bluetooth, a Near-Field Communication (NFC) technology, ZigBee, or the like.

Sensor array201comprises a plurality of sensors202which are based on any one, or a combination, of inductors, magneto-resistive sensors, Hall-effect sensors, spin transistors, fluxgates, magneto-electrical sensors, and magneto-optical sensors. Due to the spatial arrangement of sensors202in sensor array201the spatially-varying magnetic field can be measured with a spatial resolution which is determined by the number of sensors202in array201and/or the area of each sensor202. More specifically, each sensor202may detect the spatially-varying magnetic field corresponding to the magnetic field lines it encloses. Since the magnitude of the variations in the magnetic field depends on the density of lithium dendrites, the output of each of sensors202represents the local lithium-dendrite density. Sensor array201is arranged such that it can measure contributions to the spatially-varying magnetic field originating from either one, or both, of a battery203comprised in the communications device and a battery comprised in another communications device which is in proximity of the communications device (i.e., either one, or both, of battery113and battery123illustrated inFIG. 1).

The first battery comprises a first spatially-varying density of metallic particles which give rise to the spatially-varying magnetic field when subjected to an excitation magnetic field penetrating the first battery. The first battery may either be comprised in communications device200, such as battery203, or in another communications device. Optionally, the measured magnetic field may originate from the first spatially-varying density of metallic particles and a second spatially-varying density of metallic particles comprised in a second battery which is comprised in the other communications device. The second battery may be of the same, or a different, type as the first battery.

Communications device200may further comprise a magnetic-field generator204for generating the excitation magnetic field which is used for exciting eddy currents in the first spatially-varying density of metallic particles and optionally in the second spatially-varying density of metallic particles. The excitation magnetic field may, e.g., be a magnetic-field pulse or an ac magnetic field. Magnetic-field generator204may, e.g., comprise an inductor coil and a power supply which is arranged for driving a current through the coil. Magnetic-field generator204is arranged such that the generated excitation magnetic field penetrates at least one of battery203comprised in communications device200and a battery comprised in the other communications device which is in proximity of communications device200. Advantageously, an induction coil provided for the purpose of wireless charging may be utilized for generating the excitation magnetic field.

If a magnetic-field pulse or a sequence of pulses is used as excitation magnetic field, the duration of each pulse is typically in the order of tens of microseconds, while the repetition frequency in a sequence of pulses may be in the order of a few hundred Hz. The general behavior of the spatially-varying magnetic field originating from the eddy currents excited in the metallic particles follows closely the excitation magnetic field. However, after the excitation magnetic-field has vanished, the decay of the measured spatially-varying magnetic field depends on the density of the metallic particles and their type. The decay time of the decaying measured magnetic field may, e.g., be defined as the time it takes for the measured magnetic field strength to decay from 90% to 10% of its maximum value. The decay time of the pulse is proportional to the local densities of metallic particles, such as lithium dendrites in the first battery and optionally the second battery.

An alternative is the use of continuous wave detection. In such case magnetic-field generator204generates an excitation magnetic field of sinusoidal strength. As a result, the measured spatially-varying magnetic field also contains one or multiple sinusoidal components. However, since the phase and the amplitude of each of the sinusoidal components depends on the metallic-particle densities, the amplitudes and phases of the magnetic field measured by sensors202, i.e., complex values, may be utilized for deriving the key.

Optionally, the excitation magnetic field may be generated in response to detecting proximity of the other communications device. For instance, with reference toFIGS. 3 and 4, magnetic-field generator114comprised in first communications device110may generate excitation magnetic field310or410in response to detecting proximity of second communications device120. This may, e.g., be achieved by determining that the signal strength of a radio signal or beacon transmitted by second communications device120, and received by first communications device110, exceeds a threshold value. As an alternative, generating the excitation magnetic field may be initiated periodically, or when a timer has expired. It will be appreciated that the entire process of generating the key or establishing secure communications, not just generating the excitation magnetic field, may be initiated in response to detecting proximity of another communications device, periodically, or when a timer has expired.

Magnetic-field generator204may optionally generate the excitation magnetic field in response to receiving an instruction from a user of communications device200. For instance, the user may press a button, start an app on a smartphone200, shake communications device200, or perform a gesture. Likewise, the entire process of generating the key or establishing secure communications may be initiated in response to receiving such a user instruction. Further optionally, magnetic-field generator204may generate the excitation magnetic field in response to receiving a request from the other communications device. For instance, with reference toFIGS. 3 and 4, magnetic-field generator114comprised in first communications device110may generate excitation magnetic field310or410in response to receiving a request from second communications device120, via communications interfaces205. The request may, e.g., relate to establishing a secure communication session between communications devices110and120, or to a request for establishing a shared secret.

According to another embodiment of the invention, the excitation magnetic field is generated by the other communications device. For instance, this is the case for second communications device120illustrated inFIGS. 3 and 4, which measures spatially-varying magnetic field(s)320, or420and430, which arise in response to excitation magnetic field310or410, respectively, generated by magnetic-field generator114comprised in first communications device110.

Processing means206comprised in communications device200is operative to acquire a set of values from sensor array201and derive the key from the set of values. The values represent the spatially-varying magnetic field, in particular the spatial variations of the measured magnetic field. Sensor array201may measure the spatially-varying magnetic field, and processing means206may acquire the set of values from sensor array201, either continuously or periodically, in response to detecting the excitation magnetic field generated by communications device200or by the other communications device, or on request by processing means206. That is, processing means206may further be operative to control magnetic-field generator204to generate the excitation magnetic field.

Even further, processing means206may be operative to use the generated key as a shared secret in communications with the other communications device. For instance, two communications devices, such as communications devices110and120, may attempt to establish a secure communication session for the purpose of verifying that both communications devices have generated the same key. The secure communication session may either be established directly between the two communications devices, or via a third party, such as a server or a broker for effecting financial transactions at a point-of-sale.

Processing means206may be operative to derive the key from the set of values using a number of alternatives. In the present context, the key, sometimes also referred to as security token, is a string, vector, sequence, or array, of bits, characters, or any other kind of symbols, which may be used in security applications such as encryption, decryption, signing, hashing, and the like.

For instance, the key may be derived from the set of values by means of base conversion. Here it is assumed that the set of values comprises N values, which are acquired from sensor array201. Each of the values may, e.g., correspond to one of N sensors202of sensor array201. In order to generate the key, each of the N values may be presented as a binary number of k bits, resulting into a total number of K=kN bits which may be extracted from the set of values. To increase resilience against measurement noise and the like, only the most significant bits may be used.

In order to provide a more reliable way of generating identical copies of the key at two communications devices, in particular under slightly varying orientation, and the like, more sophisticated methods may be used for deriving the key from the set of values. For instance, instead of directly converting the N values into binary form, one may base the key derivation on properties of the set of values which provide more resilience against noise and other measurement artifacts. Such properties may, e.g., be statistical properties of the set of values, such as a minimum value, a maximum value, a mean value, or the like, or an order which is imposed on the set of values. The key may then be derived based on respective indices or positions of sensors202in sensor array201.

More specifically, it is assumed that each value of the set of values represents the spatially-varying magnetic field measured by a respective sensor202of sensor array201, and that each sensor202in sensor array201is associated with an index identifier which is related to its position in sensor array201. Different ways of assigning indices to sensors202in sensor array201are illustrated inFIG. 5. As a first example510, sensors202may be indexed according to a row-major order from a lowest index, e.g.,1, to a highest index, e.g., the maximum number of sensors202in sensor array201, inFIG. 5assumed to be equal to 12. As a second example520, sensors202may be indexed according to a column-major order from the lowest index to the highest index. As a third example530, sensors202may be identified based on an array- or matrix-style notation “n, m”, where n is the index of the row of a certain sensor and m is the index of the column of the sensor in sensor array201. Finally, as a fourth example540the order of indices n and m may be reversed, i.e., sensors202are identified as “m, n”.

To this end, processing means206is operative to derive the key from the set of values by selecting one or more values of the set of values, and derive the key based on one or more indices of sensors202which have measured the one or more selected values.

For instance, one may select the minimum value and the maximum value of the set of values acquired from sensor array201. Subsequently, the indices of the sensors202which have measured these values are determined. As an example, it is assumed here that sensors202are indexed according to order510, and that the sensor with index “3” (marked with a filled square) has measured the minimum value whereas the sensor with index “10” (marked with a filled circle) has measured the maximum value. Then, the key is derived from these two indices, e.g., as a concatenation of the binary representations of the index for the minimum value, “0011” (assuming a 4-bit representation allowing for up to 16 sensors, and 0.8+0·4+1·2+1·1=3), and that of the index for the maximum value, “1010”, i.e., “00111010”. As a further example, if sensors are index according to order540, the same two sensors are identified by indices “3,1” and “2,3”, respectively. In this case, using a 2-bit representation for each of the row- and the column-index (allowing for up to four rows and columns, respectively), the index for the minimum value is “1101” in binary representation (concatenating the binary representation of the row-index, 1·2+1·1=3, and that of the column-index, 0·2+1·1=1) and the index for the maximum value is “1011” in binary representation, which may, e.g., be concatenated into a key “11011011”. Deriving the key based on sensor positions, by utilizing indices which reflect an order of sensors202in sensor array201, is advantageous in that the generating the key is less sensitive to measurement noise and variations due to device orientation and the like.

It will also be appreciated that the key derivation algorithm may be extended to include not only the minimum and maximum values but also additional values according to an order of the set of values. For instance, all N values may be sorted in ascending or descending order, and the sequence of the corresponding sensor indices may be utilized for deriving the key. For instance, the indices associated with the measured values sorted in ascending or descending order, may be concatenated into the key. For sensor arrays illustrated inFIG. 5, this would result in a key of K=4N bits, owing to the four bits required to represent the N=12 sensor indices, i.e., 48 bits.

Optionally, all measured values acquired from sensor array201may be scaled using a maximum value, a minimum value, an average value, a running average value, or the like. The algorithm which is utilized for deriving the key from the set of values should not be sensitive to small variations and allow generating the same key, with rather high likelihood, in both communications devices.

As a further improvement, if sensor array111comprised in first communications device110is used to probe battery123comprised in second communications device120, it is desirable that the key may be derived with a certain level of invariance to relative translations of communications devices110and120. This may be realized by utilizing a sensor array111which has a surface area larger than that of battery123, and selecting only a subset of the sensors in sensor array111for deriving the key. For instance, a subset of sensors may be selected which are contained within a circumference corresponding to that of battery123.

In the field of PUFs, bit extraction algorithms are known which are reliable to noise and variations in measurement conditions. One such algorithm is the LISA algorithm [C.-E. D. Yin and G. Qu, “LISA: Maximizing RO PUF's secret extraction”, in 2010 IEEE International Symposium on Hardware-Oriented Security and Trust (HOST), pages 100-105, 2010]. The algorithm is based on the understanding that individual values of a set of measured values may not be very stable. In the present context, they may, e.g., vary with the relative orientation of communications devices110and120. Rather than considering individual values, the algorithm utilizes pairs of values which are measured by sensors202which are further apart. The sign of a difference of the pair of values may then be used to extract one bit. Since the values belonging to the same pair are measured far apart, resilience against noise and variations in measurement conditions is achieved. An alternative algorithm which may be used to extract bits in a reliable and stable manner is the Kendall Syndrome Coding (KSC) algorithm [C.-E. Yin and G. Qu, “Kendall Syndrome Coding (KSC) for Group-Based Ring-Oscillator Physical Unclonable Functions”, Technical report, University of Maryland, 2011].

Further with reference toFIG. 2, communications device200may comprise additional components such as a display, a touchscreen, one or more keys or a keyboard, a camera, or the like.

In the following, an embodiment600of processing means206is described with reference toFIG. 6. Processing means600comprises a processing unit601, such as a general purpose processor, and a computer-readable storage medium602, such as a Random Access Memory (RAM), a Flash memory, or the like. In addition, processing means600comprises one or more interfaces604(‘I/O’ inFIG. 6) for controlling and/or receiving information from sensor array201, magnetic-field generator204, communications interface205, and optionally additional components, such as one or more keys, a keypad or keyboard, and a display or touchscreen. Memory602contains computer-executable instructions603, i.e., a computer program, for causing a communications device, such as a mobile terminal, a UE, a smartphone, a wearable device, a tablet, a smartwatch, a cash register, a payment terminal, a sensor, an actuator, or a laptop, to perform in accordance with an embodiment of the invention as described herein, when computer-executable instructions603are executed on processing unit601.

FIG. 7shows an alternative embodiment700of processing means206comprised in communications device200. Processing means700comprises an acquisition module702for acquiring a set of values from sensor array201, which set of values represents the spatially-varying magnetic field measured by sensor array201, a key derivation module703for deriving the key from the set of values, and one or more interface modules704(‘I/O’ inFIG. 7) for controlling and/or receiving information from sensor array201, magnetic-field generator204, communications interface205, and optionally additional components, such as one or more keys, a keypad or keyboard, and a display or touchscreen. Optionally, processing means700may further comprise a proximity module701for detecting proximity of another communications device. Proximity module701, acquisition module702, and key derivation module703, and additional modules which processing means700may comprise, are configured to perform in accordance with an embodiment of the invention as described herein.

Modules701-704, as well as any additional modules comprised in processing means700, may be implemented by any kind of electronic circuitry, e.g., any one, or a combination of, analogue electronic circuitry, digital electronic circuitry, and processing means executing a suitable computer program.

In the following, embodiments800of the method of a communications device, for generating a key for use as a shared secret in communications with another communications device, are described with reference toFIG. 8.

Method800comprises measuring831a spatially-varying magnetic field originating from a first spatially-varying density of metallic particles comprised in a first battery, when subjected to an excitation magnetic field. The first battery may, e.g., be comprised in the communications device. The spatially-varying magnetic field is measured831using a sensor array. Method800further comprises acquiring832a set of values from the sensor array, which set of values represents the spatially-varying magnetic field. Even further, method800comprises deriving833the key from the set of values.

Optionally, the measured magnetic field originates from the first spatially-varying density of metallic particles and a second spatially-varying density of metallic particles comprised in a second battery, when subjected to the excitation magnetic field. The second battery is comprised in the second communications device.

Method800may further comprise generating821the excitation magnetic field. Optionally, the excitation magnetic field is generated821in response to detecting811proximity of the other communications device. Alternatively, the excitation magnetic field may be generated821in response to receiving812an instruction from a user of the communications device, or in response to receiving813a request from the other communications device.

According to an embodiment of method800, the excitation magnetic field may be generated by the other communications device. Optionally, the set of values is acquired832from the sensor array in response to detecting822the excitation magnetic field generated by the other communications device.

According to an embodiment of method800, method800may further comprise using835the key as a shared secret in communications with the other communications device. Optionally, the shared secret may be verified, i.e., it may be verified that the communications device and the other communications device have generated identical keys.

According to an embodiment of method800, the key is derived833from the set of values by means of base conversion.

According to another embodiment of method800, each value of the set of values represents the spatially-varying magnetic field measured by a respective sensor of the sensor array, and the key is derived833from the set of values by selecting one or more values of the set of values and deriving the key based on one or more indices of sensors which have measured the one or more selected values.

It will be appreciated that method800may comprise additional, or modified, steps in accordance with what is described throughout this disclosure. Method800may be performed by a communications device such as a mobile terminal, a UE, a smartphone, a wearable device, a tablet, a smartwatch, a cash register, a payment terminal, or a laptop. An embodiment of method800may be implemented as software, such as computer program603, to be executed by processing unit601comprised in communications device200, whereby communications device200is operative to perform in accordance with embodiments of the invention described herein.

The person skilled in the art realizes that the invention by no means is limited to the embodiments described above. On the contrary, many modifications and variations are possible within the scope of the appended claims.