A ceph distributed object storage system encryption and decryption method based on national secret algorithm

By using the national secret algorithm SM2/SM3/SM4 TLS/SSL one-way authentication and the SM4 national secret algorithm in the ceph distributed object storage system, a trusted channel is established between the client and the server, and is carried out between the internal components of the server. Encryption and decryption solve the problem of data transmission security risks in the existing technology and achieve effective guarantee of data security.

CN113779619BActive Publication Date: 2024-09-13SHENZHEN ZHENGTONG CLOUD COMPUTING CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110916712.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-11
Publication Date
2024-09-13
Estimated Expiration
2041-08-11

AI Technical Summary

Technical Problem

The existing ceph distributed object storage system has hidden dangers of interception or theft in the communication between the client and the server, leading to the risk of data security and privacy leakage.

Method used

Adopt TLS/SSL one-way authentication based on the national secret algorithm SM2/SM3/SM4, apply for a digital certificate from the public platform certification center through the server, establish a trusted channel between the client and the server, and use the SM4 national secret algorithm to report communications The text is encrypted and decrypted, and encryption and decryption are performed between the internal components of the server to ensure the security of data transmission.

Benefits of technology

It effectively prevents client requests from being intercepted or stolen midway, ensures access and data security, realizes the substitution of national secret encryption and decryption algorithms, and enhances the reliability and security of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113779619B
    Figure CN113779619B
Patent Text Reader

Abstract

The present invention discloses a ceph distributed object storage system encryption and decryption method based on a national secret algorithm, which includes adding a TLS / SSL one-way authentication based on a national secret algorithm SM2 / SM3 / SM4 on the basis of HTTP protocol communication to realize access communication between a client and a server. The present invention prevents client requests from being intercepted or stolen midway by replacing the national secret of the encryption and decryption algorithm of the access communication between the client and the server, and effectively guarantees access and data security; in addition, based on the national secret algorithm SM3 / SM4, the data communication between the internal components of the server is reinforced, which can effectively guarantee the security of communication data and realize the national secret replacement of the password reinforcement algorithm; at the same time, by replacing the national secret of the encryption and decryption algorithm of the access communication between the client and the server and the national secret replacement of the data communication between the internal components of the server, the entire ceph distributed object storage system realizes the national secret replacement of encryption and decryption, and effectively guarantees the user data and privacy security when providing unified services to the outside.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of ceph distributed object storage, and in particular to an encryption and decryption method of a ceph distributed object storage system based on a national secret algorithm. Background Art

[0002] With the continuous deepening of the informatization process, the amount of unstructured data such as pictures and videos that will not be modified after being saved is increasing. Different from traditional file storage and block storage, ceph distributed object storage, that is, object storage provided by the distributed storage system ceph, is becoming more and more popular as a new storage method.

[0003] As a widely used storage system, the ceph distributed object storage system has the characteristics of high scalability, high reliability, high performance and multiple copies. The existing open source ceph distributed object storage system uses the http protocol to communicate between the client and the server, and the communication between the components in the system, such as OSD and MON, has the risk of being intercepted or stolen, resulting in data security risks and privacy leakage risks for users. Summary of the invention

[0004] Based on this, the purpose of the present invention is to provide a ceph distributed object storage system encryption and decryption method based on the national secret algorithm, to achieve the national secret replacement of the encryption and decryption algorithm, to prevent the client request from being intercepted or stolen, and to effectively ensure access and data security.

[0005] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0006] The present invention provides a ceph distributed object storage system encryption and decryption method based on a national secret algorithm, which comprises the following steps:

[0007] Step S100: Add TLS / SSL one-way authentication based on the national secret algorithm SM2 / SM3 / SM4 on the basis of http protocol communication to realize access communication between the client and the server of the ceph distributed object storage system;

[0008] Step S110: The server applies for a digital certificate C from the public platform authentication center;

[0009] Step S120, the client sends SSL information to the server and generates a random number A;

[0010] Step S130: After receiving the SSL information, the server responds to the client with the version of the SSL protocol and the encryption algorithm used by the server, generates a random number B, takes out the SM2 public key to be used from the key library of the server, and sends the SM2 public key and digital certificate C to the client;

