Systems and methods for optimizing Rivest-Shamir-Adleman (RSA) key generation

By configuring a key generation service in the secure element and managing RSA key generation using scheduled tasks and counters, the problem of the key generation process affecting device performance is solved, thereby improving device response speed and user experience.

CN122247623APending Publication Date: 2026-06-19STMICROELECTRONICS INT NV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
STMICROELECTRONICS INT NV
Filing Date
2025-11-12
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

In existing technologies, the secure element takes a long time to generate RSA keys, which makes it impossible to process other commands at the same time, affecting user experience and device performance.

Method used

By configuring a key generation service in the secure element, RSA key pairs are generated and stored in fixed time periods using scheduled tasks, and the number of keys is managed using counters and error codes, thus optimizing the key generation process.

Benefits of technology

This reduces the impact of the key generation process on other commands, improves device response speed, enhances user experience, and reduces the likelihood of concurrency issues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122247623A_ABST
    Figure CN122247623A_ABST
Patent Text Reader

Abstract

This disclosure relates to systems and methods for optimizing Rivest-Shamir-Adleman (RSA) key generation. Apparatus, systems, and methods for optimizing Rivest-Shamir-Adleman (RSA) key generation are also provided. An exemplary method includes obtaining one or more first commands at an encryption key generation service in a secure element of a device for generating and storing one or more encryption keys in the encryption key generation service; in response to the first or more commands: generating one or more encryption keys at the encryption key generation service; and storing one or more encryption keys at the encryption key generation service; obtaining a second key at the encryption key generation service to generate a second command for an encryption key for an application associated with the device; and in response to the second command, outputting at least a portion of one of the one or more encryption keys stored at the encryption key generation service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The exemplary embodiments of this disclosure generally relate to systems, apparatus, and methods for optimizing Rivest-Shamir-Adleman (RSA) key generation. Background Technology

[0002] Some devices utilize secure elements, such as embedded secure elements (eSEs) or secure processing units (iSEs), to enhance security. For example, a device can use a secure element to protect sensitive data and enable secure communication. Some secure elements are tamper-proof and include a central processing unit (CPU), storage devices, and a true random number generator. Additionally, some secure elements may include mechanisms to resist application packet tampering and unauthorized sideloading, secure timers, and reboot notification pins (or equivalents) (such as general purpose input / output (GPIO)). Some secure elements can be configured to support hardware-supported keystores (also known as password managers) (such as StrongBox). For example, StrongBox can be implemented within a secure element and used by the device for various use cases, such as protecting user credentials and data and / or protecting application keys and supporting platform authentication. In some cases, applications on devices that include StrongBox can invoke StrongBox to generate cryptographic key pairs, such as Rivest-Shamir-Adleman (RSA) key pairs.

[0003] There is a need for new systems and methods for generating RSA keys in secure elements such as StrongBox. The inventors have identified numerous areas for improvement in existing technologies and processes, which are the subject of the embodiments described herein. Many of these deficiencies, challenges, and problems have been addressed through the application of effort, ingenuity, and innovation by developing solutions included in the embodiments of this disclosure, some of which are described in detail herein. Summary of the Invention

[0004] The various embodiments described herein relate to systems, apparatuses, and methods for optimizing Rivest-Shamir-Adleman (RSA) key generation.

[0005] According to some embodiments of this disclosure, an example method is provided. The example method includes: obtaining one or more first commands at an encryption key generation service in a secure element of a device to generate and store one or more encryption keys in the encryption key generation service. The example method further includes: generating one or more encryption keys at the encryption key generation service in response to the first or more commands; and storing the one or more encryption keys at the encryption key generation service. The example method further includes: obtaining a second command at the encryption key generation service to generate encryption keys for an application associated with the device; and outputting at least a portion of one of the one or more encryption keys stored at the encryption key generation service in response to the second command.

[0006] In at least one example embodiment, obtaining the first one or more commands includes: obtaining the first one or more commands based on the scheduled task.

[0007] In at least one example embodiment, obtaining the first one or more commands based on the scheduled task includes: obtaining the first one or more commands over a fixed duration.

[0008] In at least one example embodiment, the method includes: in response to outputting a portion of one of the one or more encryption keys, applying a flag to one of the one or more encryption keys, wherein the flag indicates a state associated with one of the one or more encryption keys.

[0009] In at least one example embodiment, the status indicates that one of the one or more encryption keys is not available for use with one or more other applications associated with the device.

[0010] In at least one example embodiment, the method includes: incrementing a counter in response to storing one or more encryption keys, wherein the count of the counter is based at least in part on the number of encryption keys included in the one or more encryption keys.

[0011] In at least one example embodiment, the method includes: obtaining a third command at an encryption key generation service to generate and store another encryption key in the encryption key generation service; and, in response to the third command, outputting a message including an error code based at least in part on a counter's count satisfying a threshold.

[0012] In at least one example embodiment, the method includes: decrementing a counter in response to outputting a portion of one or more encryption keys.

[0013] In at least one example embodiment, obtaining at least one of the first or more commands is based at least in part on the fact that the performance level of at least one application associated with the device does not meet a threshold.

[0014] In at least one example embodiment, the security element includes an embedded security element (eSE) or an integrated security element (iSE).

[0015] In at least one example embodiment, one of the one or more encryption keys includes an encryption key pair, the encryption key pair including a public key and a private key, and a portion of one of the one or more encryption keys includes the public key.

[0016] In at least one example embodiment, one or more encryption keys include one or more Rivest-Shamir-Adleman (RSA) key pairs.

[0017] In at least one example embodiment, the encryption key generation service is KeyMint.

[0018] In at least one example embodiment, the method includes: outputting a first one or more commands to an encryption key generation service in a secure element of a device to generate and store one or more encryption keys in the encryption key generation service; outputting a second command to the encryption key generation service to generate encryption keys for an application associated with the device; and in response to the second command, obtaining at least a portion of one of the one or more encryption keys from the encryption key generation service.

[0019] In at least one example embodiment, outputting the first one or more commands includes: outputting the first one or more commands according to the scheduled task.

[0020] In at least one example embodiment, outputting one or more commands according to a scheduled task includes: outputting one or more commands over a fixed duration.

[0021] In at least one example embodiment, the method includes: outputting a third command to an encryption key generation service to generate and store another encryption key in the encryption key generation service; receiving a message including an error code in response to the third command; and suppressing the output of other commands for generating and storing other encryption keys at the encryption key generation service in response to the error code.

[0022] In at least one example embodiment, at least one of the first or more commands is output based at least in part on the fact that the performance level of at least one application associated with the device has not met a threshold.

