Movatterモバイル変換


[0]ホーム

URL:


CN114124352A - Key rotation method, device and computer medium - Google Patents

Key rotation method, device and computer medium
Download PDF

Info

Publication number
CN114124352A
CN114124352ACN202111374083.7ACN202111374083ACN114124352ACN 114124352 ACN114124352 ACN 114124352ACN 202111374083 ACN202111374083 ACN 202111374083ACN 114124352 ACN114124352 ACN 114124352A
Authority
CN
China
Prior art keywords
key
barbican
xxl
handler
plaintext
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111374083.7A
Other languages
Chinese (zh)
Inventor
刘李豪
田雨
蒋善坤
张栋梁
高传集
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Cloud Information Technology Co Ltd
Original Assignee
Inspur Cloud Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Cloud Information Technology Co LtdfiledCriticalInspur Cloud Information Technology Co Ltd
Priority to CN202111374083.7ApriorityCriticalpatent/CN114124352A/en
Publication of CN114124352ApublicationCriticalpatent/CN114124352A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本发明涉及计算机领域,具体提供了一种秘钥轮转方法,使用openstack的Barbican组件进行秘钥管理,生成可靠的随机秘钥,并通过xxl平台定时任务,指定执行策略,完成对加密内容的密钥自动轮转。与现有技术相比,本发明秘钥管理使用openstack的Barbican组件,实现了秘钥与后端的隔离,保证了秘钥的安全性;通过xxl定时任务平台和Barbican组件与后端的通信,实现了秘钥轮转的自动化处理,减少了秘钥管理后端手动进行秘钥轮转的开销。

Figure 202111374083

The invention relates to the field of computers, and specifically provides a secret key rotation method. The Barbican component of openstack is used for secret key management, a reliable random secret key is generated, and an execution strategy is specified through the xxl platform timing task to complete the encryption of encrypted content. The key rotates automatically. Compared with the prior art, the secret key management of the present invention uses the Barbican component of openstack, which realizes the isolation of the secret key and the back end, and ensures the security of the secret key; The automatic processing of key rotation reduces the overhead of manual key rotation at the key management backend.

Figure 202111374083

Description