[0011] Step S140, verify whether the digital certificate C received by the client is legal; if so, proceed to step S150; if not, terminate the data transmission between the client and the server;

[0012] Step S150: After the digital certificate C of the client is verified, the client sends the SM4 national encryption algorithm scheme information supported by the client to the server;

[0013] Step S160: After receiving the SM4 national encryption algorithm scheme information sent by the client, the server sends a signal that it agrees to use the SM4 national encryption algorithm to encrypt and decrypt the communication message and sends it to the client;

[0014] Step S170: The client generates a random code R according to the random number A and the random number B. The random code R is used as the encryption and decryption key of the SM4 national encryption algorithm. The client encrypts the random code R using the SM2 public key received from the server, obtains the encryption result and sends it to the server.

[0015] Step S180: The server uses the SM2 private key to decrypt the encryption result to obtain the key R of the SM4 national encryption algorithm;

[0016] Step S190: A trusted channel based on TLS / SSL one-way authentication of the national encryption algorithm SM2 / SM3 / SM4 is established between the client and the server. The communication message is encrypted and decrypted using the key R of the SM4 national encryption algorithm, and data communication between the client and the server begins.

[0017] In one embodiment, after step S190, the method further includes:

[0018] Step S200: Verify the integrity of the communication message during the data communication process between the client and the server through the national secret SM3 hash algorithm.

[0019] In one embodiment, in step S100, a method of adding TLS / SSL one-way authentication based on national secret algorithm SM2 / SM3 / SM4 to communication based on http protocol is specifically performed as follows:

[0020] Change the cryptographic algorithm file in the OpenSSL source code to the SM2 / SM3 / SM4 national cryptographic algorithm;

[0021] Use OpenSSL to generate the key corresponding to the national encryption algorithm SM2 / SM4.

[0022] In one embodiment, the step of modifying the cryptographic algorithm file of the OpenSSL source code to the SM2 / SM3 / SM4 national cryptographic algorithm includes:

[0023] Replace the password in the cipher.c cryptographic algorithm file of the OpenSSL source code with the SM2 / SM3 / SM4 national cryptographic algorithm.

[0024] In one embodiment, the SM4 national encryption algorithm scheme in step S150 is formed by modifying the algorithm library in the OpenSSL source code.

[0025] In one embodiment, it also includes

[0026] Step S300: Encrypt and decrypt data communications between internal components of the server based on the national encryption algorithm SM3 / SM4.

[0027] In one embodiment, the method of step S300 includes:

[0028] Step S310: copy the preset SM4 symmetric encryption algorithm key to the server deployment directory;

[0029] Step S320: encrypt the first transmission data of the sending end component by calling the preset key of the SM4 symmetric encryption algorithm, and transmit the encrypted first transmission data to the socket interface;

[0030] Step S330: The receiving end component obtains the encrypted first transmission data, and decrypts it using a preset key of the SM4 symmetric encryption algorithm to obtain decrypted second transmission data;

[0031] Step S340: Send the decrypted second transmission data to the receiving end component for identification through the socket interface.

[0032] In one embodiment, after step S330, the method further includes:

[0033] Step S350: Use the SM3 national encryption algorithm to perform integrity check on the decrypted second transmission data to prevent tampering by a middleman.

[0034] In one of the embodiments, the SM4 symmetric encryption algorithm in step S310 is generated by an OpenSSL tool.

[0035] In one embodiment, the method of step 300 includes:

[0036] Copy the preset SM4 symmetric encryption algorithm key to the server deployment directory;

[0037] Encrypt the third transmission data of the receiving end component by calling the preset key of the SM4 symmetric encryption algorithm, and transmit the encrypted third transmission data to the socket interface;

[0038] The sending end component obtains the encrypted third transmission data, and decrypts it using a preset key of the SM4 symmetric encryption algorithm to obtain the decrypted fourth transmission data;

[0039] The decrypted fourth transmission data is sent to the sending end component for identification through the socket interface.

