Shared file encryption method and device, equipment and storage medium
By associating encrypted information with the shared file storage type on the cloud platform, an encryption key is generated to encrypt the shared file, solving the problem of lack of encryption in existing shared file storage technologies and improving data security and standardization.
Patent Information
- Application Number
- CN202410815743.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-11-12
AI Technical Summary
Existing OpenStack-based shared file storage on cloud platforms lacks encryption mechanisms, resulting in insufficient data security and an inability to effectively prevent unauthorized users from performing illegal operations.
By obtaining pre-set encryption information, associating it with a shared file storage type, an encrypted shared file storage type is created. An encryption key is generated by binding a key identifier and encryption information, and shared files are stored in an encrypted manner. The management of custom keys and encrypted snapshots is supported.
It enables encrypted management of shared files, prevents data leakage, improves data security and standardization, and meets users' flexible encryption needs.
Smart Images

Figure CN118940285A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of shared data management, and in particular to a shared file encryption method and device, an electronic device and a storage medium. Background Art
[0002] With the rapid development of cloud computing, more and more companies are putting their business and systems on cloud platforms. Cloud platforms can quickly build development environments and allocate computing resources according to the needs of different users, with the advantages of elasticity, speed, and on-demand. Manila (shared file storage service) is an important component of OpenStack (an open source cloud computing management platform project), providing shared file storage services for OpenStack, so that cloud hosts can easily use shared file systems. On the cloud platform operating system, users can easily create file storage types through the Manila service. Different storage types can correspond to different underlying storage. Select any file storage type, and eventually the underlying shared file directory will be created in the corresponding driver.
[0003] Currently, the shared file storage created based on OpenStack is all non-encrypted shared file storage. In order to ensure the security and confidentiality of user data, an encryption method is needed to encrypt the shared file storage. Summary of the invention
[0004] The embodiment of the present application provides a shared file encryption method to solve the problem of how to provide a shared file encryption method based on a cloud platform to prevent unauthorized users from directly performing illegal operations on shared files without going through the cloud platform.
[0005] Correspondingly, an embodiment of the present application also provides a shared file encryption device, an electronic device and a storage medium to ensure the implementation and application of the above method.
[0006] In order to solve the above problems, an embodiment of the present application discloses a shared file encryption method, which is applied to a cloud platform, wherein the shared file is stored in the cloud platform, and the cloud platform includes a file storage type database. The method includes:
[0007] Get the pre-set encryption information;
[0008] Associating the encryption information with the shared file storage type to obtain the encrypted shared file storage type, and storing the encrypted shared file storage type in the file storage type database;
[0009] Receiving a request for creating an encrypted file storage and a shared file to be encrypted, wherein the request for creating an encrypted file storage includes a target file storage type;
[0010] Querying the file storage type database according to the target file storage type, and when the encrypted shared file storage type corresponding to the target file storage type is found, creating a key identifier using the encryption information corresponding to the encrypted shared file storage type;
[0011] Binding the key identifier with the encryption information to obtain an encryption key;
[0012] The encryption key is used to encrypt the shared file to obtain an encrypted shared file, and the encrypted shared file is stored.
[0013] In an optional embodiment of the present application, the cloud platform further includes a key management storage component, and after receiving the creation of an encrypted file storage request and a shared file to be encrypted, further includes:
[0014] Calling the shared file storage interface to determine whether the request to create an encrypted file storage contains a custom key;
[0015] If the request to create an encrypted file storage does not include the custom key, calling the shared file storage interface to query the file storage type database according to the target file storage type;
[0016] When the encrypted shared file storage type corresponding to the target file storage type is queried, determining whether the shared file to be encrypted is a file created by an encrypted snapshot;
[0017] If the shared file to be encrypted is not a file created by the encrypted snapshot, creating a key identifier using the encryption information corresponding to the encrypted shared file storage type;
[0018] storing the key identifier in the key management storage component;
[0019] Binding the key identifier in the key management storage component with the encryption information to obtain an encryption key;
[0020] The shared file to be encrypted is encrypted using the encryption key and stored.
[0021] In an optional embodiment of the present application, it is characterized in that the method further comprises:
[0022] If the request to create an encrypted file storage contains the custom key, calling the shared file storage interface to receive the request to create an encrypted file storage;
[0023] Storing the custom key in the request to create encrypted file storage into the key management storage component;
[0024] Obtaining the custom key from the key management storage component;
[0025] The shared file to be encrypted is encrypted using the custom key and stored.
[0026] In an optional embodiment of the present application, the file created by the encrypted snapshot has a corresponding source encrypted snapshot, and the source encrypted snapshot has a corresponding source key identifier, and the method further includes:
[0027] If the shared file to be encrypted is a file created by the encrypted snapshot, copying the source key identifier;
[0028] storing the source key identifier in the key management storage component;
[0029] Binding the source key identifier in the key management storage component with the encryption information to obtain an encryption key;
[0030] The shared file to be encrypted is encrypted using the encryption key and stored.
[0031] In an optional embodiment of the present application, the cloud platform further includes a storage backend driver, the storage backend driver is communicatively connected to the key management storage component, and the using of the encryption key to encrypt the shared file to be encrypted and store the shared file to be encrypted includes:
[0032] Invoking the storage backend driver to retrieve the encryption key in the key management storage component;
[0033] After obtaining the encryption key, controlling the storage backend driver to encrypt the shared file to be encrypted to obtain an encrypted shared file;
[0034] The encrypted shared file is stored.
[0035] In an optional embodiment of the present application, the shared file storage type has a corresponding universal unique identifier, and associating the encryption information with the shared file storage type includes:
[0036] The encryption information is associated with the shared file storage type according to the universal unique identifier corresponding to the shared file storage type.
[0037] In an optional embodiment of the present application, the encrypted information at least includes
[0038] The size of the encryption key corresponding to the shared file storage type, the hardware implementation or software implementation that provides encryption support for the shared file storage type, the location of the encryption key control, and the encryption algorithm or encryption mode.
[0039] The embodiment of the present application further discloses a shared file encryption device, which is applied to a cloud platform, wherein the shared file is stored in the cloud platform, and the cloud platform includes a file storage type database, and the device includes:
[0040] An encryption information acquisition module is used to acquire preset encryption information;
[0041] An encrypted shared file storage type acquisition module is used to associate the encryption information with the shared file storage type to obtain the encrypted shared file storage type, and store the encrypted shared file storage type in the file storage type database;
[0042] An encryption request receiving module, used for receiving a request for creating an encrypted file storage and a shared file to be encrypted, wherein the request for creating an encrypted file storage includes a target file storage type;
[0043] A key identifier creation module is used to query the file storage type database according to the target file storage type, and when the encrypted shared file storage type corresponding to the target file storage type is queried, create a key identifier using the encryption information corresponding to the encrypted shared file storage type;
[0044] An encryption key creation module, used to bind the key identifier with the encryption information to obtain an encryption key;
[0045] The encrypted shared file storage module is used to encrypt the shared file to be encrypted using the encryption key to obtain an encrypted shared file, and store the encrypted shared file.
[0046] An embodiment of the present application also discloses an electronic device, including: a processor; and a memory, on which executable code is stored. When the executable code is executed, the processor executes the shared file encryption method as described in one or more of the embodiments of the present application.
[0047] The embodiments of the present application also disclose one or more machine-readable media on which executable codes are stored. When the executable codes are executed, the processor executes the shared file encryption method as described in one or more of the embodiments of the present application.
[0048] Compared with the prior art, the embodiments of the present application have the following advantages:
[0049] In an embodiment of the present application, pre-set encryption information is obtained; the encryption information is associated with a shared file storage type to obtain an encrypted shared file storage type, and the encrypted shared file storage type is stored in a file storage type database; a request to create an encrypted file storage and a shared file to be encrypted are received, and the encrypted file storage request includes a target file storage type; the file storage type database is queried according to the target file storage type, and when the encrypted shared file storage type corresponding to the target file storage type is queried, a key identifier is created using the encryption information corresponding to the encrypted shared file storage type; the key identifier is bound to the encryption information to obtain an encryption key; the encryption key is used to encrypt the shared file to be encrypted to obtain an encrypted shared file, and the encrypted shared file is stored. The embodiment of the present application achieves encryption management of shared files by adding encryption information to an existing shared file storage type and creating an encrypted shared file storage type, thereby solving the problem that shared file storage cannot be encrypted based on the cloud platform, preventing data leakage, and improving data security and standardization. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 This is a flowchart of a shared file encryption method embodiment of the present application;
[0051] Figure 2 This is a schematic diagram of the steps of another shared file encryption method embodiment of the present application;
[0052] Figure 3 It is a structural block diagram of an embodiment of a shared file encryption device of the present application;
[0053] Figure 4 It is a schematic diagram of the structure of a device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0054] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0055] Reference Figure 1 , is a flowchart of a shared file encryption method embodiment of the present application, comprising the following steps:
[0056] Step 101: Obtain pre-set encryption information.
[0057] In an embodiment of the present application, a shared file encryption method can be applied to a cloud platform, such as OpenStack, etc. The embodiment of the present application does not impose any restrictions on the type of cloud platform. The cloud platform in the embodiment of the present application at least includes a file storage type database for storing data related to file storage types. Data related to different file storage types can be stored in the file storage type database. When a shared file of a file storage type needs to be created, the corresponding file storage type number can be queried from the file storage type database. In an optional embodiment, the cloud platform also includes a key management storage component (such as Barbican, a component responsible for storing and managing data such as keys), a storage backend driver, and a shared file storage service (such as Manila, etc.).
[0058] In step 101, first obtain the pre-set encryption information. In an optional embodiment, the encryption information includes the size (key-size) of the encryption key corresponding to the shared file storage type, the hardware implementation or software implementation (provider; such as LUKS, Linux Unified Key Setup, a disk encryption specification) that provides encryption support for the shared file storage type, the location (control-location) of the encryption key control, and the encryption algorithm or encryption mode (cipher), etc. Among them, the encryption algorithm or encryption mode can be set to aes-xts-plain64, sm4-xts-plain64, etc., aes (Advanced Encryption Standard, Advanced Encryption Standard), sm4 (State Machine 4, a symmetric block encryption algorithm) are encryption algorithms, xts (XEX-based Tweaked-CodeBook mode with CiphertextStealing, XEX-based adjusted codebook mode and ciphertext stealing) is the encryption mode, and plain64 (Base64-encoded unencrypted version) is the initialization vector mode of the encryption mode. The embodiment of the present application does not limit the type of encryption information and its specific settings, and those skilled in the art can set it according to actual needs.
[0059] In an optional embodiment, the specific settings of the encryption information may be changed periodically, such as changing the specific settings of the encryption algorithm or encryption mode. Specifically, the current security requirements and potential threats may be evaluated first, and the time interval for changing the encryption information and the new encryption information required for each change may be set accordingly. This effectively improves the security of shared file encryption and resists new security threats.
[0060] Step 102: Associating the encryption information with the shared file storage type to obtain the encrypted shared file storage type, and storing the encrypted shared file storage type in the file storage type database.
[0061] In step 102, the encryption information is associated with the existing shared file storage type to obtain the encrypted shared file storage type, the shared file storage interface is called, and the encrypted shared file storage type is stored in the file storage type database. In an optional embodiment, the data of the encrypted shared file storage type may at least include the following data: share_type_id (shared storage type UUID, i.e. shared storage type universal unique identifier), encryption_id (encrypted UUID, i.e. encrypted universal unique identifier), created_at (creation time), updated_at (update time), deleted_at (deletion time), key_size, cipher, provider, control_location, etc. The embodiment of the present application does not impose any restrictions on the data type and specific settings of the encrypted shared file storage type, and those skilled in the art can set it according to actual needs.
[0062] In an optional embodiment, the file storage type database may also support operations such as querying, deleting, and updating encrypted shared file storage types through a shared file storage interface.
[0063] Step 103: Receive a request for creating an encrypted file storage and a shared file to be encrypted, wherein the request for creating an encrypted file storage includes a target file storage type.
[0064] In step 103, an encrypted file storage request and a shared file to be encrypted sent by a user are received, wherein the encrypted file storage request includes a target file storage type that the user wishes to create.
[0065] Step 104: query the file storage type database according to the target file storage type, and when the encrypted shared file storage type corresponding to the target file storage type is found, create a key identifier using the encryption information corresponding to the encrypted shared file storage type.
[0066] In step 104, according to the target file storage type, the shared file storage interface is called to query the file storage type database to determine whether the target file storage type is an encrypted shared file storage type. If the encrypted shared file storage type corresponding to the target file storage type is found, the encryption information corresponding to the encrypted shared file storage type is obtained, the castellan interface (key management interface) is called to store the encryption parameters into the key management storage component, and the key identifier (key_id) required to create the encryption key is returned. A new key identifier is created according to the encryption information corresponding to the encrypted shared file storage type and the key identifier is stored in the key management storage component.
[0067] Step 105: Bind the key identifier with the encryption information to obtain an encryption key.
[0068] In step 105, the key identifier is bound to the encryption information corresponding to the encrypted shared file storage type, thereby obtaining the encryption key required for encrypting the shared file.
[0069] Step 106: Use the encryption key to encrypt the shared file to obtain an encrypted shared file, and store the encrypted shared file.
[0070] In step 106, the encryption key is used to encrypt the shared file to be encrypted and the shared file to be encrypted is stored. Specifically, in this embodiment, the storage backend driver can be called through manila_scheduler (file storage scheduling service) and manila-share (file storage management service) to encrypt and store the shared file to be encrypted. The storage backend driver uses KMIP (Key Management Interoperability Protocol) to communicate with the key management storage component and retrieve the encryption key in the key management storage component. The encryption key is used to encrypt the shared file to be encrypted at the storage backend, and the encrypted shared file is stored in the target file storage type.
[0071] In an embodiment of the present application, pre-set encryption information is obtained; the encryption information is associated with a shared file storage type to obtain an encrypted shared file storage type, and the encrypted shared file storage type is stored in a file storage type database; a request to create an encrypted file storage and a shared file to be encrypted are received, and the encrypted file storage request includes a target file storage type; the file storage type database is queried according to the target file storage type, and when the encrypted shared file storage type corresponding to the target file storage type is queried, a key identifier is created using the encryption information corresponding to the encrypted shared file storage type; the key identifier is bound to the encryption information to obtain an encryption key; the encryption key is used to encrypt the shared file to be encrypted to obtain an encrypted shared file, and the encrypted shared file is stored. The embodiment of the present application achieves encryption management of shared files by adding encryption information to an existing shared file storage type and creating an encrypted shared file storage type, thereby solving the problem that shared file storage cannot be encrypted based on the cloud platform, preventing data leakage, and improving data security and standardization.
[0072] In an optional embodiment of the present application, the cloud platform further includes a key management storage component, and after receiving the creation of an encrypted file storage request and a shared file to be encrypted, further includes:
[0073] Calling the shared file storage interface to determine whether the request to create an encrypted file storage contains a custom key;
[0074] If the request to create an encrypted file storage does not include the custom key, calling the shared file storage interface to query the file storage type database according to the target file storage type;
[0075] When the encrypted shared file storage type corresponding to the target file storage type is queried, determining whether the shared file to be encrypted is a file created by an encrypted snapshot;
[0076] If the shared file to be encrypted is not a file created by the encrypted snapshot, creating a key identifier using the encryption information corresponding to the encrypted shared file storage type;
[0077] storing the key identifier in the key management storage component;
[0078] Binding the key identifier in the key management storage component with the encryption information to obtain an encryption key;
[0079] The shared file to be encrypted is encrypted using the encryption key and stored.
[0080] In this embodiment, the cloud platform also includes a key management storage component. After receiving the request to create an encrypted file storage and the shared file to be encrypted, it is first necessary to call the shared file storage interface to determine whether the request to create an encrypted file storage contains the custom key passed in by the user. In an optional embodiment, if a custom key exists, there is no need to use the encryption information corresponding to the encrypted shared file storage type to generate an encryption key, and the shared file can be directly encrypted using the custom key; at this time, the target file storage type in the request to create an encrypted file storage uploaded by the user cannot be an encrypted shared file storage type. If the user has passed in a custom key and also selected an encrypted shared file storage type, the shared file storage service will throw an error and the shared file encryption process cannot continue.
[0081] If the request to create an encrypted file storage does not contain the custom key passed in by the user, the shared file storage interface is called to query the file storage type database according to the target file storage type. After the encrypted shared file storage type corresponding to the target file storage type is queried, it is necessary to determine whether the shared file to be encrypted is a file created by the encrypted snapshot. In an optional embodiment, if the shared file to be encrypted is a file created by the encrypted snapshot, the source key identifier corresponding to the source encrypted snapshot can be directly cloned from the key management storage component, and the encryption key can be created using the source key identifier.
[0082] If the shared file to be encrypted is not a file created by the encrypted snapshot, the encryption information corresponding to the encrypted shared file storage type is used to create a key identifier, and the key identifier is stored in the key management storage component. The key identifier is bound to the encryption information to obtain the encryption key, and the encryption key is used to encrypt the shared file to be encrypted and store the shared file to be encrypted.
[0083] The embodiment of the present application allows users to provide custom keys by determining whether a custom key exists, thereby providing users with flexibility so that they can encrypt shared files according to their own security requirements and policies; by determining whether the shared file to be encrypted is a file created by an encrypted snapshot, the encryption process of files created by an encrypted snapshot is simplified.
[0084] In an optional embodiment of the present application, the method further includes:
[0085] If the request to create an encrypted file storage contains the custom key, calling the shared file storage interface to receive the request to create an encrypted file storage;
[0086] Storing the custom key in the request to create encrypted file storage into the key management storage component;
[0087] Obtaining the custom key from the key management storage component;
[0088] The shared file to be encrypted is encrypted using the custom key and stored.
[0089] In this embodiment, if the request to create an encrypted file storage contains a custom key passed in by the user, after calling the shared file storage interface to receive the request to create an encrypted file storage, the custom key is stored in the key management storage component. When encrypting and storing the shared file to be encrypted, the custom key is obtained from the key management storage component, and the shared file to be encrypted is encrypted and stored using the custom key.
[0090] The embodiments of the present application allow users to provide customized keys, thereby providing users with flexibility so that they can encrypt shared files on the cloud platform according to their own security requirements and policies.
[0091] In an optional embodiment of the present application, the file created by the encrypted snapshot has a corresponding source encrypted snapshot, and the source encrypted snapshot has a corresponding source key identifier, and the method further includes:
[0092] If the shared file to be encrypted is a file created by the encrypted snapshot, copying the source key identifier;
[0093] storing the source key identifier in the key management storage component;
[0094] Binding the source key identifier in the key management storage component with the encryption information to obtain an encryption key;
[0095] The shared file to be encrypted is encrypted using the encryption key and stored.
[0096] In this embodiment, if the shared file to be encrypted is a file created by an encrypted snapshot, the shared file to be encrypted will have a corresponding source encrypted snapshot, and the source encrypted snapshot already has a corresponding source key identifier. At this time, the source key identifier can be directly copied and stored in the key management storage component for subsequent encryption of the shared file to be encrypted. During encryption, the source key identifier in the key management storage component is bound to the encryption information corresponding to the encrypted shared file storage type to obtain an encryption key, which is used to encrypt the shared file to be encrypted and store the shared file to be encrypted.
[0097] The embodiment of the present application simplifies the encryption process of files created by encrypted snapshots and speeds up the encryption storage of shared files on the cloud platform by judging whether the shared file to be encrypted is a file created by an encrypted snapshot.
[0098] In an optional embodiment of the present application, the cloud platform further includes a storage backend driver, the storage backend driver is communicatively connected to the key management storage component, and the using of the encryption key to encrypt the shared file to be encrypted and store the shared file to be encrypted includes:
[0099] Invoking the storage backend driver to retrieve the encryption key in the key management storage component;
[0100] After obtaining the encryption key, controlling the storage backend driver to encrypt the shared file to be encrypted to obtain an encrypted shared file;
[0101] The encrypted shared file is stored.
[0102] In this embodiment, the cloud platform also includes a storage backend driver, which is in communication connection with the key management storage component, and the encryption and storage of shared files are actually completed by the storage backend driver.
[0103] In this embodiment, the storage backend driver is called through manila_scheduler (file storage scheduling service) and manila-share (file storage management service), so that the storage backend driver uses KMIP to communicate with the key management storage component and retrieve the encryption key in the key management storage component, so as to use the encryption key to encrypt the shared file to be encrypted in the storage backend, and store the encrypted shared file in the target file storage type.
[0104] The embodiment of the present application completes the encryption and storage of shared files through a storage backend driver, thereby realizing encryption management of shared file storage.
[0105] In an optional embodiment of the present application, the shared file storage type has a corresponding universal unique identifier, and associating the encryption information with the shared file storage type includes:
[0106] The encryption information is associated with the shared file storage type according to the universal unique identifier corresponding to the shared file storage type.
[0107] In this embodiment, the shared file storage type has a corresponding universally unique identifier (UUID). When associating the encrypted information with the shared file storage type, it is necessary to associate the encrypted information with the file storage type according to the UUID of the shared file storage type.
[0108] The embodiment of the present application achieves adding encryption information to an existing shared file storage type by associating encryption information with a shared file storage type according to a UUID, so that an encrypted shared file storage type can be directly created subsequently to encrypt shared data.
[0109] In an optional embodiment of the present application, the encrypted information at least includes
[0110] The size of the encryption key corresponding to the shared file storage type, the hardware implementation or software implementation that provides encryption support for the shared file storage type, the location of the encryption key control, and the encryption algorithm or encryption mode.
[0111] In this embodiment, the encryption information at least includes the size of the encryption key corresponding to the shared file storage type, the hardware implementation or software implementation that provides encryption support for the shared file storage type, the location of the encryption key control, and the encryption algorithm or encryption mode (cipher), etc. Among them, in some optional embodiments, the size of the encryption key is in bits, and the key length is generally 128 or 256 bits; the hardware implementation or software implementation that provides encryption support for the shared file storage type can be LUKS; the encryption algorithm or encryption mode can be set to aes-xts-plain64, sm4-xts-plain64, etc. The encrypted shared file storage type created using these encryption information is used to store shared files, and the shared file storage service will generate an encryption key with the help of the key management storage component for encrypting the shared files.
[0112] The embodiment of the present application sets encryption information, thereby realizing that when a shared file is encrypted, the encryption information is used to generate a key for encrypting the shared file.
[0113] In an embodiment of the present application, pre-set encryption information is obtained; the encryption information is associated with a shared file storage type to obtain an encrypted shared file storage type, and the encrypted shared file storage type is stored in a file storage type database; a request to create an encrypted file storage and a shared file to be encrypted are received, and the encrypted file storage request includes a target file storage type; the file storage type database is queried according to the target file storage type, and when the encrypted shared file storage type corresponding to the target file storage type is queried, a key identifier is created using the encryption information corresponding to the encrypted shared file storage type; the key identifier is bound to the encryption information to obtain an encryption key; the encryption key is used to encrypt the shared file to be encrypted to obtain an encrypted shared file, and the encrypted shared file is stored. The embodiment of the present application achieves encryption management of shared files by adding encryption information to an existing shared file storage type and creating an encrypted shared file storage type, thereby solving the problem that shared file storage cannot be encrypted based on the cloud platform, preventing data leakage, and improving data security and standardization.
[0114] The following will combine Figure 2 A schematic diagram of the steps of another shared file encryption method embodiment of the present application is provided, which describes the specific process of a shared file encryption method of an embodiment of the present application so that those skilled in the art can better understand the technical solution of a shared file encryption method of the present application.
[0115] Reference Figure 2 , showing a schematic diagram of the steps of another shared file encryption method embodiment of the present application.
[0116] like Figure 2 As shown, when setting the encrypted shared file storage type, you first need to select the shared file storage type and enter the encryption information. After associating the encryption information with the shared file storage type, you get the encrypted shared file storage type, and store the encrypted shared file storage type in the file storage type database. When the user needs to create an encrypted shared file storage, first select the target file storage type actually needed to create the file storage, and send a request to create an encrypted file storage and the shared file to be encrypted. According to the target file storage type in the request to create an encrypted file storage, read the corresponding encryption information from the file storage type database, and call the key management storage component (key manager, key manager; such as Barbican, etc.) to obtain the key identifier; or directly obtain the user-defined key. The key identifier is stored in the key management storage component and bound to the encryption information to obtain the encryption key, and the encryption key is used to encrypt and store the shared data in the storage backend.
[0117] In an embodiment of the present application, pre-set encryption information is obtained; the encryption information is associated with a shared file storage type to obtain an encrypted shared file storage type, and the encrypted shared file storage type is stored in a file storage type database; a request to create an encrypted file storage and a shared file to be encrypted are received, and the encrypted file storage request includes a target file storage type; the file storage type database is queried according to the target file storage type, and when the encrypted shared file storage type corresponding to the target file storage type is queried, a key identifier is created using the encryption information corresponding to the encrypted shared file storage type; the key identifier is bound to the encryption information to obtain an encryption key; the encryption key is used to encrypt the shared file to be encrypted to obtain an encrypted shared file, and the encrypted shared file is stored. The embodiment of the present application achieves encryption management of shared files by adding encryption information to an existing shared file storage type and creating an encrypted shared file storage type, thereby solving the problem that shared file storage cannot be encrypted based on the cloud platform, preventing data leakage, and improving data security and standardization.
[0118] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described order of actions, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.
[0119] On the basis of the above embodiments, this embodiment further provides a shared file encryption device, which is applied to electronic devices such as terminal devices and servers.
[0120] Reference Figure 3 , shows a structural block diagram of an embodiment of a shared file encryption device of the present application, which may specifically include the following modules:
[0121] The encryption information acquisition module 301 is used to acquire the preset encryption information;
[0122] An encrypted shared file storage type acquisition module 302 is used to associate the encryption information with the shared file storage type to obtain the encrypted shared file storage type, and store the encrypted shared file storage type in the file storage type database;
[0123] The encryption request receiving module 303 is used to receive a request to create an encrypted file storage and a shared file to be encrypted, wherein the request to create an encrypted file storage includes a target file storage type;
[0124] A key identifier creation module 304 is used to query the file storage type database according to the target file storage type, and when the encrypted shared file storage type corresponding to the target file storage type is queried, create a key identifier using the encryption information corresponding to the encrypted shared file storage type;
[0125] An encryption key creation module 305 is used to bind the key identifier with the encryption information to obtain an encryption key;
[0126] The encrypted shared file storage module 306 is used to encrypt the shared file to be encrypted using the encryption key to obtain an encrypted shared file, and store the encrypted shared file.
[0127] In an optional embodiment of the present application, the cloud platform further includes a key management storage component, and the device further includes:
[0128] A custom key determination module, used for calling the shared file storage interface to determine whether the request for creating an encrypted file storage contains a custom key;
[0129] A database query module, configured to call the shared file storage interface to query the file storage type database according to the target file storage type if the request to create an encrypted file storage does not contain the custom key;
[0130] A snapshot judgment module, configured to judge whether the shared file to be encrypted is a file created by an encrypted snapshot when the encrypted shared file storage type corresponding to the target file storage type is queried;
[0131] an identifier creation module, configured to create a key identifier using the encryption information corresponding to the encrypted shared file storage type if the shared file to be encrypted is not a file created by the encrypted snapshot;
[0132] An identifier storage module, in which a user stores the key identifier into the key management storage component;
[0133] An identifier binding module, used to bind the key identifier in the key management storage component with the encryption information to obtain an encryption key;
[0134] The encryption storage module is used to encrypt the shared file to be encrypted using the encryption key and store the shared file to be encrypted.
[0135] In an optional embodiment of the present application, the device further includes:
[0136] A custom key receiving module, configured to, if the request to create an encrypted file storage contains the custom key, call the shared file storage interface to receive the request to create an encrypted file storage;
[0137] A custom key storage module, used for storing the custom key in the request to create encrypted file storage into the key management storage component;
[0138] A custom key acquisition module, used to acquire the custom key from the key management storage component;
[0139] The custom key encryption module is used to encrypt the shared file to be encrypted using the custom key and store the shared file to be encrypted.
[0140] In an optional embodiment of the present application, the file created by the encrypted snapshot has a corresponding source encrypted snapshot, the source encrypted snapshot has a corresponding source key identifier, and the device further includes:
[0141] a source key identifier copying module, configured to copy the source key identifier if the shared file to be encrypted is a file created by the encrypted snapshot;
[0142] A source key identifier storage module, used to store the source key identifier in the key management storage component;
[0143] A source key identifier binding module, used to bind the source key identifier in the key management storage component with the encryption information to obtain an encryption key;
[0144] The source key identifier encryption module is used to encrypt the shared file to be encrypted using the encryption key and store the shared file to be encrypted.
[0145] In an optional embodiment of the present application, the cloud platform further includes a storage backend driver, the storage backend driver is communicatively connected to the key management storage component, and the encrypted shared file storage module 306 is further used to:
[0146] Invoking the storage backend driver to retrieve the encryption key in the key management storage component;
[0147] After obtaining the encryption key, controlling the storage backend driver to encrypt the shared file to be encrypted to obtain an encrypted shared file;
[0148] The encrypted shared file is stored.
[0149] In an optional embodiment of the present application, the shared file storage type has a corresponding universal unique identifier, and the encrypted shared file storage type acquisition module 302 is further used to:
[0150] The encryption information is associated with the shared file storage type according to the universal unique identifier corresponding to the shared file storage type.
[0151] In an optional embodiment of the present application, the encrypted information at least includes
[0152] The size of the encryption key corresponding to the shared file storage type, the hardware implementation or software implementation that provides encryption support for the shared file storage type, the location of the encryption key control, and the encryption algorithm or encryption mode.
[0153] In an embodiment of the present application, pre-set encryption information is obtained; the encryption information is associated with a shared file storage type to obtain an encrypted shared file storage type, and the encrypted shared file storage type is stored in a file storage type database; a request to create an encrypted file storage and a shared file to be encrypted are received, and the encrypted file storage request includes a target file storage type; the file storage type database is queried according to the target file storage type, and when the encrypted shared file storage type corresponding to the target file storage type is queried, a key identifier is created using the encryption information corresponding to the encrypted shared file storage type; the key identifier is bound to the encryption information to obtain an encryption key; the encryption key is used to encrypt the shared file to be encrypted to obtain an encrypted shared file, and the encrypted shared file is stored. The embodiment of the present application achieves encryption management of shared files by adding encryption information to an existing shared file storage type and creating an encrypted shared file storage type, thereby solving the problem that shared file storage cannot be encrypted based on the cloud platform, preventing data leakage, and improving data security and standardization.
[0154] The embodiment of the present application also provides a non-volatile readable storage medium, which stores one or more modules (programs). When the one or more modules are applied to a device, the device can execute instructions (instructions) of each method step in the embodiment of the present application.
[0155] The present application embodiment provides one or more machine-readable media on which instructions are stored, and when executed by one or more processors, an electronic device executes one or more of the methods described in the above embodiments. In the present application embodiment, the electronic device includes various types of devices such as terminal devices and servers (clusters).
[0156] The embodiments of the present disclosure may be implemented as a device configured as desired using any appropriate hardware, firmware, software, or any combination thereof, and the device may include electronic devices such as terminal devices and servers (clusters). Figure 4 An exemplary apparatus 400 that may be used to implement various embodiments described in this application is schematically illustrated.
[0157] For one embodiment, Figure 4 An exemplary apparatus 400 is shown having one or more processors 402, a control module (chip set) 404 coupled to at least one of the processor(s) 402, a memory 406 coupled to the control module 404, a non-volatile memory (NVM) / storage device 408 coupled to the control module 404, one or more input / output devices 410 coupled to the control module 404, and a network interface 412 coupled to the control module 404.
[0158] The processor 402 may include one or more single-core or multi-core processors, and the processor 402 may include any combination of general-purpose processors or special-purpose processors (such as graphics processors, application processors, baseband processors, etc.). In some embodiments, the device 400 can be used as a terminal device, server (cluster), etc. described in the embodiments of the present application.
[0159] In some embodiments, the apparatus 400 may include one or more computer-readable media (e.g., memory 406 or NVM / storage device 408) having instructions 414 and one or more processors 402 combined with the one or more computer-readable media and configured to execute the instructions 414 to implement a module to perform the actions described in the present disclosure.
[0160] For one embodiment, control module 404 may include any suitable interface controller to provide any suitable interface to at least one of processor(s) 402 and / or any suitable device or component in communication with control module 404 .
[0161] The control module 404 may include a memory controller module to provide an interface to the memory 406. The memory controller module may be a hardware module, a software module, and / or a firmware module.
[0162] The memory 406 may be used, for example, to load and store data and / or instructions 414 for the device 400. For one embodiment, the memory 406 may include any suitable volatile memory, such as a suitable DRAM. In some embodiments, the memory 406 may include a double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).
[0163] For one embodiment, control module 404 may include one or more input / output controllers to provide interfaces to NVM / storage device 408 and input / output device(s) 410 .
[0164] For example, NVM / storage 408 may be used to store data and / or instructions 414. NVM / storage 408 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable non-volatile storage device(s) (e.g., one or more hard disk drives (HDDs), one or more compact disk (CD) drives, and / or one or more digital versatile disk (DVD) drives).
[0165] NVM / storage device 408 may include storage resources that are physically part of the device on which apparatus 400 is installed, or it may be accessible to the device without being part of the device. For example, NVM / storage device 408 may be accessed via input / output device(s) 410 over a network.
[0166] (One or more) input / output devices 410 may provide an interface for the apparatus 400 to communicate with any other appropriate device, and the input / output device 410 may include a communication component, an audio component, a sensor component, etc. The network interface 412 may provide an interface for the apparatus 400 to communicate through one or more networks, and the apparatus 400 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and / or protocols, for example, accessing a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, etc., or a combination thereof for wireless communication.
[0167] For one embodiment, at least one of the processor(s) 402 may be packaged together with the logic of one or more controllers (e.g., a memory controller module) of the control module 404. For one embodiment, at least one of the processor(s) 402 may be packaged together with the logic of one or more controllers of the control module 404 to form a system-in-package (SiP). For one embodiment, at least one of the processor(s) 402 may be integrated on the same die with the logic of one or more controllers of the control module 404. For one embodiment, at least one of the processor(s) 402 may be integrated on the same die with the logic of one or more controllers of the control module 404 to form a system-on-chip (SoC).
[0168] In various embodiments, the device 400 may be, but is not limited to, a terminal device such as a server, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet computer, a netbook, etc.). In various embodiments, the device 400 may have more or fewer components and / or different architectures. For example, in some embodiments, the device 400 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an application-specific integrated circuit (ASIC), and a speaker.
[0169] Among them, the main control chip can be used as a processor or control module in the detection device, sensor data, location information, etc. are stored in a memory or NVM / storage device, the sensor group can be used as an input / output device, and the communication interface may include a network interface.
[0170] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0171] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0172] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable shared file encryption terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable shared file encryption terminal device generate instructions for implementing the processes in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0173] These computer program instructions may also be stored in a computer-readable memory that can guide a computer or other programmable shared file encryption terminal device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which is implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0174] These computer program instructions can also be loaded onto a computer or other programmable shared file encryption terminal device, so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0175] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0176] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0177] The above is a detailed introduction to a shared file encryption method and device, an electronic device and a storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A shared file encryption method, characterized in that: Applied to a cloud platform, the shared file is stored in the cloud platform, the cloud platform includes a file storage type database, and the method includes: Get the pre-set encryption information; Associating the encryption information with the shared file storage type to obtain the encrypted shared file storage type, and storing the encrypted shared file storage type in the file storage type database; Receiving a request for creating an encrypted file storage and a shared file to be encrypted, wherein the request for creating an encrypted file storage includes a target file storage type; Querying the file storage type database according to the target file storage type, and when the encrypted shared file storage type corresponding to the target file storage type is found, creating a key identifier using the encryption information corresponding to the encrypted shared file storage type; Binding the key identifier with the encryption information to obtain an encryption key; The encryption key is used to encrypt the shared file to obtain an encrypted shared file, and the encrypted shared file is stored.
2. The method according to claim 1, characterized in that The cloud platform further includes a key management storage component, and after receiving the creation of an encrypted file storage request and a shared file to be encrypted, further includes: Calling the shared file storage interface to determine whether the request to create an encrypted file storage contains a custom key; If the request to create an encrypted file storage does not include the custom key, calling the shared file storage interface to query the file storage type database according to the target file storage type; When the encrypted shared file storage type corresponding to the target file storage type is queried, determining whether the shared file to be encrypted is a file created by an encrypted snapshot; If the shared file to be encrypted is not a file created by the encrypted snapshot, creating a key identifier using the encryption information corresponding to the encrypted shared file storage type; storing the key identifier in the key management storage component; Binding the key identifier in the key management storage component with the encryption information to obtain an encryption key; The shared file to be encrypted is encrypted using the encryption key and stored.
3. The method according to claim 2, characterized in that The method further comprises: If the request to create an encrypted file storage contains the custom key, calling the shared file storage interface to receive the request to create an encrypted file storage; Storing the custom key in the request to create encrypted file storage into the key management storage component; Obtaining the custom key from the key management storage component; The shared file to be encrypted is encrypted using the custom key and stored.
4. The method according to claim 2, characterized in that: The file created by the encrypted snapshot has a corresponding source encrypted snapshot, and the source encrypted snapshot has a corresponding source key identifier, and the method further includes: If the shared file to be encrypted is a file created by the encrypted snapshot, copying the source key identifier; storing the source key identifier in the key management storage component; Binding the source key identifier in the key management storage component with the encryption information to obtain an encryption key; The shared file to be encrypted is encrypted using the encryption key and stored.
5. The method according to claim 2, characterized in that: The cloud platform further includes a storage backend driver, the storage backend driver is in communication with the key management storage component, and the method of using the encryption key to encrypt the shared file to be encrypted and store the shared file to be encrypted includes: Invoking the storage backend driver to retrieve the encryption key in the key management storage component; After obtaining the encryption key, controlling the storage backend driver to encrypt the shared file to be encrypted to obtain an encrypted shared file; The encrypted shared file is stored.
6. The method according to claim 1, characterized in that The shared file storage type has a corresponding universal unique identifier, and associating the encrypted information with the shared file storage type includes: The encryption information is associated with the shared file storage type according to the universal unique identifier corresponding to the shared file storage type.
7. The method according to claim 1, characterized in that The encryption information includes at least the size of the encryption key corresponding to the shared file storage type, the hardware implementation or software implementation that provides encryption support for the shared file storage type, the location controlled by the encryption key, and the encryption algorithm or encryption mode.
8. A shared file encryption device, characterized in that: Applied to a cloud platform, the shared file is stored in the cloud platform, the cloud platform includes a file storage type database, and the device includes: An encryption information acquisition module is used to acquire preset encryption information; An encrypted shared file storage type acquisition module is used to associate the encryption information with the shared file storage type to obtain the encrypted shared file storage type, and store the encrypted shared file storage type in the file storage type database; An encryption request receiving module, used for receiving a request for creating an encrypted file storage and a shared file to be encrypted, wherein the request for creating an encrypted file storage includes a target file storage type; A key identifier creation module is used to query the file storage type database according to the target file storage type, and when the encrypted shared file storage type corresponding to the target file storage type is queried, create a key identifier using the encryption information corresponding to the encrypted shared file storage type; An encryption key creation module, used to bind the key identifier with the encryption information to obtain an encryption key; The encrypted shared file storage module is used to encrypt the shared file to be encrypted using the encryption key to obtain an encrypted shared file, and store the encrypted shared file.
9. An electronic device, characterized in that: include: processor; and A memory having executable codes stored thereon, which, when executed, enables the processor to execute the shared file encryption method as described in one or more of claims 1-7.
10. One or more machine-readable media having executable codes stored thereon, which, when executed, cause a processor to execute the shared file encryption method as described in one or more of claims 1-7.