[0023] In at least one example embodiment, one of the one or more encryption keys includes an encryption key pair, the encryption key pair including a public key and a private key, and a portion of one of the one or more encryption keys includes the public key.

[0024] In at least one example embodiment, an example system is provided. The example system includes an encryption key generation service in a secure element, wherein the encryption key generation service is configured to: receive a first one or more commands to generate and store one or more encryption keys in the encryption key generation service. The encryption key generation service is further configured to: generate and store one or more encryption keys in response to the first one or more commands. The encryption key generation service is further configured to: receive a second command to generate a second command for an application associated with the system; and in response to the second command, output at least a portion of one of the one or more encryption keys.

[0025] The above-described invention is provided only for the purpose of summarizing some exemplary embodiments to provide a basic understanding of some aspects of this disclosure. Therefore, it should be understood that the above embodiments are merely examples and should not be construed as limiting the scope or spirit of this disclosure in any way. It should also be understood that the scope of this disclosure covers many potential embodiments in addition to those summarized herein, some of which will be further described below. Attached Figure Description

[0026] Certain exemplary embodiments of this disclosure have therefore been described in general terms, and reference will now be made to the accompanying drawings, which are not necessarily drawn to scale, wherein:

[0027] Figure 1 The illustration shows an exemplary system supporting systems and methods for optimizing RSA key generation according to one or more embodiments of the present disclosure;

[0028] Figure 2 The illustration shows an exemplary process diagram supporting systems and methods for optimizing RSA key generation according to one or more embodiments of the present disclosure;

[0029] Figure 3 The illustration shows an exemplary operational flowchart of a system and method for optimizing RSA key generation according to one or more embodiments of the present disclosure; and

[0030] Figure 4 The illustration shows an exemplary device supporting systems and methods for optimizing RSA key generation according to one or more embodiments of the present disclosure. Detailed Implementation

[0031] Some embodiments of the present disclosure will now be described more fully with reference to the accompanying drawings, which illustrate some, but not all, embodiments of the present disclosure. In fact, various embodiments of the present disclosure may be embodied in many different forms and should not be construed as being limited to the embodiments set forth herein; rather, these embodiments are provided to enable the present disclosure to meet applicable legal requirements. The same reference numerals refer to the same elements throughout the text.

[0032] As used herein, the term “comprising” means including but not limited to and should be interpreted in the manner in which it is typically used in the patent context. It should be understood that the use of broader terms (such as including, comprising, and having) is to support narrower terms (such as consisting of, substantially consisting of, and substantially consisting of).

[0033] The phrases “in various embodiments,” “in one embodiment,” “according to one embodiment,” “in some embodiments,” etc., generally mean that the specific feature, structure, or characteristic following the phrase may be included in at least one embodiment of this disclosure and may be included in multiple embodiments of this disclosure (importantly, such phrases do not necessarily refer to the same embodiment).

[0034] The word “example” or “exemplary” as used herein means “serving as an example, instance, or illustration.” Any implementation described herein as “exemplary” is not necessarily to be construed as superior to or better than other implementations.

[0035] If the specification states that a component or feature "may," "can," "should," "would," "preferably," "possibly," "typically," "optionally," "for example," "often," or "might" (or other such language) be included or have that feature, then the specified component or feature does not need to be included or have that feature. Such a component or feature may be optionally included in some embodiments, or it may be excluded from some embodiments.

[0036] The term "circuitous means" as used herein with respect to components of a system or apparatus should be understood to include specific hardware configured to perform functions associated with a particular circuitous means described herein. The term "circuitous means" should be broadly understood to include hardware and, in some embodiments, software for configuring the hardware. For example, in some embodiments, "circuitous means" may include processing circuitry, communication circuitry, input / output circuitry, etc. In some embodiments, other elements may provide for or complement the functionality of a particular circuitous means.

[0037] The term "encryption key" as used in this article refers to a string used within an encryption algorithm to encode or decode data.

[0038] As used in this document, the term "encryption key generation service" refers to a software application or app configured to generate encryption keys. An encryption key generation service (or more simply, a key generation service) can use one or more types of algorithms to generate one or more types of encryption keys, which can have different key sizes. Some non-limiting examples of algorithms used to generate encryption keys include the RSA algorithm, Advanced Encryption Standard (AES), Elliptic Curve Digital Signature Algorithm (ECDSA), Elliptic Curve Diffie-Hellman (ECDH) algorithm, Hash-based Message Authentication Code (HMAC), and Triple Data Encryption Standard (DES).

[0039] As used herein, the term "secure element" or similar designation refers to a tamper-proof hardware platform (such as a chip) capable of securely hosting applications and storing confidential and encrypted data. Secure elements can securely host applications and store confidential and encrypted data by implementing standardized standards and security constraints. For example, a secure element may include a hardware platform that has obtained one or more Evaluation Assurance Level (EAL) certifications (or one or more other types of certifications for one or more other types of standards). Some non-limiting examples of secure elements include eSE and iSE.

[0040] As used herein, the term "scheduled task" refers to an operation performed by a device according to a schedule. Scheduled tasks can be scheduled to occur periodically or irregularly.

[0041] As used herein, the term "flag" or similar means a variable that indicates a condition. In some examples, a flag comprises one or more bits that store a binary value or a Boolean variable used to indicate the condition. In some examples, a condition corresponds to a state.

[0042] As used herein, the term "error code" refers to a string that indicates the nature of an error that has occurred. In some examples, error codes include numeric or alphanumeric strings. In some examples, error codes indicate the type of error that has occurred. Overview

[0043] A secure element may include one or more software applications (also known as applets) to support various functionalities of the secure element. Such functionalities may also be referred to as services herein. For example, StrongBox refers to a device (such as an eSE or a secure processing unit on a SoC, such as an iSE) that may include one or more applets to perform one or more StrongBox services. In some examples, a secure element may include one or more other applets, such as applets for protecting user credentials and data, and applets for protecting application keys and supporting platform authentication. For example, StrongBox may include a Weaver applet for protecting user credentials and data. In some examples, a secure element may include applets for performing cryptographic key generation functionality within the secure element (e.g., an applet used to protect application keys and support platform authentication, or another applet). For example, StrongBox may include a KeyMint applet for performing cryptographic key generation functionality.

[0044] In some examples, applications in devices that include a secure element can invoke the secure element to generate encryption keys (such as RSA key pairs). However, in some such examples, the key generation process (e.g., in the KeyMint applet) can take a relatively long time. For example, completing the key generation process in the StrongBox KeyMint applet can take several seconds (e.g., at least 5 seconds or longer). In some cases, due to the key generation process, one or more other commands sent to the secure element during the key generation process may not be responded to (e.g., may not be processed by the secure element). In other words, the secure element may not be able to simultaneously perform the key generation process and respond to one or more commands.