[0040] In summary, the encryption and decryption method of the ceph distributed object storage system based on the national secret algorithm provided by the present invention realizes the access communication between the client and the server of the ceph distributed object storage system by adding TLS / SSL one-way authentication based on the national secret algorithm SM2 / SM3 / SM4 on the basis of http protocol communication, realizes the national secret replacement of the encryption and decryption algorithm, prevents the client request from being intercepted or stolen midway, and effectively ensures access and data security. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 A schematic diagram of national encryption reinforcement for the ceph distributed object storage system provided by an embodiment of the present invention;

[0042] Figure 2 A schematic diagram of the process of the first encryption and decryption method of the Ceph distributed object storage system based on the national secret algorithm provided in the embodiment of the present invention;

[0043] Figure 3 A schematic diagram of the flow of a second encryption and decryption method for a ceph distributed object storage system based on a national secret algorithm provided in an embodiment of the present invention;

[0044] Figure 4 A schematic diagram of a process flow of a third encryption and decryption method for a ceph distributed object storage system based on a national secret algorithm provided in an embodiment of the present invention;

[0045] Figure 5 A schematic diagram of national encryption reinforcement between server components in a ceph distributed object storage system provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0046] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] The existing ceph distributed object storage system uses the http protocol to communicate between the client and the server. The communication between the components in the ceph distributed object storage system, such as OSD and MON, is encrypted and decrypted based on foreign cryptographic systems such as RSA / DES or directly in plain text. This authentication transmission between the client and the server and the data communication between the ceph components do not perform effective identity authentication, and there is a risk of interception or theft in the middle. In addition, these encryption methods can easily cause users to lose control of their data, resulting in data security risks and privacy leakage risks for users.

[0048] like Figure 1 As shown, a Ceph distributed object storage cluster is deployed on multiple physical hardware device servers (sever) to form the server side of the Ceph distributed object storage system. The Ceph distributed object storage cluster includes main components such as MON and OSD. OSD is used to provide node storage capacity according to the physical device disk. MON is a monitoring component to monitor various indicators of the Ceph distributed object storage cluster.

[0049] Figure 2 It is a flowchart of the first encryption and decryption method of the ceph distributed object storage system based on the national secret algorithm provided by the embodiment of the present invention, such as Figure 2 As shown, a ceph distributed object storage system encryption and decryption method based on a national secret algorithm specifically includes the following steps:

[0050] Step S100, on the basis of http protocol communication, add TLS / SSL one-way authentication based on national secret algorithm SM2 / SM3 / SM4 to realize access communication between the client and server of ceph distributed object storage system; to facilitate data communication between the client and server in a national secret environment after establishing a trusted channel, realize national secret replacement of encryption and decryption algorithm, prevent client request from being intercepted or stolen midway, and effectively ensure access and data security.

[0051] Specifically, Figure 1 As shown in the figure, the librgw layer and librados layer above the ceph distributed object storage physical cluster provide APIs, that is, libraries for operating the ceph distributed object storage cluster. The upper layer can directly implement various operations on the ceph distributed object storage cluster by calling the library, and can also develop corresponding clients based on the librgw layer and librados layer using C, C++, Python, etc.

[0052] The API is called on the librgw layer and the librados layer as the Ceph object gateway, namely the Rados gateway, which can convert http requests into RADOS requests, and also convert RADOS requests into http requests, thereby providing object storage with a RESTful interface.

[0053] Based on the RADOS gateway, the ceph distributed object storage system provides compatible S3API, SwiftAPI and management API. Different clients can authenticate and communicate with the rados gateway by calling different interfaces; wherein, the client is a corresponding client developed based on the librgw layer and the librados layer using C, C++, Python, etc., or other applications after calling SwiftAPI, S3API, and management API, and the server is the Rados gateway of the ceph distributed object storage system.

[0054] The client and the rados gateway, i.e. the server of the ceph distributed object storage system, use the http protocol in the form of a RESTful interface for access communication. For identity authentication and data communication security, TLS / SSL one-way authentication based on the national secret algorithm SM2 / SM3 / SM4 is added on the basis of http protocol communication to replace the existing RSA / DES algorithm or direct plain text transmission method. After establishing a trusted channel, data communication between the client and the server is carried out in a national secret environment, realizing the national secret replacement of the encryption and decryption algorithm, preventing the client request from being intercepted or stolen midway, and effectively ensuring access and data security.