Key rotation method, device and computer medium
Technical Field
The invention relates to the field of computers, and particularly provides a method, a device and a computer medium for key rotation.
Background
With the development of the internet industry, the problem of information security becomes more and more important, and how to protect the security of data and prevent information leakage also becomes the direction in which many internet manufacturers are researching. As a means for encrypting data, a key is the core of an encryption operation, and the security of the key can ensure the security of encrypted data.
Taking object storage needing encryption service in a cloud platform as an example, according to a traditional mode, an encryption key used by the object storage is provided for the object storage, the key generation efficiency is low, on the premise of considering safety, if key rotation is carried out on an encrypted file once, the plaintext of the encrypted file needs to be manually obtained, a new key is generated and then encryption is carried out, and under the condition that the data volume of the file needing encryption is large, the efficiency of the traditional mode is extremely low.
Disclosure of Invention
The invention provides a secret key rotation method with strong practicability aiming at the defects of the prior art,
the invention further aims to provide a key rotation device which is reasonable in design, safe and applicable.
A technical task of the third aspect is to provide a computer medium.
The technical scheme adopted by the invention for solving the technical problems is as follows:
a key rotation method is characterized in that a Barbican component of openstack is used for key management to generate a reliable random key, and an execution strategy is specified through a timing task of an xxl platform to finish automatic rotation of keys of encrypted contents.
Further, the method comprises the following steps:
s1, deploying a Barbican component in the openstack, wherein the core function of the Barbican component deployed for the first time is only opened for an admin user in the openstack, and only an administrator can use the creation function of the order and the secret;
s2, setting a key management executor, wherein the key management executor comprises a Barbican access module, a xxl timing task handler and a key replacement module.
S3, after several key round iterations, only the latest version of the key can complete the decryption operation.
Further, in step S1, if the tenant normally uses the order and secret functions, the policy file of Barbican is changed, and the attributes of order: post and secret: post are changed from rule: admin _ or _ creator to @, which is open for all users.
Further, in step S2, the Barbican access module is used for communication with Barbican to create a key, and the key is stored in an order of the Barbican component, and the clear text of the key can be obtained by calling a specific interface.
Further, the xxl timed task handler communicates with the xxl timed task platform to create a timed task;
when the back end receives the instruction key to open the key wheel, the handler calls xxl the timing task platform interface, the timing task execution period is set according to the cron expression, after the preset execution time is reached, xxl the timing task platform calls back the handler, and the back end starts to execute the encryption and decryption and key replacement actions.
Further, in the key replacement module, after the handler receives xxl timing task platform callback messages, the key replacement module obtains a current version ciphertext and a key to decrypt the ciphertext to obtain an encrypted plaintext, and obtains a key id identifier set in the plaintext at the same time.
Further, in step S3, after performing several rounds of iterations, the key and the ciphertext of the earlier version in Barbican and the database are deleted.
A key round apparatus comprising: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor is configured to invoke the machine readable program to perform a key round method.
A computer readable medium having stored thereon computer instructions which, when executed by a processor, cause the processor to perform a method of key rotation.
Compared with the prior art, the key rotation method, the key rotation device and the computer medium have the following outstanding advantages that:
the key management of the invention uses the Barbican component of openstack, realizes the isolation of the key from the back end, and ensures the security of the key; the xxl timing task platform and the Barbican component communicate with the back end, so that the automatic processing of key rotation is realized, and the expense of manually performing key rotation by the back end of key management is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flow chart of a key round-robin method.
Detailed Description
The present invention will be described in further detail with reference to specific embodiments in order to better understand the technical solutions of the present invention. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
A preferred embodiment is given below:
as shown in fig. 1, in the key round-robin method in this embodiment, a Barbican component of openstack is used for key management, a reliable random key is generated, and an execution policy is specified by timing tasks on an xxl platform, so that automatic key round-robin of encrypted content is completed.
The method specifically comprises the following steps:
s1, the Barbican component needs to be deployed in the openstack firstly, the core function of the Barbican component which is deployed for the first time is only open to admin users in the openstack, and only an administrator can use the creation function of the order and the secret.
To enable the tenant to use the order and secret functions normally, the policy file of Barbican is changed, and the attributes of ' orders: post ' and ' secret: post ' are changed from ' rule: admin _ or _ creator ' to ' @ open to all users.
And S2, setting a key management executor. The executor is divided into three parts, wherein the first part is a Barbican access module, the second part is an xxl timing task handler, and the third part is a key replacement module.
The communication between the Barbican access module and Barbican has the main task of creating a key. Taking AES _256 key as an example, the access module can set "algorithmic" attribute as "AES" and "bit _ length" as "256" in the body by calling the Barbican's openAPI POST/v 1/orders.
By this method, a key of type "AES _ 256" can be created, which is stored in an order of the Barbican component, and the key plaintext can be obtained by calling a specific interface.
The timed task handler is responsible for the communication between the back end and the xxl timed task platform and is mainly responsible for creating timed tasks. When the back end receives an instruction to open the key rotation for a secret key, the handler calls xxl a timed task platform interface, and sets a timed task execution period according to the cron expression, such as: "0012? 1 "represents 12 pm execution every monday. When the preset execution time is reached, xxl times the task platform callback handler, and the backend starts to execute the encryption/decryption and key replacement actions.
The key replacement module ensures that the ciphertext encrypted by the keys of different versions can be decrypted smoothly.
In order to decrypt different versions of the ciphertext with a specific master key, the ciphertext is added with a specific identifier indicating the actual key id in Barbican. After the handler receives xxl timing task platform callback information, the key replacement module acquires a current version of ciphertext and a key to decrypt the ciphertext to acquire an encrypted plaintext, and simultaneously acquires a key id identifier set in the plaintext, after the action is completed, the key replacement module deletes the identifier, adds a new key id generated by the Barbican access module as a new identifier into the key plaintext, encrypts the newly generated plaintext by using the new key, and stores the encrypted plaintext, so that the key is replaced, and the ciphertexts of different versions are decrypted by using keys of different versions.
S3, after performing round-robin iterations for several times, the key and the ciphertext of the earlier version need to be deleted, and if the maximum round-robin frequency is set to 5 times, when a certain master key is used as the key to generate the 6 th key in round-robin, the 1 st key should be deleted in Barbican, and the ciphertext generated by the first encryption should be deleted in the database. Through the method, the security problem caused by leakage of a certain secret key generated in the front can be prevented, and the timeliness of data security is ensured.
When data decryption is carried out, the identifier area of the ciphertext is read to identify which key in the Barbican is used for encryption, and then decryption operation is carried out, so that the old version key can be used continuously until the key rotation is finished.
A key round apparatus comprising: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor is configured to invoke the machine readable program to perform a key round method.
A computer readable medium having stored thereon computer instructions which, when executed by a processor, cause the processor to perform a method of key rotation.
The above embodiments are only specific ones of the present invention, and the scope of the present invention includes but is not limited to the above embodiments, and any suitable changes or substitutions that are consistent with the present invention and claimed by a key rotation method, apparatus and computer medium, and by a person of ordinary skill in the art, should be within the scope of the present invention.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (9)