[0045] As an illustrative example, during key generation, a device user (e.g., via fingerprint or personal identification number) can determine whether to unlock the device's screen, which may result in a command (e.g., a Weaver command) being sent from the device's lock settings service to the secure element. In such an example, the secure element may suppress the response to this command due to the key generation process. For example, the secure element may be unable to respond to one or more commands while the key generation process is in progress. In such an example, failure to receive a response from the secure element can cause the lock settings service to fail, which can degrade the user experience.

[0046] Various aspects of this disclosure relate to improved systems, apparatuses, and methods for optimizing key generation, and more specifically, for optimizing RSA key generation. Among other things, this disclosure specifies the generation and storage of key commands (e.g., "generating and storing RSA key pairs"), which can be used to pre-generate and store one or more RSA key pairs in a key generation service within a secure element (e.g., in eSE and / or iSE environments). For example, this disclosure may specify implementations for generating and storing key commands in a key generation service within a secure element (e.g., within the StrongBox KeyMint applet).

[0047] In some examples, the key generation and storage commands can be configured as scheduled tasks. For instance, the systems, apparatuses, and methods for optimizing key generation described herein can specify sending key generation and storage commands to a key generation service during one or more fixed time periods. As an illustrative example, the systems, apparatuses, and methods for optimizing key generation described herein can specify sending key generation and storage commands to a key generation service during one or more time periods between midnight and 1:00 AM.

[0048] In some examples, the key generation service can be configured with a threshold number of keys that can be stored in the key generation service (or elsewhere in the secure element) (e.g., a maximum number of keys). In some such examples, if the threshold number is reached, the key generation service can return an error code (e.g., "1F", indicating too many operations). In response to the error code, the source of the key generation service (e.g., a Strongbox client) can suppress the sending of one or more additional key generation and storage commands to the key generation service (e.g., for some duration, such as until another task involving the transmission of key generation and storage commands is scheduled to occur).

[0049] In some examples, the generate and store key command can trigger a key generation service to generate and store one or more RSA keys. In some such examples, in response to the key generation service receiving an RSA-invoked generate key command, the key generation service can suppress the execution of the key generation process and instead return one of the previously stored RSA keys. In other words, the generate and store key command can be used to generate and store RSA key pairs in the key generation service, such that the (pre-)generated RSA key pairs can be used to request the next (e.g., subsequently received) generate key command for an RSA key.

[0050] In some examples, the key generation service may use a counter to monitor the number of keys stored in the key generation service (or elsewhere in the secure element). In some such examples, the key generation service may increment the counter in response to a key generation and storage command (e.g., increment the counter by 1). Additionally, in some such examples, the key generation service may decrement the counter in response to a key generation command (e.g., decrement the counter by 1).

[0051] In some examples, the key generation service may apply flags to the key provided to the application in response to a key generation command. In some examples, one or more pre-generated keys stored in the key generation service (or elsewhere in the secure element) may be available regardless of the device's operational state. For example, one or more pre-generated keys stored in the key generation service (or elsewhere in the secure element) may be available after a device reset or restart. In some examples, by enabling the secure element to pre-generate and store one or more keys in the key generation service, the systems, apparatus, and methods described herein for optimizing key generation can provide an improved user experience and reduce the likelihood of concurrency issues, such as those associated with the secure element's inability to respond to multiple commands received simultaneously. Exemplary systems, methods, and apparatus

[0052] The embodiments disclosed herein include systems, methods, and apparatus for optimizing RSA key generation, which may be implemented in various embodiments.

[0053] Figure 1 An exemplary system 100 supporting systems, methods, and apparatus for optimizing RSA key generation, according to one or more embodiments of this disclosure, is illustrated. Figure 1 As illustrated in the example, device 105 may include application processor 110 and secure element 125. Application processor 110 may include (e.g., support) application 115 and application 115-b, as well as one or more other components. For example, application processor 110 may include one or more components configured to support communication between application 115 (e.g., a software application) and secure element 125. Some of these components may include one or more hardware abstraction layers (HALs) and / or one or more computer programs that run in the background and perform various tasks without direct user interaction.

[0054] Secure element 125 may be an example of an embedded secure element (eSE). For example, secure element 125 may be an example of a dedicated chip within device 105 that provides secure storage and processing for sensitive data. In some other examples, secure element 125 may be an example of an integrated secure element (iSE). For example, secure element 125 may be a secure subsystem directly built into a chip (e.g., a system-on-a-chip, integrated circuit (IC)) of device 105, thus becoming part of the host system. In other words, in some examples, secure element 125 may be one of multiple on-SoC secure processing units (e.g., including application processor 110) of device 105. Secure element 125 may include (e.g., support) one or more software applications (referred to herein as applets) configured to perform one or more specific tasks.

[0055] The secure element 125 may also include a CPU, secure storage devices (e.g., one or more secure storage applets, high-stress memory (HSM), or other types of memory), a true random number generator, and a reboot notification pin (or equivalent) (such as GPIO). Additionally, the secure element 125 may support one or more mechanisms to resist application packet tampering and unauthorized sideloading. In some examples, this includes one or more external interfaces and one or more features for electrostatic discharge (ESD) protection. The secure element 125 may be configured to support Application Protocol Data Unit (APDU) communication over Integrated Circuit Interconnect (I2C) and / or Serial Peripheral Interface (SPI). In some examples, the secure element may be referred to as a StrongBox. That is, the term StrongBox may refer to a device such as an eSE or a secure processing unit on a SoC (e.g., an iSE).

[0056] In some examples, the secure element 125 may be configured to manage one or more types of applets provided by one or more entities, including Java® Card applets. For example, the secure element 125 may include (e.g., support) a first applet 130, which may be an example of a key generation service (such as the StrongBox KeyMint applet, also known as the KeyMint applet, or more simply KeyMint). Additionally, the secure element 125 may include (e.g., support) a second applet 135, which may be an example of an applet used to protect user credentials and data (e.g., the StrongBox Weaver applet, also known as the Weaver applet, or more simply Weaver).

[0057] In some examples, the secure element 125 may support one or more low-power implementations. In some such examples, the secure element 125 may be configured to support subsets of algorithms and key sizes, including one or more types of RSA keys (e.g., RSA 2048), one or more types of AES keys (e.g., AES 128 and AES 256), one or more types of ECDSA keys, one or more types of ECDH keys (e.g., ECDH P-256), and one or more types of HMAC keys (e.g., HMAC-SHA 256). In some examples, the secure element 125 may support key sizes between 8 bytes and 64 bytes. The secure element 125 may also support triple DES and extended-length APDUs, as well as key authentication.