[0055] Specifically, in step S100, a method of adding TLS / SSL one-way authentication based on the national secret algorithm SM2 / SM3 / SM4 to the communication based on the http protocol is specifically performed as follows:

[0056] Modify the cipher algorithm file of the OpenSSL source code to the SM2 / SM3 / SM4 national secret algorithm; specifically, replace the password in the cipher.c cipher algorithm file of the OpenSSL source code with the SM2 / SM3 / SM4 national secret algorithm;

[0057] Use OpenSSL to generate the key corresponding to the national encryption algorithm SM2 / SM4.

[0058] Step S110: The server applies for a digital certificate C from the public platform certification authority (CertificateAuthority).

[0059] Step S120: The client sends SSL information to the server and generates a random number A; wherein the SSL information includes the version of the SSL protocol supported by the client and a list of national encryption algorithms.

[0060] Step S130: After receiving the SSL information, the server responds to the client with the version of the SSL protocol and the encryption algorithm used by the server, generates a random number B, takes out the SM2 public key to be used from the server's key library, and sends the SM2 public key and digital certificate C to the client.

[0061] Step S140, verify whether the digital certificate C received by the client is legal; if so, proceed to step S150; if not, terminate the data transmission between the client and the server.

[0062] Among them, after the client receives the SM2 public key and digital certificate C, it verifies the legitimacy and integrity of the digital certificate C through the CA organization and the national secret SM3 hash algorithm, including whether the certificate is expired, whether it has been revoked, and whether it is credible. If there are no problems with the above verifications, it proceeds to step S150; if the above verifications fail, the client returns an unsafe warning and then terminates the data communication between the client and the server, thereby effectively preventing hackers from impersonating and improving the reliability and security of data transmission between the client and the server.

[0063] Step S150, the client sends the SM4 national encryption algorithm scheme information supported by the client to the server; wherein the SM4 national encryption algorithm scheme is formed by modifying the algorithm library in the OpenSSL source code.

[0064] Step S160: After receiving the SM4 national encryption algorithm scheme information sent by the client, the server sends a message agreeing to use the SM4 national encryption algorithm to encrypt and decrypt the communication data and sends it to the client because the SM4 national encryption algorithm has high encryption efficiency;

[0065] Step S170: The client generates a random code R according to the random number A and the random number B. The random code R is used as the encryption and decryption key of the SM4 national encryption algorithm. The client encrypts the random code R using the SM2 public key received from the server, obtains the encryption result and sends it to the server.

[0066] Step S180: The server uses the SM2 private key to decrypt the encryption result to obtain the key R of the SM4 national encryption algorithm;

[0067] Step S190, a trusted channel based on TLS / SSL one-way authentication of the national encryption algorithm SM2 / SM3 / SM4 is established between the client and the server, and the communication message is encrypted and decrypted by the key R of the SM4 national encryption algorithm, and data communication between the client and the server begins; subsequent data communications between the client and the server will be based on the key R of the SM4 national encryption algorithm for encryption and decryption to ensure the security of information in communications between the client and the server.

[0068] like Figure 3 As shown, in one embodiment, after step S190, the following step is also included

[0069] Step S200: Verify the integrity of the communication message during the data communication process between the client and the server through the national secret SM3 hash algorithm.

[0070] The invention discloses a ceph distributed object storage system encryption and decryption method based on a national secret algorithm, which realizes access communication between a client and a server of the ceph distributed object storage system by adding TLS / SSL one-way authentication based on a national secret algorithm SM2 / SM3 / SM4 on the basis of communication based on an http protocol, realizes national secret substitution of an encryption and decryption algorithm, prevents client requests from being intercepted or stolen midway, and effectively ensures access and data security.

[0071] like Figure 4 In one embodiment, a ceph distributed object storage system encryption and decryption method based on a national secret algorithm also includes

[0072] Step S300, encrypting and decrypting data communications between components within the server, i.e., the ceph distributed object storage cluster, based on the national secret algorithm SM3 / SM4, can effectively ensure the security of communication data and realize the national secret replacement of the password reinforcement algorithm; wherein, the key for encrypting and decrypting data communications between components within the server is generated by the OpenSSL tool.