1. A key rotation method is characterized in that a Barbican component of openstack is used for key management to generate a reliable random key, and an execution strategy is specified through an xxl platform timing task to complete automatic key rotation of encrypted contents.
2. A key round method according to claim 1, characterized by the steps of:
s1, deploying a Barbican component in the openstack, wherein the core function of the Barbican component deployed for the first time is only opened for an admin user in the openstack, and only an administrator can use the creation function of the order and the secret;
s2, setting a key management executor, wherein the key management executor comprises a Barbican access module, a xxl timing task handler and a key replacement module.
S3, after several key round iterations, only the latest version of the key can complete the decryption operation.
3. The key rotation method of claim 2, wherein in step S1, if the tenant uses the order and secret functions normally, the policy file of Barbican is changed, and the attributes of order: post and secret: post are changed from rule: admin _ or _ creator to @ open for all users.
4. The method according to claim 3, wherein in step S2, the Barbican access module is used for communication with Barbican to create keys, and the keys are stored in an order of Barbican components, and the keys can be obtained by calling a specific interface to obtain the plain text of the keys.
5. The key rotation method of claim 4, wherein the xxl timed task handler communicates with xxl timed task platform to create timed task;
when the back end receives the instruction key to open the key wheel, the handler calls xxl the timing task platform interface, the timing task execution period is set according to the cron expression, after the preset execution time is reached, xxl the timing task platform calls back the handler, and the back end starts to execute the encryption and decryption and key replacement actions.
6. The method according to claim 5, wherein in the key replacement module, after the handler receives xxl the message called back by the timed task platform, the key replacement module obtains the current version of the ciphertext and the key to decrypt the ciphertext to obtain the encrypted plaintext, and obtains the key id identifier set in the plaintext, after the action is completed, the key replacement module deletes the identifier, adds the new key id generated by the Barbican access module as a new identifier into the key plaintext, encrypts the newly generated plaintext with the new key, and stores the encrypted plaintext, so that the key is replaced.
7. The method of claim 5, wherein in step S3, after performing a number of round-robin iterations, the early version of the key and the ciphertext in the Barbican and the database are deleted.
8. A key round apparatus, comprising: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor, configured to invoke the machine readable program to perform the method of any of claims 1 to 7.
9. A computer readable medium having stored thereon computer instructions which, when executed by a processor, cause the processor to perform the method of any of claims 1 to 7.
CN202111374083.7A2021-11-192021-11-19Key rotation method, device and computer mediumPendingCN114124352A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202111374083.7ACN114124352A (en)2021-11-192021-11-19Key rotation method, device and computer medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202111374083.7ACN114124352A (en)2021-11-192021-11-19Key rotation method, device and computer medium

Publications (1)

Publication NumberPublication Date
CN114124352Atrue CN114124352A (en)2022-03-01

Family

ID=80397927

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202111374083.7APendingCN114124352A (en)2021-11-192021-11-19Key rotation method, device and computer medium

Country Status (1)