[0058] exist Figure 1 In the example, application 115-a (e.g., a payment application) can invoke secure element 125 (e.g., a StrongBox service) to generate one or more encryption keys. For example, the application can invoke secure element 125 to trigger a first applet 130 (e.g., KeyMint) within secure element 125 to generate an RSA key pair. In some such examples, application 115-a can send a key generation command 140 to secure element 125 (e.g., to the first applet 130 within secure element 125). Application 115-a can send the key generation command 140 via a HAL (such as KeyMint and / or StrongBox HAL).

[0059] In some examples, in response to receiving the key generation command 140, the first approx. 130 can generate an encryption key (e.g., an RSA key pair or another type of encryption key). In some such examples, the first approx. 130 can generate the encryption key over a period of time (e.g., approximately 5 seconds or longer). In other words, the process of generating the encryption key can take approximately 5 seconds or longer to complete. In some examples, during this duration, the secure element 125 can receive an additional command 145 from another application (such as application 115-b). In some such examples, the secure element 125 may be unable to process the additional command 145 due to the key generation process (e.g., it may be unable to respond to the additional command 145). In other words, if another command is sent to the secure element 125 during the key generation process, the secure element 125 can wait to process the other command until the key generation process is complete.

[0060] As an illustrative example, device 105 may be a mobile device (such as a mobile phone). Additionally, in such an illustrative example, the first applet 130 may be a KeyMint applet, and the second applet 135 may be a Weaver applet. In such an example, application 115-a (e.g., a payment application) may send a key generation command 140 to the KeyMint applet (thus triggering a key generation process within the KeyMint applet) before or simultaneously with the user of the mobile phone attempting to unlock the screen of the mobile device via fingerprint or personal identification number. This may involve application 115-b (e.g., a lock screen application, also known as LockSettingService) executing a Weaver command. In other words, when the first applet 130 generates an encryption key for application 115-a in response to the key generation command 140, the secure element 125 (e.g., the second applet 135 within secure element 125) may (e.g., via HAL) receive the additional command 145 from application 115-b.

[0061] In some examples, the secure element may fail to respond to the Weaver command due to the key generation process. That is, secure element 125 (e.g., the second applet 135 within secure element 125) may fail to respond to the additional command 145, which can lead to increased latency and reduced performance of application 115-b (e.g., LockSettingService may get stuck waiting for a response and may fail in some cases). In other words, requiring the first applet 130 to generate the encryption key in response to the key generation command can result in increased latency and a degraded user experience.