[0073] like Figure 5 As shown, specifically, the components inside the server mainly include MON and OSD. In the embodiment of the present invention, data communication between the MON component and the OSD component is taken as an example for explanation.

[0074] In the present invention, step S300 and step S100 can be performed simultaneously or separately, and a suitable step sequence is selected according to the specific data transmission requirements of the ceph distributed object storage system.

[0075] In one of the embodiments, data communication between internal components of the server is achieved through a socket interface.

[0076] In one embodiment, the method of step S300 includes:

[0077] Step S310a, copy the preset SM4 symmetric encryption algorithm key to the server deployment directory; the SM4 symmetric encryption algorithm is generated by the OpenSSL tool. In this example, the server deployment directory is the deployment directory / opt / ceph of the server internal components, specifically the server directory where the Ceph distributed object storage cluster is deployed. The server components MON and OSD can be deployed on the same server as needed, or they can be deployed on different servers respectively.

[0078] Step S320a, encrypt the first transmission data of the sending end component by calling the preset key of the SM4 symmetric encryption algorithm, and transmit the encrypted first transmission data to the socket interface; the server component is divided into a sending end component and a receiving end component according to the information sending and receiving status, and the communication data between the server components includes data for maintaining the heartbeat mechanism, monitoring data of each node, etc.;

[0079] Step S330a, the receiving end component obtains the encrypted first transmission data, and decrypts it using the preset key of the SM4 symmetric encryption algorithm to obtain the decrypted second transmission data; specifically, after receiving the encrypted first transmission data information, the receiving end component obtains the encrypted first transmission data from the socket interface, and then decrypts it using the preset key of the SM4 symmetric encryption algorithm, and finally obtains the decrypted second transmission data;

[0080] Step S340a, send the decrypted second transmission data to the receiving component for identification through the socket interface, and then realize the encryption and decryption of data communication between the internal components of the server, so that the server components of the ceph distributed object storage system use the national secret algorithm SM3 / SM4 to strengthen the original socket communication, which can effectively ensure the security of communication data and realize the national secret replacement of the password reinforcement algorithm.

[0081] In one embodiment, after step S330, the following step is further included:

[0082] Step S350: Use the SM3 national encryption algorithm to perform integrity check on the decrypted second transmission data to prevent tampering by a middleman.

[0083] In one embodiment, the method of step S300 includes:

[0084] Step S310b, copy the preset SM4 symmetric encryption algorithm key to the server deployment directory;

[0085] Step S320b, encrypting the third transmission data of the receiving end component by calling the preset key of the SM4 symmetric encryption algorithm, and transmitting the encrypted third transmission data to the socket interface;

[0086] Step S330b, the sending end component obtains the encrypted third transmission data, and decrypts it using the preset key of the SM4 symmetric encryption algorithm to obtain the decrypted fourth transmission data; specifically, after receiving the encrypted third transmission data information, the sending end component obtains the encrypted third transmission data from the socket interface, and then decrypts it using the preset key of the SM4 symmetric encryption algorithm, and finally obtains the decrypted fourth transmission data;

[0087] Step S340b, send the decrypted fourth transmission data to the sending end component for identification through the socket interface, and then realize the encryption and decryption of data communication between the internal components of the server, so that the server components of the ceph distributed object storage system use the national secret algorithm SM3 / SM4 for reinforcement on the basis of the original socket communication, which can effectively ensure the security of communication data and realize the national secret replacement of the password reinforcement algorithm.

[0088] In order to make the technical solution of the present invention more clear, a preferred embodiment is described below.

[0089] Step S100: Add TLS / SSL one-way authentication based on the national secret algorithm SM2 / SM3 / SM4 on the basis of http protocol communication to realize access communication between the client and the server of the ceph distributed object storage system;

[0090] Step S120, the client sends SSL information to the server and generates a random number A;

[0091] Step S130: After receiving the SSL information, the server responds to the client with the version of the SSL protocol and the encryption algorithm used by the server, generates a random number B, takes out the SM2 public key to be used from the key library of the server, and sends the SM2 public key and digital certificate C to the client;

