System and method for managing cryptographic keys
By generating consecutive HMAC keys with overlapping active periods and pre-creating hashes, the system addresses inefficiencies in key rolling transitions, reducing storage and processing needs while maintaining data retention compliance.
Patent Information
- Application Number
- GB2025006394
- Authority / Receiving Office
- GB · GB
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2026-11-25
AI Technical Summary
Current mechanisms for managing HMAC keys in the storage of payment account data face inefficiencies due to disparate valid lifetimes of encryption and HMAC keys, leading to increased storage and processing requirements, and incompatibilities during key rolling transitions.
A system and method that generates two consecutive HMAC keys with overlapping active periods, allowing seamless transitions by pre-creating hashes using the new key before the old key expires, reducing the need for decryption and maintaining encrypted versions of user account information.
This approach minimizes storage and processing resources, streamlines key rolling processes, and ensures compliance with data retention policies by integrating purging checks within existing workflows, thus enhancing system efficiency and security.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
TECHNICAL FIELD The present disclosure relates to a computer-implemented system and method for management of cryptographic keys. In particular, the present disclosure relates to the generation, rolling and use of HMAC keys, especially in relation to storage of payment account information. BACKGROUND For entities that assist in processing authentication of payment transactions, there is a need to store information relating to users that carry out those payment transactions, for example user payment account data. Due to the sensitive nature of this payment account data, current mechanisms involved in its storage typically involve data encryption, which in turn requires generation and management of the encryption keys that are used to encrypt the data. A specific method of searchable sensitive data storage has been developed that makes use of HMAC (Hash-based Message Authentication Code) techniques: sensitive data is hashed using a cryptographic hash function and an HMAC key, and the resulting hashed data is then stored. The hashed stored data can be retrieved based on a ‘look-up’ query, which contains in plaintext the data that is required to be retrieved and can be used in combination with the corresponding HMAC key to identify and retrieve the stored hash. Specifically, a ‘look-up’ hash is generated by applying the corresponding HMAC key to the plaintext data in the look-up query, and a search for matching stored hashed data can be performed. As with any cryptographic key, HMAC keys require periodic rolling (refreshing) to maintain the security of the hashed data. As such, there is a need to be able to handle the periodic rolling of HMAC keys in an optimised manner. In some cases, it is envisaged that HMAC key rolling transitions can be managed via encryption and storage of the payment account data, using a different set of encryption keys. Upon expiry of an HMAC key, the encrypted payment account data will be decrypted, for use in generating a new ‘look-up’ hash; additionally, the decrypted payment account data will also be hashed using the new HMAC key, before being reencrypted. Maintaining encrypted counterparts of all hashed data values has implications for system performances. Additionally, encryption keys and HMAC keys tend to have disparate valid lifetimes. The present disclosure has been devised to mitigate or overcome at least some of the above-mentioned problems. SUMMARY OF THE DISCLOSURE According to a first aspect of the present disclosure, there is provided a system for managing cryptographic HMAC keys. Each HMAC key has an associated active lifetime between an effective start date and a logical expiry date. The system comprises: a database configured to store a first HMAC key, and at least one first hash generated by hashing a set of user account information using the first HMAC key; and a processor programmed with instructions that when executed cause the processor to perform certain functionality. The processor is configured to generate, during the active lifetime of the first HMAC key, a second HMAC key having an effective start date that corresponds to the logical expiry date of the first HMAC key, and store the second HMAC key in the database; and retrieve, from the database using the first HMAC key, and based on a look-up query comprising the set of user account information, the corresponding at least one first hash for provision to a remote third party for authentication purposes. The processor is also configured to determine if the database comprises a second hash generated by hashing the set of user account information corresponding to the first hash using the second HMAC key. In dependence on there being no second hash, the processor is also configured to generate the second hash by hashing the set of user account information in the look-up query using the second HMAC key; and store the second hash in the database. The above-described system beneficially allows for two HMAC keys to be generated that have active periods which are immediately consecutive to one another. As set out above, during the active lifetime of a given HMAC key, that key is used for retrieval of the corresponding hashed value. This allows for a seamless transition when rolling between the first and second HMAC keys. In other words, when the first HMAC key is in its active period, the first HMAC key is used for retrieval of the first hashed value. When the first HMAC key has reached its logical expiry date, that first HMAC key is no longer in its active period. Instead, the second HMAC key will be in its active lifetime. Moreover, by implementing the above functionality, it is possible for the second HMAC key to have already been used to create corresponding hash values during the course of the first HMAC key’s active period. The second HMAC key can therefore be immediately used for retrieval of the corresponding second hashed value upon expiry of the first key without additional processing being required. The above-described system therefore obviates the need for maintaining an encrypted version of the user account information - for decryption and use after the first key has expired in creating the second hashed value based on a received look-up query -because the second hashed value has already been created prior to expiry of the first HMAC key. Not only does this reduce the storage and processing resources that are associated with the HMAC key rolling process, but it also addresses issues with incompatibility between the relatively short encryption key periods and the relatively longer HMAC key periods. Optionally, after the logical key expiry date of the first HMAC key, and in response to a subsequent look-up query comprising the set of user account information, the instructions may further cause the processor to use the second HMAC key to retrieve the second hash corresponding to the set of user account information. In some instances, the second hash has not been created prior to the second HMAC key entering its active lifetime, since a look-up query forthat data may not have been generated during the overlapping cryptographic periods of the two keys. As such, the above-described process will result in the processor not being able to retrieve the second hash. In this case, instead of retrieving the second hash, the instructions can cause the processor to generate the second hash of the set of user account information using the second HMAC key. It is noted in this instance that if a look-up query for that data has not been performed prior to the second HMAC key becoming effective, this would mean that no look-up has been performed within the retention period. As such, the data would have been deemed inactive and purged as part of a separate data retention job. Each HMAC key may have an associated data retention period (i.e., a data retention period associated with the data that has been hashed using the HMAC key). This data retention period runs from after the corresponding logical expiry date, and is a time period during which hashed values generated using the HMAC key need to be retained by the database. Optionally, the processor may be configured to generate the second HMAC key when a time remaining of the active lifetime of the first HMAC key equals the data retention period associated with or used by the first HMAC key. In other words, the second HMAC key is created at a point in time equal to the logical expiry date of the first HMAC key minus the data retention period associated with the data hashed using the first HMAC key. As a result, there is a clear temporal separation between the second HMAC key being generated, and the point in time where the first HMAC key reaches its logical expiry date (which is also the point in time where the second HMAC key will become effective I active). This allows for a substantial period of time during which the second HMAC key can be used to build up a database of second hashes which will be used to replace the first hashes for look-up query response purposes. HMAC keys have a data retention period that is set by the relevant standards relating to the retention of user information. For example, a typical HMAC key will exist for 10 years and the corresponding data retention period will be set to be around 13 months - i.e., a not-insignificant proportion of the overall active lifetime of the HMAC key - and hence an appropriate time period to use for triggering the creation and use of a new HMAC key. Advantageously, during the data retention period when the first HMAC key is still effective, a look-up will automatically trigger the generation of the second hash (if it has not already been created) without requiring a separate hashing operation to be carried out. Optionally, during the data retention period of the first HMAC key and in response to a further look-up query comprising the set of user account information, the instructions further cause the processor to determine if the first hash corresponding to the set of user account information is stored in the database, and if so, flag the first hash for record purging purposes. The data retention period discussed previously can therefore be used as a condition that will trigger the purging (deletion) of those hashed values which were generated by an HMAC key that is no longer active I valid. If not look-ups are performed during the data retention period ‘window, the first hash will be flagged for purging. Moreover, the fact that this condition is checked in response to a look-up query, means that the record purging I deletion check is performed as part of an existing process flow that is already being implemented. As such, the processing workflow for overall database maintenance is streamlined. There is no need for any additional checks, criteria or triggers to be set up, outside of the existing workflows, for this purging process. Considered another way, the data retention period allows the look-up process to cause the clearing of the (first) hashes created using an ‘old’ (first) key, if they still exist before the end of the ‘old’ key’s cryptographic period. No separate house-keeping job for this is required, but the entire system still remains compliant with data regulation (and retention) policies. Optionally, the database is also configured to store a list of records for purging; and the instructions cause the processor to flag the first hash for record purging processes by adding the first hash to the list of records. The instructions may then cause the processor to sequentially process the list of records to purge the first hash(es) that are listed therein. It is beneficial to handle the record purging and database consolidation process in this manner by identifying the data that needs to be purged as part of an existing workflow but then making the actual purging step part of a different (parallel) asynchronous workflow. Separating the key management and account look-up processes from the record purging process improves efficiency of both processes, whilst nevertheless ensuring that the old records are cleaned up in a timely manner. The list of records may correspond to a queue that is sequentially worked through, by the processor - purging records in the sequence in which they are added to the list. According to another aspect of the disclosure, there is provided a computer-implemented method for managing cryptographic HMAC keys, each HMAC key having an associated active lifetime between an effective start date and a logical expiry date. The method comprises: storing, in a database, a first HMAC key, and at least one first hash generated by hashing a set of user account information using the first HMAC key. The method further comprises generating, during the active lifetime of the first HMAC key, a second HMAC key having an effective start date that corresponds to the logical expiry date of the first HMAC key, and storing the second HMAC key in the database; and retrieving, from the database using the first HMAC key, and based on a look-up query comprising the set of user account information, the corresponding at least one first hash for provision to a remote third party for authentication purposes. The method further comprises determining if the database comprises a second hash generated by hashing the set of user account information corresponding to the first hash using the second HMAC key; generating, in dependence on there being no second hash, the second hash by hashing the set of user account information in the look-up query using the second HMAC key; and storing, in the database, the second hash. Corresponding advantages and additional features that were described above in relation to the system are also equally applicable to the method. For example, after the logical key expiry date of the first HMAC key, and in response to a subsequent look-up query comprising the set of user account information, the method further may comprise using the second HMAC key to retrieve the second hash corresponding to the set of user account information. Optionally, each HMAC key may have an associated data retention period (i.e., a data retention period associated with the data that has been hashed using the HMAC key). This data retention period runs from after the corresponding logical expiry date, and corresponds to a time period during which hashed values generated using the HMAC key need to be retained by the database. In some instances, the method may further comprises generating the second HMAC key when a time remaining of the active lifetime of the first HMAC key equals the data retention period of the first HMAC key. Optionally, during the data retention period of the first HMAC key and in response to a further look-up query comprising the set of user account information, the method further comprises: determining if the first hash corresponding to the set of user account information is stored in the database, and if so, flagging the first hash for record purging purposes. Optionally, the database is configured to store a list of records for purging; and flagging the first hash for record purging processes comprises adding the first hash to the list of records. Optionally, the user account information may correspond to one or more pieces of user payment account information, for a user involved in a payment transaction. In such transaction-related implementations, the remote third party may correspond to an entity involved in a payment transaction that is attempting to authenticate the user’s payment account information in order to authenticate or approve the transaction. According to a further aspect of the present disclosure, there is provided a computer program product comprising instructions which, when the program is executed by a computer, cause the computer to carry out the method as described above. Within the scope of this application, it is expressly intended that the various aspects, embodiments, examples and alternatives set out in the preceding paragraphs, in the claims and / or in the following description and drawings, and in particular the individual features thereof, may be taken independently or in any combination. That is, all embodiments and / or features of any embodiment can be combined in any way and / or combination, unless such features are incompatible. The applicant reserves the right to change any originally filed claim or file any new claim accordingly, including the right to amend any originally filed claim to depend from and / or incorporate any feature of any other claim although not originally claimed in that manner. BRIEF DESCRIPTION OF THE DRAWINGS One or more embodiments of the disclosure will now be described, by way of example only, with reference to the accompanying drawings, in which: Figure 1 is a schematic diagram showing a computing architecture for managing cryptographic HMAC keys according to aspects of the present disclosure; and Figure 2 illustrates a process for generating, maintaining and managing HMAC keys using the system of Figure 1; Figure 3 illustrates a process for using HMAC keys in relation to the system of Figure 1; and Figure 4 shows examples of entries in a database that may be used in relation to the processes of Figures 2 and 3. DETAILED DESCRIPTION A general computing architecture of a system 10 for implementing aspects of the present disclosure will now be described with reference to Figure 1. A specific example in relation to cryptographic key management for the handling of payment transaction related data will be used to illustrate the implementation and benefits of the system 10. It should be appreciated though that the applications of this system extend beyond the field of payment transactions and can be used in a variety of implementations where the use of cryptographic (HMAC) keys in relation to protecting stored sensitive data needs to be managed. The system 10 comprises at least one processor 105 and at least one database 110 in operative communication with one another. The processor 105 is programmed with instructions that when executed cause the processor 105 to implement functionality in relation to cryptographic HMAC key management and use. The database 110 is configured to store cryptographic HMAC keys 115A, 115B, 115C as well as a plurality of hashed data entries 120a, 120b (hereafter simply referred to as hashes). Each hash 120a, 120b is generated by the system 10 based on the application of a cryptographic hashing process, and using one of the stored HMAC keys 115A, 115B, 115C, in relation to a set of (sensitive) user account information. In the example implementation related to payment transactions, this user account information would include sensitive data relating to a user’s payment account that can be used during a payment transaction authentication or authorisation process (e.g., payment account numbers, payment card numbers, user identifying contact information such as email addresses or phone numbers). The hash(es) corresponding to a given set of user account information is / are stored in the database 110 as part of a database entry 122. Each entry has an associated entry identifier 124 that can be used to identify and retrieve the appropriate hash 120a, 120b. The system 10 also comprises a communication interface 125 that can be used for communication of data between the processor 105 and one or more remote third-party systems or servers 130a, 130b, 130c. The data communicated in this manner to the system 10 would include requests, by those third parties, for retrieval of the hashed stored user account information for subsequent use during authentication or authorisation processes. In the example implementation related to payment transactions, the third-party servers 130a, 130b, 130c may correspond to merchant entities or Payment Service Providers (PSPs) that are attempting to authenticate or authorise user payment information in relation to a requested payment transaction, typically carried out in relation to an e-commerce or mobile application transaction. The incoming requests are parsed by the processor 105 to extract relevant information that would allow the processor 105 to identify the appropriate entry 122 in the database 110 from which to retrieve the correct hash 120a, 120b. The processor 105 would generate a look-up query to search the database 110 and retrieve the appropriate hash 120a, 120b. This look-up query would comprise the associated entry identifier 124, as well as an indication of the HMAC key 115A, 115B, 115C that was used to generate the hash 120a, 120b. A mechanism for managing the periodic rolling of HMAC keys will now be described with reference to Figure 2. This mechanism comprises a cyclical workflow 20 that is implemented by the processor 105 and database 110 of the system 10. The illustrated workflow 20 begins with step 205 in which a first HMAC key 115A (also referred to in the figure as ‘Key A’), which has been generated in a prior key generation process and stored in the database 110, begins its active lifetime. Prior to this step, the first HMAC key 115A will have been used by the processor 105 to generate a plurality of first hashes 120a of various sets of user account information. These first hashes 120a are stored in the database 110 in the appropriate database entry 122. The HMAC key active lifetime is the period of time during which the HMAC key is valid (or effective), and is typically defined to be the period during which the HMAC key is used for both hashing and retrieval of the user account information. The active lifetime of the HMAC key runs from an ‘effective start date’ to a ‘logical expiry date’. Additionally, each HMAC key also has a ‘cryptographic period’ associated with it, which begins when the HMAC key is first generated and comprises the active lifetime of the key. A ‘data retention’ period is also defined in relation to the stored (hashed) user account information, and specifies the maximum length of time that the user account information can be deemed ‘active’ in the absence of any outright activity. If no look-up query is generated in relation to the user account information within the data retention period, it must be purged. As such, the data retention period can also be used to define a time period in relation to use of the HMAC key, following the logical expiry date of the HMAC key, during which the HMAC key is no longer used for active hashing of user account data, but can be used for retrieval of data that has been previously hashed using that key. The cryptographic period, active lifetime and data retention periods are all defined by the appropriate technical standards for cryptographic key management and user data management and retention. In the example shown in Figure 2, the cryptographic period of the HMAC keys is defined to be 10 years, and the data retention period is defined to be 13 months; this leaves a remaining maximum 94-month period to serve as the active lifetime of the HMAC keys. The workflow 20 continues at step 210 with the generation of a second HMAC key 115B (also referred to in the figure as ‘Key B’) during the active lifetime of the first HMAC key 115A. This second HMAC key 115B is stored in the database 110, but is currently not effective and its active lifetime has not yet begun. As such, any look-up queries that are generated for search and retrieval of hashed data will be based on the current ‘active (effective) key - i.e., the first key 115A - and will retrieve the first hash 120a. Nevertheless, the workflow comprises a further step 215 implemented in relation to the second HMAC key 115B, which is triggered in response to a look-up query being generated in relation to the first hash 120a based on the first HMAC key 115A. Specifically, in this step 215, the processor 205 is configured to also generate a (second) hash 120b of the retrieved user account information using the second HMAC key 115B. This second hash 120b is also stored in the database 110, as part of the corresponding database entry 122 which includes the first hash 120a and the entry identifier 124 associated with the same set of user account information. It will be appreciated from the above descriptions that multiple HMAC keys may co-exist within the system 10, and have overlapping cryptographic periods. Regardless of how many HMAC keys have been generated though, only one HMAC key will ever be effective or active at any given time - i.e., only one HMAC key will be used for both hashing and retrieval of data in response to a look-up query at any given time. However, by allowing multiple keys to co-exist, in combination with using the non-effective second HMAC key 115B to generate a corresponding hash of the user account information that has already been hashed by the first HMAC key 115A, a bank of second hashes 120b can be built up for immediate use with the second HMAC key 115B as soon as the first HMAC key 115 reaches its logical expiry date. This results in a much more seamless transition when rolling from one HMAC key to another. It also means that there is no need to maintain a separate encrypted version of the user account information for generation of the second hash 120b during key rolling, since the decrypted (plaintext) data can be naturally accessed by the processor 105 and used to generate the second hash 120b as part of the retrieval process of the first hash 120a. In the example implementation shown in Figure 2, the second HMAC key 115B is generated a period in time, prior to the logical expiry date of the first HMAC key 115A, which corresponds to the data retention period of the data that has been hashed using the first HMAC key 115A. The data retention period is a well-defined property (set by associated standards) of the stored user account information, and hence provides a useful mechanism to trigger generation of the second HMAC key 115B. Additionally, the data retention period will be sufficiently long that it will result in a substantial bank of second hashes 120b being generated prior to key rolling needing to take place. The workflow 20 proceeds at step 220 with the ‘rolling’ from the first HMAC key 115A to the second HMAC key 115B. In this step, the first HMAC key 115A reaches its logical expiry date and enters the data retention period of the data that has been hashed with that key. Simultaneously, this point in time corresponds to the effective start date of the second HMAC key 115B, which enters its active lifetime. As such, the first HMAC key 115A is effectively retired from ‘active’ service in relation to hashing new sets of user account information, and in relation to actively retrieving hashes in response to a lookup query. This role is now passed to the second HMAC key 115B. As such, any newly received sets of user account information that require hashing are processed using the second HMAC key 115B, and these second hashes 120b are stored in the appropriate entry 122 in the database 110. This step covers the process followed during the remainder of the active lifetime of the second HMAC key 115B. Thereafter, the workflow 20 proceeds with a new sequence of steps that mirror steps 210 to 220, but in relation to a further (new) HMAC key, which is different from the first and the second keys. For ease of reference, this key is referred to as Key A in the figures; however, it should be understood that this key will not correspond to the same first HMAC key 115A that was referenced in relation to the preceding steps 205 to 220. To avoid confusion with the first HMAC key 115A, this new key will be referred to hereafter as a third HMAC key 115C. The first step 225 in this new sequence of steps corresponds to the generation, during the active lifetime of the second HMAC key 115B, of the third HMAC key 115C. As discussed in relation to step 210, this third HMAC key 115C is stored in the database 110, but is currently not effective and its active lifetime has not yet begun. As such, any look-up queries that are generated for search and retrieval of hashed data will be based on the current ‘active (effective) key - i.e., the second HMAC key 115B-and will retrieve the corresponding second hash 120b. The next step 230 in this sequence corresponds to the generation, using the third HMAC key 115C, of a (third) hash of the user account information that has been retrieved in response to a look-up query. This third hash will also be stored in the database 110, as part of the 122 entry which includes the second hash 120b and the entry identifier 124; this is not shown in Figure 1 for clarity purposes. The workflow 20 then proceeds at step 235 with the ‘rolling’ from the second HMAC key 115B to the third HMAC key 115C. This time, it is the second HMAC key 115B that reaches its logical expiry date and enters the data retention period of the associated hashed user account information; whilst simultaneously, this point in time corresponds to the effective start date of the third HMAC key 115C, which enters its active lifetime. The second HMAC key 115B is therefore retired from ‘active’ service and replaced by the third HMAC key 115C, in the manner described above in relation to step 220. This step 235 covers the processes following during the remainder of the active lifetime of the third HMAC key 115C. Thereafter, as shown in Figure 2, a new sequence of steps can be carried out in relation to a further new HMAC key; and this process can be carried out in a cyclical manner as required to sequentially and periodically roll between HMAC keys. A description of a mechanism for using the HMAC keys and the hashed data for user account information look-up will now be described with reference to Figure 3. This mechanism comprises a cyclical workflow 30 that is also implemented by the processor 105 and database 110 of the system 10. The workflow 30 begins in step 305 during the active lifetime of the first HMAC key 115A, and prior to the generation of the second HMAC key 115B. In this step, a look-up query for retrieval of a certain set of user account information is generated or received by the processor 105, and search of the database 110 for the corresponding first hash 120a is carried out using the first HMAC key 115A. The workflow 30 then proceeds with step 310 once the second HMAC key 115B has been generated, but whilst the first HMAC key 115A is still within its active lifetime. In this step, look-up queries requesting sets of user account information will still be carried out using the first HMAC key 115A (and no search will be carried out using the second HMAC key 115B). However, as noted in relation to Figure 2, the processing associated with step 215 of workflow 20 is triggered at this point such that, if a second hash does not already exist, the second hash 120b of the requested user account information is also generated using the second HMAC key 115B. Thereafter, the workflow 30 proceeds to implementing the processing in step 315 from the logical expiry date of the first HMAC key 115A (which also corresponds to the effective start date of the second HMAC key 115B), and over the active lifetime of the second HMAC key 115B. In step 315, any look-up queries that are generated or received by the processor 105 will result in a search of the database 110 for the corresponding second hash 120b and using the second HMAC key 115B. It is appreciated though that the second hash 120b may not yet have been created in some instances, since this second hash 120b will only be created prior to the effective start date of the second HMAC key 115B if a look-up query for the corresponding user account data was received during the cryptographic period of the second HMAC key 115B prior to its effective start date. If no second hash is found in association with the requested user account information, step 315 also involves the generation and storage of a second hash using the second HMAC key 115B. Thereafter, the user account information that had been hashed using the first HMAC key 115A, which would correspond to the requested information matching the plaintext data contained in the look-up query, would be transmitted by the processor 105 to the original requestor which triggered generation of the look-up query (e.g., one or more of the third-party servers 130a, 130b, 130c). Additionally, the workflow 30 also includes step 320 that is implemented during the time period after the logical expiry date of the first HMAC key 115A and until the end of the data retention period for the corresponding user account information. In step 320 and in relation to processing a look-up query based on the second HMAC key 115B, the processor 105 is also arranged to check if the corresponding first hash 120a is still maintained in the database entry 122 associated with the respective set of user account information. If the first hash 120a is found to still be present, the processor 105 is further arranged to flag this first hash 120a for removal or deletion - i.e., perform a purge of the record. In some implementations, flagging the first hash 120a in this manner involves adding an entry relating to this first hash into a separate ‘record purging’ queue or list 150 maintained by the database 110. This list is then sequentially processed (by the processor 105, or another processing component associated with the system 10): for each entry in the ‘record purging’ list, the corresponding entry in the database 110 is amended to remove the first hash 120a. In more detail, checking if the corresponding first hash 120a is still maintained in the database entry 122 may involve checking if the first hash 120a is ‘null’; adding an entry into a separate ‘record purging’ queue or list 150 may involve adding an event to set the first hash 120a to ‘null’; and thereafter removing the first hash 120a may involve setting the first hash 120a to ‘null’. By implementing step 320 as part of the ongoing HMAC key usage workflow 30, the system 10 can make use of a look-up query as a trigger event for the processor 105 to check if the corresponding database entry 122 needs to be flagged for ‘cleaning up’. No additional workflow needs to be programmed or run, and no additional lists need to be created, in relation to when and how to perform this flagging task. As such, a simpler more efficient mechanism for ongoing database maintenance is achieved. Moreover, step 320 only involves the flagging of database entries for subsequent clean-up. The actual record purging process is carried out using a separate list 150 that is maintained and processed in parallel (albeit asynchronously). This means there is minimal disruption caused to the speed and efficiency with which the main look-up process can be carried out. There is hence also minimal disruption experienced by the third-parties 130a, 130b, 130c in their requests for (and receipt of) the user account information. Thereafter, the workflow 30 proceeds with a new sequence of steps 325 to 335 that mirror steps 305 to 320 respectively, but implemented in relation to the second HMAC key 115B and the third (new) HMAC key 115C. As with Figure 2, for ease of reference, this third key is referred to as Key A in the figures, but it should be understood that it is not the same as the first HMAC key 115A that was also previously referenced as Key A. In step 325 (which mirrors step 310 described above, but occurs instead over a portion of the active lifetime of the second HMAC key 115B), both the second and third HMAC keys 115B, 115C have been generated but only the second HMAC key 115B is active for data hashing and retrieval of hashed data. Look-up queries requesting sets of user account information are processed using the second HMAC key 115B; and where applicable, the processing associated with step 215 of workflow 20 is triggered at this point such that a third hash of the requested user account information is generated using the third HMAC key 115B, if that third hash does not already exist. In step 330 (which mirrors step 315 described above, but occurs instead starting from the effective start date of the third HMAC key 115C and over its active lifetime), any lookup queries that are generated or received will result in a search of the database 110 for the corresponding third hash and will use the third HMAC key 115C. Similarly, if a third hash is found not to exist when processing the look-up query for the corresponding set of user account information, this step 330 also involves the generation and storage of the third hash. Thereafter, in step 335 (which mirrors step 320 described above, but takes place during the data retention period of the second HMAC key 115B), the processor 105 is arranged to check for, and flag for removal, the presence of the second hash 120b in association with the user account information submitted as part of look-up queries processed during this time period. Subsequently, as shown in Figure 3, a new sequence of steps can be carried out in relation to a further new HMAC key; and this process can be carried out in a cyclical manner as required to accommodate the rolling of new HMAC keys. An illustrative example of how the information discussed in relation to the workflows 20, 30 may be recorded in the database 110 is shown in Figure 4. At the top of Figure 4, an example entry 40 in the database 110 is shown in the context of payment transactions where the user account information corresponds to details of a user’s payment account. This entry 40 corresponds to the database entry 122 mentioned previously in relation to Figure 1. The example entry 40 includes an entry identifier (Account ID) 402; additional information about the payment account 404 (Account Reference Type); as well as a first hash 406 (Account Hash A) generated using the first HMAC key 115A, and a second hash 408 (Account Hash B) generated using the second HMAC key 115B. As will be appreciated, this example entry 40 would be observed in a snapshot of the database 110 taken at a point in time after the second HMAC key 115B has been generated, but prior to purging of the hash generated using the first HMAC key 115A. In the middle of Figure 4, an example record 45 of the data retention period is maintained - this period is defined by technical standards in relation to user account information retention, and will be the same for all of the HMAC keys generated and processed by the system 10. An identifier 451 is maintained in association with the defined data retention period. This identifier 451 is used to set the retention period for the stored data, and can be used by the processor 105 to identify the appropriate points in time to generate new HMAC keys. Should the defined retention period change, then a new record (not shown) would be added having a new identifier 450. The altered time period would be reflected in the ‘Retention Period (RP)’ column 452. The example record 45 would then have the ‘To’ column 453 populated with the date on which the retention period had been changed. Finally, at the bottom of Figure 4, a set 50 of three example entries are maintained in the database in relation to each of the HMAC keys 115A, 115B, 115C discussed above. Each example entry 50 includes a key identifier 502 (Key ID) and a Key Alias 504. Information defining the cryptographic period of the corresponding HMAC key is also stored, including but not limited to: a start date 506 (i.e., the date of generation of the HMAC key, which marks the beginning of its cryptographic period); the effective start date 508 (i.e., the date when the HMAC key is considered to enter its active lifetime); the logical expiry date 510; and a final expiry date 512 (i.e., the end of the data retention period, and also the end of the cryptographic period for that HMAC key). A designation 514 for the HMAC key is also included in the example entry 50 to allow for ease of identification of the key during subsequent processing. Alternative implementations and variations of the above concepts are envisaged. Importantly, it is noted that implementation in the context of payment transactions is merely one specific example use case; but the above-described system and method could equally be applicable in relation to any other implementations whereby sensitive user information is stored (and looked up) using HMAC key hashing techniques. For example, the storage of user login (password) information is typically managed using HMAC key hashing techniques. Corresponding user login information would be received from a third-party attempting to verify the user’s login, and the received information would be included as plaintext in a look-up query; the plaintext information would then be hashed and used to identify a corresponding stored hashed value. As such, the above-described system and method are applicable across a wide range of technical fields and implementations, and can include a variety of physical and online security and / or access control use cases.
Claims
1. A system for managing cryptographic HMAC keys, each HMAC key having an associated active lifetime between an effective start date and a logical expiry date, the system comprising:a database configured to store a first HMAC key, and at least one first hash generated by hashing a set of user account information using the first HMAC key; and a processor programmed with instructions that when executed cause the processor to perform the following functionality:generate, during the active lifetime of the first HMAC key, a second HMAC key having an effective start date that corresponds to the logical expiry date of the first HMAC key, and store the second HMAC key in the database;retrieve, from the database using the first HMAC key, and based on a look-up query comprising the set of user account information, the corresponding at least one first hash for provision to a remote third party for authentication purposes;determine if the database comprises a second hash generated by hashing the set of user account information corresponding to the first hash using the second HMAC key;in dependence on there being no second hash, generate the second hash by hashing the set of user account information in the look-up query using the second HMAC key; andstore the second hash in the database.
2. The system of claim 1, wherein after the logical key expiry date of the first HMAC key, and in response to a subsequent look-up query comprising the set of user account information, the instructions further cause the processor to use the second HMAC key to retrieve the second hash corresponding to the set of user account information.
3. The system of claim 1 or claim 2, wherein:each HMAC key has an associated data retention period, after the corresponding logical expiry date, during which hashed values generated using the HMAC key need to be retained by the database; andthe instructions further cause the processor to generate the second HMAC key when a time remaining of the active lifetime of the first HMAC key equals the data retention period of the first HMAC key.
4. The system of claim 3, wherein during the data retention period of the first HMAC key and in response to a further look-up query comprising the set of user account information, the instructions further cause the processor to:determine if the first hash corresponding to the set of user account information is stored in the database, and if so, flag the first hash for record purging purposes.
5. The system of claim 4, wherein:the database is configured to store a list of records for purging; andthe instructions cause the processor to flag the first hash for record purging processes by adding the first hash to the list of records.
6. The system of any preceding claim, wherein:the user account information corresponds to one or more pieces of user payment account information associated with a user involved in a payment transaction; andthe remote third party corresponds to an entity involved in the payment transaction that is attempting to authenticate the user’s payment account information in order to authenticate or approve the transaction.
7. A computer-implemented method for managing cryptographic HMAC keys, each HMAC key having an associated active lifetime between an effective start date and a logical expiry date, the method comprising:storing, in a database, a first HMAC key, and at least one first hash generated by hashing a set of user account information using the first HMAC key;generating, during the active lifetime of the first HMAC key, a second HMAC key having an effective start date that corresponds to the logical expiry date of the first HMAC key, and storing the second HMAC key in the database;retrieving, from the database using the first HMAC key, and based on a look-up query comprising the set of user account information, the corresponding at least one first hash for provision to a remote third party for authentication purposes;determining if the database comprises a second hash generated by hashing the set of user account information corresponding to the first hash using the second HMAC key;generating, in dependence on there being no second hash, the second hash by hashing the set of user account information in the look-up query using the second HMAC key; andstoring, in the database, the second hash.
8. The method of claim 7, wherein after the logical key expiry date of the first HMAC key, and in response to a subsequent look-up query comprising the set of user account information, the method further comprises using the second HMAC key to retrieve the second hash corresponding to the set of user account information.
9. The method of claim 7 or claim 8, wherein:each HMAC key has an associated data retention period, after the corresponding logical expiry date, during which hashed values generated using the HMAC key need to be retained by the database; andthe method further comprises generating the second HMAC key when a time remaining of the active lifetime of the first HMAC key equals the data retention period of the first HMAC key.
10. The method of claim 9, wherein during the data retention period of the first HMAC key and in response to a further look-up query comprising the set of user account information, the method further comprises:determining if the first hash corresponding to the set of user account information is stored in the database, and if so, flagging the first hash for record purging purposes.
11. The method of claim 10, wherein:the database is configured to store a list of records for purging; and flagging the first hash for record purging processes comprises adding the first hash to the list of records.
12. The method of any of claims 7 to 11, wherein:the user account information corresponds to one or more pieces of user payment account information associated with a user involved in a payment transaction; andthe remote third party corresponds to an entity involved in the payment5 transaction that is attempting to authenticate the user’s payment account information in order to authenticate or approve the transaction.
Citation Information
Patent Citations
ViewCN119865311AonEspacenetopensinnewtab
ViewUS11232216B1onEspacenetopensinnewtab