[0062] Various aspects of this disclosure provide improved key generation for secure elements. For example, various aspects of this disclosure provide optimizations for RSA key generation, which can reduce and prevent problems when an end user using a secure element (e.g., StrongBox) simultaneously requests RSA key pair generation with other processes (such as a LockSettingService request for unlocking a mobile device's screen).

[0063] According to one or more aspects of this disclosure, the first applet 130 may be configured to pre-generate one or more encryption keys in the first applet 130 (or elsewhere in the secure element 125) in response to one or more generate and store key commands 150 (e.g., one or more “generate and store RSA key pairs” commands).

[0064] like Figure 1As illustrated in the example, application processor 110 (e.g., one or more components or services of application processor 110) may issue a key generation and storage command 150-a to secure element 125. In response to key generation and storage command 150-a, first applet 130 may generate one or more encryption keys and store them in encryption key set 155.

[0065] In some examples, a key generation and storage command (e.g., key generation and storage command 150-a, key generation and storage command 150-b) can trigger a first applet 130 to generate a key (e.g., an RSA key pair) and store that key in the first applet 130 so that the key can be used for subsequent (e.g., the next) key generation commands requesting one or more RSA keys. In some examples, the key can be available regardless of the operating state of device 105. For example, the key can be available after device 105 is reset or restarted. In some examples, the key can be used (e.g., output in response to the command) for a single key generation command. In some such examples, the key generation and storage command can be invoked before each key generation command (e.g., each key generation command requesting the generation of an RSA key). Additionally or alternatively, the key generation and storage command can be invoked before each key generation command for applications that do not meet a performance level (e.g., execution time) threshold.

[0066] In some examples, the secure element may include the Java® Card operating system, and thus, applications using Java® technology (called applets) may be hosted. In other words, the first applet 130 and the second applet 135 may be examples of Java® Card applets. Thus, the key generation and storage command 150, as well as one or more other commands communicating with the secure element 125, may have a Java code-based format (e.g., APDU format). For example, the key generation and storage command 150 may be an example of a "Generate and Store RSA Key Pair" command formatted according to Table 1 below: In some examples, the status word (SW) for the key generation and storage command 150 can be formatted according to Table 2 below: In some examples, the operation conditions for commands can be configured according to Table 3 below:

[0067] It should be understood that the values ​​provided in Tables 1 through 3 are merely examples and should not be construed as narrowing the scope and spirit of the disclosure in any way. In some instances, the values ​​provided in Tables 1 through 3 may vary depending on the implementation method. For example, the "GENERATE AND STORE RSA KEY PAIR" command parameter provided to the first applet 130 may be based on a version of the first applet 130.

[0068] In some examples, generating and storing key commands can be set as scheduled tasks (e.g., during one or more fixed durations). That is, in some examples, one or more tasks can be scheduled to occur periodically or irregularly, and these tasks include transmitting one or more generating and storing key commands 150 to secure element 125 (e.g., transmitting to a first applet 130 within secure element 125). In other words, the first applet 130 can be scheduled to receive one or more generating and storing key commands 150 during one or more time periods (e.g., one or more fixed time periods). In some examples, one or more tasks can be scheduled to occur on one or more durations during which little or no data traffic is received at secure element 125 or little or no data traffic is output from secure element 125 (or there is little or no data traffic exchange between application 115 and secure element 125). As an illustrative example, the first applet 130 can be scheduled to receive one or more generating and storing key commands during one or more (fixed) time periods between midnight and 1 a.m.

[0069] like Figure 1 As illustrated in the example, secure element 125 (e.g., a first applet 130 within secure element 125) can be scheduled to receive one or more generate and store key commands 150 from application processor 110. For example, one or more applications 115 (e.g., one or more StrongBox clients) and / or one or more other components of application processor 110 (e.g., a keystore service) can be scheduled to emit one or more generate and store key commands 150 during one or more fixed time periods. In some other examples, first applet 130 can be scheduled to receive one or more generate and store key commands 150 from one or more other entities of device 105 and / or one or more other entities within secure element 125. For example, the operating system (or another applet) of secure element 125 can be scheduled (e.g., during one or more fixed time periods) to emit one or more generate and store key commands 150 to first applet 130.

[0070] In some examples, a generate and store key command 150-a (e.g., a single generate and store RSA key pair command) can trigger a first applet 130 to generate and store an encryption key (e.g., an RSA key pair) in the first applet 130 (or elsewhere in the secure element 125). In some such examples, the first applet 130 can be configured to store a threshold number (e.g., a maximum number) of encryption keys. For example, the first applet 130 may include a counter that can be incremented in response to the generation and / or storage of encryption keys. In other words, in response to receiving the generate and store key command 150-a, the first applet 130 may increment the value of the counter by 1 (or another suitable value).

[0071] In some examples, the number of encryption keys included in the encryption key set 155 (and therefore the value of the counter) may be equal to a threshold number of encryption keys. In such an example, in response to a generate and store key command, the first applet 130 may be configured to return an error code 160 (e.g., "F1"), which may indicate that too many operations have been performed. For example, after the first applet 130 generates an encryption key and stores it in the encryption key set 155 in response to receiving a generate and store key command 150-a, the number of encryption keys included in the key set 155 (and therefore the value of the counter) may be equal to the threshold number of encryption keys. In such an example, the first applet 130 may receive a generate and store key command 150-b when the value of the counter (e.g., a count) meets the threshold. Therefore, in response to receiving a generate and store key command 150-b (and based on the counter value meeting the threshold), the first applet 130 may issue an error code 160 (e.g., indicating that too many operations have been performed). In such an example, error code 160 can trigger the transmitter of generate and store key command 150-b (e.g., the StrongBox client) to suppress the transmission of subsequent generate and store key commands to secure element 125 (e.g., until the next scheduling duration, until the StrongBox client is otherwise triggered by secure element 125 to transmit another generate and store key command, and / or until the counter fails to meet the threshold).

[0072] In some examples, the first applet 130 may receive a key generation command 140. In such an example, in response to receiving the key generation command 140, the first applet 130 may return one of the encryption keys included in the encryption key set 155 stored at the first applet 130 (or otherwise stored in the secure element 125). For example, in response to receiving an RSA-invoked key generation command 140 (e.g., a "generate key" command), the first applet 130 may suppress the execution of the key generation process and may alternatively (e.g., immediately) return one of the previously stored RSA keys. For example, in response to receiving the key generation command 140 from application 115-a, the first applet 130 may suppress the execution of the key generation process and may alternatively return an encryption key 165, which may be one of the encryption keys included in the encryption key set 155. Therefore, if a user attempts to unlock the screen at the same time or before and after the security element 125 receives the key generation command 140 via the additional command 145 (e.g., simultaneously with the key generation command 140), the security element 125 can respond to both the key generation command 140 and the additional command 145 and can successfully unlock the screen.

[0073] Encryption key 165 may be an example of a symmetric key or public key of an asymmetric key pair. For example, encryption key set 155 may include one or more encryption key pairs (e.g., RSA key pairs), each of which may include a public key and a private key. In such an example, encryption key 165 may include the public key of the encryption key pair. Alternatively, encryption key 165 may include another type of encryption key that may be exposed outside of secure element 125.

[0074] In some examples, encryption key 165 (e.g., and one or more other encryption keys included in encryption key set 155) may be a one-time key. For example, in response to sending encryption key 165 (or a portion thereof) to application 115-a, first applet 130 may apply a flag to encryption key 165 such that encryption key 165 cannot be used by another application. For example, the flag may indicate a state associated with encryption key 165, and in some examples, this state may indicate that one of the encryption keys in encryption key 165 cannot be used by one or more other applications associated with device 105.

[0075] In some examples, in response to transmitting encryption key 165 (or a portion thereof) to application 115-a, the first applet 130 may decrement a counter. That is, in some examples, in response to transmitting encryption key 165, the first applet 130 may reduce the value of the counter by 1 (or another suitable value).

[0076] In some examples, by outputting an encryption key 165 in response to a key generation command 140, the secure element 125 (e.g., a second approx. 135 within the secure element 125) may be able to respond to an additional command 145 (e.g., a Weaver command). For example, by suppressing the execution of the key generation process and instead (immediately) returning one of the previously stored RSA keys, the secure element 125 (e.g., the second approx. 135 within the secure element 125) may be able to (e.g., immediately, without waiting for the key generation process to complete) respond to the additional command 145, which can reduce latency and improve the user experience. In other words, by pre-generating and storing one or more encryption keys via one or more (scheduled) key generation and storage commands, the secure element 125 can reduce latency and improve the user experience for the device 105.

[0077] Figure 2 An exemplary process diagram 200 is illustrated, supporting systems and methods for optimizing RSA key generation according to one or more embodiments of the present disclosure. Process diagram 200 illustrates, for example, aspects of one or more aspects of the present disclosure, such as... Figure 1 The operations performed within the system. For example, flowchart 200 illustrates an example operation performed by key generation service 230 in security element 225. Key generation service 230 may be performed by... Figure 1 Illustration and reference Figure 1 An example of a key generation applet (e.g., the KeyMint applet) is described. Additionally, the secure element 225 can be generated by... Figure 1 Illustration and reference Figure 1 Examples of security elements (e.g., StrongBox) are described. Process diagram 200 also illustrates example operations performed by client 215. In some examples, client 215 may be... Figure 1 Illustration and reference Figure 1 Examples of applications described (e.g., the StrongBox client). In some other examples, client 215 could be... Figure 1 Illustration and reference Figure 1 Examples of one or more components (or services) of the application processor or security element described herein. One or more operations performed at key generation service 230 and / or client 215 may be performed in a different order than the example order shown. Additionally or alternatively, one or more operations performed at key generation service 230 and / or client 215 may be omitted and / or one or more other operations may be added. Process diagram 200 may support optimized RSA key generation as described herein.

[0078] In some examples, the key generation process in secure element 225 (e.g., the process of generating an RSA key or one or more other types of keys) can occur over a relatively long period of time, such as approximately 5 seconds or longer. In some such examples, if an application calls a key generation request to secure element 225 during the key generation process, one or more other requests may not be responded to, which can increase system latency.

[0079] One or more aspects of this disclosure provide a method for pre-generating and storing one or more encryption keys (e.g., one or more RSA keys or one or more other types of keys) in a key generation service 230 of a secure element 225 (e.g., in a StrongBox KeyMint applet, or another type of key generation service), for example as a scheduled task. Therefore, in response to a key generation request received by the secure element 225 for an application, the secure element 225 can (e.g., via the key generation service 230) directly return one of the previously stored encryption keys, thereby skipping the key generation process and reducing latency.

[0080] At point 202, the key generation service 230 can obtain one or more commands to generate and store keys. That is, the key generation service 230 can obtain one or more commands for generating and storing one or more encryption keys within the key generation service 230. The commands to generate and store keys can be generated by... Figure 1 Illustration and reference Figure 1 Examples of generated and stored key commands are described. For instance, key generation service 230 may obtain one or more generated and stored key commands based on a scheduled task. In some examples, key generation service 230 may obtain one or more generated and stored key commands from client 215 over a fixed duration (e.g., one or more fixed time periods).

[0081] At 204, in response to one or more key generation and storage commands, key generation service 230 may generate and store one or more encryption keys (or elsewhere in secure element 225). The one or more encryption keys may be generated by... Figure 1 Illustration and reference Figure 1 Examples of one or more encryption keys described. For example, one or more encryption keys may include one or more key pairs (e.g., one or more RSA key pairs). In some examples, the key generation service 230 may increment a counter in response to storing one or more encryption keys. In some such examples, the counter count may be based on the number of encryption keys included in the one or more encryption keys stored at the key generation service 230.

[0082] In some examples, at 206, the key generation service 230 may receive another command to generate and store a key (e.g., another command to generate and store another encryption key in the key generation service 230). In some such examples, at 208, in response to the other command to generate and store a key, the key generation service 230 may output a message including an error code based on a counter count that satisfies a threshold (e.g., a value equal to the threshold number of encryption keys that can be stored elsewhere in the key generation service 230 or the secure element 225).

[0083] At point 210, the key generation service 230 can obtain a key generation command (e.g., a second command for generating an encryption key) for an application associated with the device. The key generation command can be generated by... Figure 1 Illustration and reference Figure 1 An example of the command to generate the key.

[0084] At 212, in response to a key generation command, key generation service 230 may output at least a portion of one of one or more encryption keys stored at key generation service 230. For example, the one of the one or more encryption keys may include an encryption key pair (e.g., an RSA key pair) that includes a public key and a private key. In such an example, the portion of the one of the one or more encryption keys may include the public key.

[0085] In some examples, in response to outputting a portion of one or more encryption keys, the key generation service 230 may decrement a counter. Additionally or alternatively, in response to outputting a portion of one or more encryption keys, the key generation service 230 may apply a flag to one or more encryption keys. In such examples, the flag may indicate a state associated with one or more encryption keys. For example, the flag may indicate that one or more encryption keys cannot be used by one or more other applications associated with the device.

[0086] In some examples, client 215 can be configured to invoke security element 225 to pre-generate one or more encryption keys based on the performance level of at least one application on the device (e.g., the application or one or more other applications) failing to meet a threshold (e.g., it can be configured to schedule the transmission of one or more key generation and storage commands). For example, client 215 (or another component communicating electronically with client 215) can determine that the performance level of an application (or another application in the device) is lower than a performance level baseline (or threshold). As an illustrative example, client 215 can determine that the execution time of an application (or another application in the device) is relatively high, thus lowering the device's performance level. In such an example, to improve the application's performance, client 215 can output (as a scheduled task) one or more key generation and storage commands, such that key generation service 230 can (pre-)generate and store one or more encryption keys, and client 215 can directly obtain one or more encryption keys via the key generation commands (e.g., without requiring key generation service 230 to perform the key generation process). In other words, client 215 can output key generation and storage commands for one or more applications to improve the execution time of one or more applications. In some examples, by pre-generating and storing one or more encryption keys via one or more (scheduled) key generation and storage commands, the security element 225 can reduce latency and improve the user experience of the client 215.

[0087] Figure 3 An exemplary flowchart illustrating the operation of a system and method for optimizing RSA key generation according to one or more embodiments of the present disclosure is shown. The operation of flowchart 300 can be performed by… Figure 1 and Figure 2 Illustration and reference Figure 1 and Figure 2 The operation of flowchart 300 may be implemented at one or more of the described components. For example, the operation of flowchart 300 may be implemented by an encryption key generation service, which may be an example of a key generation applet, or separately by... Figure 1 or Figure 2 Illustration and reference Figure 1 or Figure 2 The described key generation service. For example, the encryption key generation service could be provided by... Figure 1 Illustration and reference Figure 1 An example of the first mini-program described (e.g., the KeyMint mini-program), or by... Figure 2 Illustration and reference Figure 2 An example of a described key generation service. The key generation service can be a component of a security element (e.g., executed therein), which can be... Figure 1 and Figure 2 Illustration and reference Figure 1 and Figure 2 Examples of safety elements described. For example, a safety element could be an example of an eSE or iSE of a device (or another type of safety element).

[0088] At position 302, the encryption key generation service can obtain one or more first commands for generating and storing one or more encryption keys within the encryption key generation service. The first or more first commands can be generated by... Figure 1 and Figure 2 Illustration and reference Figure 1 and Figure 2 Examples of commands for generating and storing keys are described. For instance, a first one or more commands (e.g., one or more "Generate and Store Key Pairs" commands, one or more "Generate and Store RSA Key Pairs" commands) can trigger an encryption key generation service to generate and store one or more encryption key pairs (such as one or more RSA key pairs).

[0089] The encryption key generation service can obtain one or more commands based on a scheduled task. For example, the encryption key generation service can obtain one or more commands over a fixed duration. In some examples, the encryption key generation service can obtain one or more commands from a client of the device. The client of the device may include one or more applications (e.g., applets) of the operating system or security element, or (non-secure) components of the device (such as the device's application processor). In some examples, the encryption key generation service may obtain one or more commands based on the fact that the performance level of at least one application associated with the device does not meet a threshold (e.g., below a threshold performance level, which may be due to increased latency).

[0090] At 304, in response to the first or more commands, the encryption key generation service may perform one or more actions. For example, the encryption key generation service may generate and store one or more encryption keys at the encryption key generation service (or elsewhere in the secure element). In some examples, such as successful execution of the generate and store key command, the encryption key generation service may output a message indicating successful execution of the command. In some other examples, such as unsuccessful execution of the generate and store key command, the encryption key generation service may output a message including an error code in response to one of the first or more commands. For example, in response to storing an encryption key (e.g., in response to obtaining one of the first or more commands), the encryption key generation service may increment a counter at the encryption key generation service. In some such examples, by incrementing the counter, the counter count may meet a threshold. This threshold may be based on (e.g., corresponding to) a threshold (e.g., maximum) number of encryption keys that can be stored at the encryption key service. In some such examples, in response to another (subsequent) command in the first or more commands, the encryption key generation service may output a message including an error code based on the counter count meeting the threshold.

[0091] At position 306, the encryption key generation service can obtain a second command to generate an encryption key for applications associated with the device. This second command can be generated by... Figure 1 and Figure 2 Illustration and reference Figure 1 and Figure 2 Examples of key generation commands described (e.g., the "Generate Key" command invoked by RSA).

[0092] At 308, in response to the second command, the encryption key generation service may output at least a portion of one of the one or more encryption keys stored at the encryption key generation service. For example, the one or more encryption keys may include one or more encryption key pairs, where each encryption key pair may include a public key and a private key. In such an example, the encryption key generation service may output the public key of one of the one or more encryption key pairs.

[0093] In some examples, in response to outputting that portion of one or more encryption keys, the encryption key generation service may apply a flag to that one or more encryption keys. This flag may be a reference... Figure 1 and 2Examples of the described flag. For instance, the flag may indicate a state associated with one of one or more encryption keys. In some examples, the state indicates that one of the one or more encryption keys is not available to one or more other applications associated with the device. That is, the flag may indicate that one of the one or more encryption keys cannot be provided to another application, including one or more other applications associated with the device. In some examples, in response to outputting that portion of one or more encryption keys, the encryption key generation service may decrement a counter (e.g., such that the counter count is reduced by 1). In some examples, by pre-generating and storing one or more encryption keys, the secure element may suppress the execution of the key generation process in response to a key generation command, and instead (e.g., immediately) return one of the previously stored encryption keys, resulting in reduced latency and improved performance, among other advantages.

[0094] Figure 4 The illustration shows an exemplary device supporting systems and methods for optimizing RSA key generation according to one or more embodiments of the present disclosure. Figure 4 It can be done by Figures 1 to 3 Illustration and reference Figures 1 to 3 This can be implemented in one or more aspects described. For example, device 400 can be a device for an application, apparatus, and / or system. Device 400 can be a mobile device (such as a mobile phone), or another type of device used for various security applications (such as payments, digital keys (e.g., vehicle keys, house keys), battery charging, or ticketing). Device 400 can be a system and / or apparatus that includes a processor 402, a memory 404, a communication circuitry 406, an input / output circuitry 408, and a key generation circuitry 410, all of which can be connected by a bus or bus 412. It should be understood that in some embodiments, device 400 may include or otherwise couple to one or more other components, such as a power supply and / or load. The power supply and / or load can be internal or external to device 400.

[0095] Although processor 402 is illustrated as a single block, it may consist of multiple components and / or processor circuitry. Processor 402 may be implemented as, for example, various components, including one or more microprocessors with an accompanying digital signal processor; one or more processors without an accompanying digital signal processor; one or more coprocessors; one or more multi-core processors; processing circuitry; and various other processing elements. The processor may include integrated circuits. In various embodiments, processor 402 may be configured to execute applications, instructions, and / or programs stored in or otherwise accessible to processor 402. When executed by processor 402, these applications, instructions, and / or programs may enable the execution of one or more operations and / or functions described herein. Whether configured by hardware, firmware / software methods, or a combination thereof, processor 402 may, upon appropriate configuration, include entities capable of performing operations and / or functions according to embodiments of this disclosure.

[0096] Memory 404 may include, for example, volatile memory, non-volatile memory, or some combination thereof. Although illustrated as a single block, memory 404 may include multiple memory components. In various embodiments, memory 404 may include, for example, random access memory, cache memory, flash memory, hard disk, circuitry configured to store information, or combinations thereof. Memory 404 may be configured to write or store data, information, application programs, instructions, etc., such that processor 402 can perform various operations and / or functions according to embodiments of the present disclosure. For example, in at least some embodiments, memory 404 may be configured to buffer or cache data for processing by processor 402. Additionally or alternatively, in at least some embodiments, memory 404 may be configured to store program instructions for execution by processor 402. Memory 404 may store information in the form of static and / or dynamic information. The stored information may be stored and / or used by processor 402 when operations and / or functions are performed.

[0097] Communication circuitry 406 may be implemented as circuitry, hardware, a computer program product, or a combination thereof, configured to receive and / or transmit data from / to another component or device. The computer program product may use computer-readable program instructions stored on a computer-readable medium (e.g., memory) and executed by processor 402. In various embodiments, communication circuitry 406 (like other components discussed herein) may be at least partially implemented as part of or otherwise controlled by processor 402. Communication circuitry 406 may communicate with processor 402, for example, via bus 412. This bus 412 may be connected to processor 402, and it may also be connected to one or more other components of processor 402. Communication circuitry 406 may consist of, for example, a transmitter, receiver, transceiver, network interface card, and / or supporting hardware and / or firmware / software, and may be used to establish communication with other components, devices, and / or systems. Communication circuitry 406 may be configured to receive and / or transmit data that may be stored in memory using one or more protocols that may be used for communication between components, devices, and / or systems.

[0098] Input / output circuitry 408 can communicate with processor 402 to receive instructions input by the operator and / or provide auditory, visual, mechanical, or other outputs to the operator. Input / output circuitry 408 may include supporting devices such as a keyboard, mouse, user interface, display, touchscreen display, lights (e.g., warning lights), indicators, speakers, and / or other input / output mechanisms. Input / output circuitry 408 may include one or more interfaces to which supporting devices can be connected. In various embodiments, aspects of input / output circuitry 408 may be implemented on the device used by the operator to communicate with processor 402. Input / output circuitry 408 may communicate with memory, communication circuitry 406, and / or any other components, for example, via bus 412.

[0099] The key generation circuit device 410 can be composed of Figure 1 Illustration and reference Figure 1 Examples of the described system or its components. For example, the key generation circuit device 410 could be composed of... Figure 1 Illustration and reference Figure 1Examples of the described secure element, or elements that may be included within the secure element. Key generation circuitry 410 may include a CPU and secure storage, or be otherwise coupled to a CPU and secure storage (e.g., within the secure element). In some examples, the key generation circuitry is configured to support a true random number generator and a secure timer, as well as additional mechanisms to resist application packet tampering and unauthorized sideloading. In some examples, key generation circuitry 410 includes a restart notification pin (or equivalent) (such as a GPIO). Key generation circuitry 410 may include a key generation service 414 (e.g., KeyMint), which may be generated by... Figures 1 to 3 Illustration and reference Figures 1 to 3 An example of a described key generation service.

[0100] In some examples, the key generation circuitry 410 may receive a first or more commands to generate and store one or more encryption keys in the key generation service 414. In some such examples, in response to the first or more commands, the key generation service 414 may generate one or more encryption keys at its own location. For example, the key generation service 414 may use a true random number generator (or one or more other components of a secure element) to generate one or more encryption keys. In some examples, the key generation service 414 may store one or more encryption keys at its own location. For example, the key generation service 414 may use a secure storage device (or one or more other components of a secure element) to store one or more encryption keys. In some examples, the key generation service 414 may receive a second command to generate an encryption key for an application associated with device 400. In some such examples, in response to the second command, the key generation service 414 may output at least a portion of one of the stored encryption keys. For example, the encryption key may include an RSA key pair, and in response to the second command, the key generation service may output the public key of one of the RSA key pairs.

[0101] Device 400 may be implemented in hardware, software, or a combination of hardware and software. In various embodiments, device 400 or portions thereof may be embodied in an integrated circuit, a microcontroller unit (MCU) (e.g., a virtual machine running in an MCU), and / or the like. It should be readily understood that embodiments of the systems, apparatuses, and methods described herein may be configured in various additional and alternative ways in addition to the manner expressly described herein. in conclusion

[0102] The operations and / or functions of this disclosure have been described herein (such as in flowcharts). As will be understood, computer program instructions may be loaded onto a computer or other programmable device (e.g., hardware) to produce a machine, such that the resulting computer or other programmable device performs the operations and / or functions described in the flowchart blocks herein. These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer, processor, or other programmable device to operate and / or run in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture, the execution of which implements the operations and / or functions described in the flowchart blocks. Computer program instructions may also be loaded onto a computer, processor, or other programmable device to perform a series of operations on the computer, processor, or other programmable device to produce a computer-implemented process, such that the instructions executing on the computer, processor, or other programmable device provide operations for performing the functions and / or operations specified in the flowchart blocks. Flowchart blocks support combinations of components for performing specified operations and / or functions, as well as combinations of operations and / or functions for performing specified operations and / or functions. It should be understood that one or more blocks in a flowchart, as well as combinations of blocks in a flowchart, can be implemented by a dedicated hardware-based computer system or a combination of dedicated hardware and computer instructions that performs the specified operations and / or functions.

[0103] While this specification contains details of numerous specific embodiments and implementations, these should not be construed as limiting the scope of any disclosure or potentially claimed content, but rather as descriptions of features of specific embodiments of a particular disclosure. Certain features described herein in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments. Furthermore, although features may be described above as acting in certain combinations and even initially claimed in this manner, in some cases, one or more features from a combination of claims may be removed from the combination, and a combination of claims may refer to a sub-combination or a variation of a sub-combination.

[0104] Although the operations and / or functions are illustrated in a specific order in the figures, this should not be construed as requiring that such operations and / or functions be performed in the specific order or sequence shown, or requiring that all illustrated operations be performed to achieve the desired result. In some cases, it may be advantageous to perform the operations and / or functions in an alternative order. In some cases, the actions listed in the claims may be performed in a different order and still achieve the desired result. Therefore, while specific embodiments of the subject matter have been described, other embodiments are also within the scope of the following claims.

[0105] While some embodiments of this disclosure have been set forth in this specification, the appended claims cover other embodiments of this disclosure that differ from the described embodiments based on various modifications and improvements.

[0106] In the appended claims, unless the specific terms “component for…” or “step for…” are used within the given claims, they are not intended to be interpreted under 35 U.S.C., 112, paragraph 6.

Claims

1. A method comprising: Obtain one or more commands at the encryption key generation service in the secure element of the device to generate and store one or more encryption keys in the encryption key generation service; In response to the first or more commands: The one or more encryption keys are generated at the encryption key generation service; as well as The one or more encryption keys are stored at the encryption key generation service; A second command is obtained from the encryption key generation service to generate an encryption key for an application associated with the device; as well as In response to the second command, at least a portion of one of the one or more encryption keys stored in the encryption key generation service is output.

2. The method of claim 1, wherein obtaining the first one or more commands comprises: The first or one command is obtained based on the scheduled task.

3. The method of claim 2, wherein obtaining the first one or more commands according to the scheduling task comprises: The first one or more commands are obtained over a fixed duration.

4. The method according to claim 1, further comprising: In response to outputting a portion of the one or more encryption keys, a flag is applied to the one or more encryption keys, wherein the flag indicates a state associated with the one or more encryption keys.

5. The method of claim 4, wherein the state indicates that one of the one or more encryption keys is not available for use with one or more other applications associated with the device.

6. The method according to claim 1, further comprising: In response to storing the one or more encryption keys, a counter is incremented, wherein the count of the counter is based at least in part on the number of encryption keys included in the one or more encryption keys.

7. The method of claim 6, further comprising: Obtain a third command from the encryption key generation service to generate and store another encryption key in the encryption key generation service; as well as In response to the third command, a message including an error code is output, at least in part based on the counter's count meeting a threshold.

8. The method according to claim 7, further comprising: In response to outputting a portion of one of the one or more encryption keys, the counter is decremented.

9. The method of claim 1, wherein obtaining at least one of the first one or more commands is based at least in part on a performance level of at least one application associated with the device not meeting a threshold.

10. The method of claim 1, wherein the security element comprises an embedded security element eSE or an integrated security element iSE.

11. The method of claim 1, wherein the one of the one or more encryption keys comprises an encryption key pair, the encryption key pair comprising a public key and a private key, and wherein the portion of the one of the one or more encryption keys comprises the public key.

12. The method of claim 1, wherein the one or more encryption keys comprise one or more Rivest-Shamir-Adleman RSA key pairs.

13. The method of claim 1, wherein the encryption key generation service is KeyMint.

14. A method comprising: Output one or more commands to an encryption key generation service in the secure element of the device to generate and store one or more encryption keys in the encryption key generation service; Output a second command to the encryption key generation service to generate an encryption key for an application associated with the device; as well as In response to the second command, at least a portion of one of the one or more encryption keys is obtained from the encryption key generation service.

15. The method of claim 14, wherein outputting the first one or more commands comprises: Output the first or more commands according to the scheduled task.

16. The method of claim 15, wherein outputting the first one or more commands according to the scheduled task comprises: Output the first one or more commands for a fixed duration.

17. The method of claim 14, further comprising: Output a third command to the encryption key generation service to generate and store another encryption key in the encryption key generation service; In response to the third command, a message including an error code is obtained; as well as In response to the error code, suppress the output of other commands used to generate and store other encryption keys at the encryption key generation service.

18. The method of claim 14, wherein the output of at least one of the first one or more commands is based at least in part on a performance level of at least one application associated with the device not meeting a threshold.

19. The method of claim 14, wherein the one of the one or more encryption keys comprises an encryption key pair, the encryption key pair comprising a public key and a private key, and wherein the portion of the one of the one or more encryption keys comprises the public key.

20. A system comprising: An encryption key generation service in a secure element, wherein the encryption key generation service is configured to: Obtain one or more commands to generate and store one or more encryption keys in the encryption key generation service; In response to the first or more commands, generate and store the one or more encryption keys; Obtain a second command to generate an encryption key for applications associated with the system; as well as In response to the second command, at least a portion of one of the one or more encryption keys is output.