[0092] Step S140, verify whether the digital certificate C received by the client is legal; if so, proceed to step S150; if not, terminate the data transmission between the client and the server.

[0093] Step S150: After the digital certificate C of the client is verified, the client sends the SM4 national encryption algorithm scheme information supported by the client to the server;

[0094] Step S160: After receiving the SM4 national encryption algorithm scheme information sent by the client, the server sends a signal that it agrees to use the SM4 national encryption algorithm to encrypt and decrypt the communication message and sends it to the client based on the high encryption efficiency of the SM4 national encryption algorithm;

[0095] Step S170: The client generates a random code R according to the random number A and the random number B. The random code R is used as the encryption and decryption key of the SM4 national encryption algorithm. The client encrypts the random code R using the SM2 public key received from the server, obtains the encryption result and sends it to the server.

[0096] Step S180: The server uses the SM2 private key to decrypt the encryption result to obtain the key R of the SM4 national encryption algorithm;

[0097] Step S190: A trusted channel based on TLS / SSL one-way authentication of the national secret algorithm SM2 / SM3 / SM4 is established between the client and the server. The communication message is encrypted and decrypted by the key R of the SM4 national secret algorithm, and data communication between the client and the server begins.

[0098] Step S200: Verify the integrity of the communication message during the data communication between the client and the server through the national secret SM3 hash algorithm;

[0099] Step S300: Encrypt and decrypt data communications between internal components of the server based on the national encryption algorithm SM3 / SM4.

[0100] In the embodiment of the present invention, TLS / SSL one-way authentication based on national secret algorithm SM2 / SM3 / SM4 is used to realize access communication between the client and server of the ceph distributed object storage system, realizing national secret replacement of encryption and decryption algorithm; in conjunction with national secret algorithm SM3 / SM4, data communication between internal components of the server is reinforced, so that the entire ceph distributed object storage system realizes national secret replacement of encryption and decryption, and effectively protects user data and privacy security when providing unified services to the outside world.

[0101] In summary, the present invention provides a method for encrypting and decrypting a ceph distributed object storage system based on a national secret algorithm. By adding TLS / SSL one-way authentication based on the national secret algorithm SM2 / SM3 / SM4 on the basis of communication based on the http protocol, the access communication between the client and the server of the ceph distributed object storage system is realized, and the national secret replacement of the encryption and decryption algorithm is realized to prevent the client request from being intercepted or stolen midway, and the access and data security is effectively guaranteed. In addition, based on the national secret algorithm SM3 / SM4, the data communication between the internal components of the server is reinforced, which can effectively guarantee the security of the communication data and realize the national secret replacement of the password reinforcement algorithm. At the same time, by replacing the national secret of the encryption and decryption algorithm of the access communication between the client and the server and the national secret replacement of the data communication between the internal components of the server, the entire ceph distributed object storage system realizes the national secret replacement of encryption and decryption, and effectively guarantees the user data and privacy security when providing unified services to the outside.

[0102] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0103] In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0104] The steps in the method of the embodiment of the present invention can be adjusted in order, merged and deleted according to actual needs. The units in the device of the embodiment of the present invention can be merged, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a terminal, or a network device, etc.) to perform all or part of the steps of the method described in the various embodiments of the present invention.

[0105] The above-described embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.

Claims