CountryLink
CN (1)CN114124352A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20150236850A1 (en)*2012-08-302015-08-20Nec CorporationRe-encryption system, re-encryption method and re-encryption program
CN106658493A (en)*2016-10-172017-05-10东软集团股份有限公司Key management method, device and system
CN106936794A (en)*2015-12-302017-07-07阿里巴巴集团控股有限公司Method, the device of a kind of method, device and setting key for changing key
CN108650676A (en)*2018-08-132018-10-12青岛海信电器股份有限公司A kind of key updating method in bluetooth ad hoc network and device
US20190273613A1 (en)*2018-03-052019-09-05International Business Machines CorporationDistributed encryption keys for tokens in a cloud environment
CN110602132A (en)*2019-09-242019-12-20苏州浪潮智能科技有限公司Data encryption and decryption processing method
CN111666558A (en)*2020-04-302020-09-15平安科技(深圳)有限公司Key alternation method, key alternation device, computer equipment and storage medium
CN111769950A (en)*2020-06-242020-10-13苏州浪潮智能科技有限公司 A key management method and system for token authentication in openstack system
CN113656814A (en)*2021-07-302021-11-16成都长城开发科技有限公司Equipment key safety management method and system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20150236850A1 (en)*2012-08-302015-08-20Nec CorporationRe-encryption system, re-encryption method and re-encryption program
CN106936794A (en)*2015-12-302017-07-07阿里巴巴集团控股有限公司Method, the device of a kind of method, device and setting key for changing key
CN106658493A (en)*2016-10-172017-05-10东软集团股份有限公司Key management method, device and system
US20190273613A1 (en)*2018-03-052019-09-05International Business Machines CorporationDistributed encryption keys for tokens in a cloud environment
CN108650676A (en)*2018-08-132018-10-12青岛海信电器股份有限公司A kind of key updating method in bluetooth ad hoc network and device
CN110602132A (en)*2019-09-242019-12-20苏州浪潮智能科技有限公司Data encryption and decryption processing method
CN111666558A (en)*2020-04-302020-09-15平安科技(深圳)有限公司Key alternation method, key alternation device, computer equipment and storage medium
CN111769950A (en)*2020-06-242020-10-13苏州浪潮智能科技有限公司 A key management method and system for token authentication in openstack system
CN113656814A (en)*2021-07-302021-11-16成都长城开发科技有限公司Equipment key safety management method and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
WEIXIN_30765475: "OpenStack-理论2.barbican 简介", Retrieved from the Internet <URL:https://blog.csdn.net/weixin_30765475/article/details/101113801?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522170306064416800186566882%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=170306064416800186566882&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-1-101113801-null-null.142^v96^pc_search_result_base7&utm_term=OpenStack-%E7%90%86%E8%AE%BA2.barbican%20%E7%AE%80%E4%BB%8B&spm=1018.2226.3001.4187>*
机智的豆子: "分布式定时任务—XXLJOB", Retrieved from the Internet <URL:https://blog.csdn.net/qq_39380737/article/details/107308551?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522170306052616800182790310%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=170306052616800182790310&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_ecpm_v1~rank_v31_ecpm-5-107308551-null-null.142^v96^pc_search_result_base7&utm_term=%E5%88%86%E5%B8%83%E5%BC%8F%E5%AE%9A%E6%97%B6%E4%BB%BB%E5%8A%A1-XXLJOB&spm=1018.2226.3001.4187>*

Similar Documents

PublicationPublication DateTitle
US10439804B2 (en)Data encrypting system with encryption service module and supporting infrastructure for transparently providing encryption services to encryption service consumer processes across encryption service state changes
US11184164B2 (en)Secure crypto system attributes
US12277242B2 (en)Redacting restricted content in files
US20210067326A1 (en)Cryptographic operation method, method for creating working key, cryptographic service platform, and cryptographic service device
CN111654367A (en)Password operation method, work key creation method, password service platform and equipment
WO2021164462A1 (en)Data encryption method, data decryption method, computer device, and medium
CN111079188A (en)mybatis field encryption and decryption device and encryption and decryption system
CN113282959A (en)Service data processing method and device and electronic equipment
CN103378971A (en)Data encryption system and method
WO2022206453A1 (en)Method and apparatus for providing cross-chain private data
CN109802832A (en)A kind of processing method of data file, system, big data processing server and computer storage medium
WO2019223098A1 (en)File reading and writing method and device
CN119227120B (en) A trusted data exchange method, device and storage medium based on trusted space
CN113886014A (en) Middleware loading dynamic key method, device, device and storage medium
CN114124352A (en)Key rotation method, device and computer medium
CN114070584B (en)Secret calculation method, device, equipment and storage medium
CN116248253A (en)Method and system for deriving database table keys based on domestic crypto-engine
CN110737910B (en)Android log decryption management method, device, equipment and medium
TW201734877A (en)Method and device for concealing user information contained in application
CN119720990B (en)Trusted DCS (distributed control system) upper computer data report generation method and related device
CN119475403B (en) A method and device for secure reading and writing of data in Hongmeng system equipment
CN108874604B (en) A method and system for verifying the authenticity of encrypted data of an encryption device
CN115801383A (en) A service calling method, device and medium for improving data security
CN116910822A (en) A rocket sub-stage recovery section data storage method, computing device and storage medium
CN116680721A (en)Data storage method, device, equipment and storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication

Application publication date:20220301

RJ01Rejection of invention patent application after publication

[8]ページ先頭

©2009-2025 Movatter.jp