1. A ceph distributed object storage system encryption and decryption method based on a national secret algorithm, characterized in that: The steps include: Step S100: Add TLS / SSL one-way authentication based on the national secret algorithm SM2 / SM3 / SM4 on the basis of http protocol communication to realize access communication between the client and the server of the ceph distributed object storage system; Step S110: The server applies for a digital certificate C from the public platform authentication center; Step S120, the client sends SSL information to the server and generates a random number A; Step S130: After receiving the SSL information, the server responds to the client with the version of the SSL protocol and the encryption algorithm used by the server, generates a random number B, takes out the SM2 public key to be used from the key library of the server, and sends the SM2 public key and digital certificate C to the client; Step S140, verify whether the digital certificate C received by the client is legal; if so, proceed to step S150; if not, terminate the data transmission between the client and the server; Step S150: After the digital certificate C of the client is verified, the client sends the SM4 national encryption algorithm scheme information supported by the client to the server; Step S160: After receiving the SM4 national encryption algorithm scheme information sent by the client, the server sends a signal that it agrees to use the SM4 national encryption algorithm to encrypt and decrypt the communication message and sends it to the client; Step S170: The client generates a random code R according to the random number A and the random number B. The random code R is used as the encryption and decryption key of the SM4 national encryption algorithm. The client encrypts the random code R using the SM2 public key received from the server, obtains the encryption result and sends it to the server. Step S180: The server uses the SM2 private key to decrypt the encryption result to obtain the key R of the SM4 national encryption algorithm; Step S190: A trusted channel based on TLS / SSL one-way authentication of the national secret algorithm SM2 / SM3 / SM4 is established between the client and the server. The communication message is encrypted and decrypted by the key R of the SM4 national secret algorithm, and data communication between the client and the server begins. Step S200: Verify the integrity of the communication message during the data communication between the client and the server through the national secret SM3 hash algorithm; Step S300: Encrypt and decrypt data communications between internal components of the server based on the national encryption algorithm SM3 / SM4.

2. According to claim 1, a ceph distributed object storage system encryption and decryption method based on a national secret algorithm is characterized in that: In step S100, a method for adding TLS / SSL one-way authentication based on the national secret algorithm SM2 / SM3 / SM4 to the communication based on the http protocol is specifically performed as follows: Change the cryptographic algorithm file in the OpenSSL source code to the SM2 / SM3 / SM4 national cryptographic algorithm; Use OpenSSL to generate the key corresponding to the national encryption algorithm SM2 / SM4.

3. According to claim 2, a ceph distributed object storage system encryption and decryption method based on a national secret algorithm is characterized in that: The method of modifying the cryptographic algorithm file in the OpenSSL source code to the SM2 / SM3 / SM4 national cryptographic algorithm includes: Replace the password in the cipher.c cryptographic algorithm file of the OpenSSL source code with the SM2 / SM3 / SM4 national cryptographic algorithm.

4. According to claim 1, a ceph distributed object storage system encryption and decryption method based on a national secret algorithm is characterized in that: The SM4 national encryption algorithm scheme in step S150 is formed by modifying the algorithm library in the OpenSSL source code.

5. According to the encryption and decryption method of the ceph distributed object storage system based on the national secret algorithm of claim 1, it is characterized in that: The method of step S300 specifically includes: Step S310a, copy the preset SM4 symmetric encryption algorithm key to the server deployment directory; Step S320a, encrypting the first transmission data of the sending end component by calling the preset key of the SM4 symmetric encryption algorithm, and transmitting the encrypted first transmission data to the socket interface; Step S330a: The receiving end component obtains the encrypted first transmission data, and decrypts it using a preset key of the SM4 symmetric encryption algorithm to obtain decrypted second transmission data; Step S340a: Send the decrypted second transmission data to the receiving end component for identification through the socket interface.

6. According to claim 5, a method for encrypting and decrypting a ceph distributed object storage system based on a national secret algorithm is characterized in that: After step S330a, the method further includes: Step S350: Use the SM3 national encryption algorithm to perform integrity check on the decrypted second transmission data to prevent tampering by a middleman.

7. According to claim 5, a ceph distributed object storage system encryption and decryption method based on a national secret algorithm is characterized in that: In step S310a, the SM4 symmetric encryption algorithm is generated by the OpenSSL tool.

8. According to the encryption and decryption method of a ceph distributed object storage system based on a national secret algorithm according to claim 1, it is characterized in that: The method of step 300 specifically includes: Step S310b, copy the preset SM4 symmetric encryption algorithm key to the server deployment directory; Step S320b, encrypting the third transmission data of the receiving end component by calling the preset key of the SM4 symmetric encryption algorithm, and transmitting the encrypted third transmission data to the socket interface; Step S330b: The sending end component obtains the encrypted third transmission data, and decrypts it using a preset key of the SM4 symmetric encryption algorithm to obtain decrypted fourth transmission data; Step S340b: Send the decrypted fourth transmission data to the sending end component for identification through the socket interface.