A non-intrusive method to improve data security in multi-tenant applications
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-05
- Publication Date
- 2026-08-14
AI Technical Summary
[0006]服务端加密的缺点有:其一,密钥由系统管理员设定,系统管理员可以查看所有租户的业务数据,这样无法保证业务数据的安全性;其二,使用设定的密钥对所有业务数据进行加密,一旦密钥泄露,所有业务数据的安全都出现问题
[0043]所述多租户应用下非侵入式提高数据安全方法,实现了多租户应用中敏感业务数据的安全保护,从密钥的生成到使用全过程管理,并通过非侵入方式集成现有的各个应用系统,体现了很好的移植性,有效的支持了敏感数据的加密解密应用。
Smart Images

Figure CN115964729B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for improving data security by employing multiple encryption algorithms for data encryption and decryption, and more particularly to a non-intrusive method for improving data security in multi-tenant applications. Background Technology
[0002] Software as a Service (SaaS) is a completely innovative software application model that emerged with the development of internet technology and the maturity of application software. It's a model where operators deploy application software uniformly on their own servers. The core technology of SaaS applications is multi-tenancy, which means multiple tenants share a single instance. Tenant data is both isolated and shared, thus solving the data storage problem. Tenants do not want their business data to be viewed by others, including operators and other tenants, without authorization, especially sensitive business data.
[0003] Regarding data security issues, data encryption is the most effective solution for preventing data leakage in ordinary systems. However, these technologies are all designed for data encryption in single-tenant mode and cannot meet the needs of data isolation and independent control of data encryption in multi-tenant scenarios.
[0004] Currently, most applications that encrypt and decrypt sensitive business data face the following two problems:
[0005] (1) Currently, server-side encryption is commonly used to encrypt business data. Server-side encryption means using the encryption function provided by the server, with the system administrator setting the encryption key, and using the same key to encrypt all business data.
[0006] The disadvantages of server-side encryption are: First, the key is set by the system administrator, who can view all tenants' business data, which makes it impossible to guarantee the security of the business data; Second, if the set key is used to encrypt all business data, the security of all business data will be compromised if the key is leaked.
[0007] (2) Existing data encryption usually involves modifying the core code logic of the application to integrate the data encryption service into the system, resulting in tight coupling between business applications and data encryption services. Summary of the Invention
[0008] This invention provides a non-intrusive method for improving data security in multi-tenant applications, solving the problem of security protection for sensitive business data in multi-tenant applications. The technical solution is as follows:
[0009] A non-intrusive method for improving data security in multi-tenant applications includes the following steps:
[0010] S100: Create a new tenant's tenant administrator and identity password, and generate a public key and a public first-level private key for encryption and decryption for the new tenant. Use the tenant administrator's identity password to perform secondary encryption on the tenant's public first-level private key to generate a public second-level private key.
[0011] S200: The tenant administrator creates other regular users belonging to the tenant through the client and sets the passwords for these regular users;
[0012] S300: Configure encryption / decryption services using the business data operation interface as the aspect;
[0013] S400: Ordinary users encrypt business data to be uploaded using a public key. The server records the use of the public key and saves the encrypted business data to the database.
[0014] S500: If a regular user needs to view sensitive business data, they must apply to the tenant administrator. The tenant administrator will then generate the tenant's primary private key and secondary private key based on the regular user's application.
[0015] S600: Ordinary users can decrypt the tenant's secondary private key to obtain the tenant's primary private key, decrypt the tenant's primary private key to obtain the public primary private key, and use the public primary private key to decrypt encrypted data and view business data.
[0016] Furthermore, in step S100, the steps of creating a new tenant's tenant administrator and identity password, and generating a public secondary private key are as follows:
[0017] S101: The system creates a tenant administrator and uses the SM2 algorithm to generate an asymmetric encryption public key and a public-level private key; the public key is used to encrypt data, and the public-level private key is used to decrypt encrypted data.
[0018] S102: The system then uses the plaintext of the tenant administrator's identity password to generate a public secondary private key for SM4 symmetric encryption, and encrypts the tenant administrator's identity password using the SM3 irreversible encryption algorithm;
[0019] S103: The system saves the public secondary private key and public key to the database, which serve as the public secondary private key and public key held by the tenant administrator.
[0020] Furthermore, in step S500, the steps by which the tenant administrator generates the tenant's primary private key and secondary private key for the ordinary user are as follows:
[0021] S501: A regular user submits an authorization request to view sensitive business data;
[0022] S502: Tenant administrators approve applications submitted by regular users;
[0023] S503: After approval, ordinary users are authorized to decrypt, and tenant administrators use their identity password to decrypt the public secondary private key to obtain the public primary private key;
[0024] S504: The tenant administrator uses the user's unique identifier plus the validity period to encrypt the public first-level private key to generate the tenant's first-level private key; then, the tenant administrator uses the plaintext of the user's password to encrypt the newly generated tenant first-level private key again to generate the tenant second-level private key.
[0025] S505: The system stores the generated tenant secondary private key and authorization information in the database.
[0026] Furthermore, in step S501, the authorization application includes the unique identifier of the ordinary user, the time period for requesting to view sensitive business data, and the reason for the request.
[0027] Furthermore, in step S600, the steps for a regular user to decrypt the tenant's secondary private key and primary private key are as follows:
[0028] S601: The system queries authorization information to determine whether a regular user has permission to view sensitive business data;
[0029] S602: The system obtains the application authorization information of ordinary users through the authentication service. If the ordinary user has viewing permission, the system uses the ordinary user's identity password to decrypt the tenant's secondary private key to obtain the tenant's primary private key; and uses the ordinary user's unique identifier plus the validity period to decrypt the tenant's primary private key to obtain the public primary private key.
[0030] S603: If the user identifier and the data decryption request period are still valid, the decrypted public-level private key is used to decrypt the sensitive business data to obtain the plaintext of the sensitive business data for ordinary users to view.
[0031] Furthermore, in step S602, the system also needs to determine the unique identifier of the user requesting to view sensitive data and the time period for requesting data decryption recorded in the authentication service. Only ordinary users within the validity period can perform the decryption operation.
[0032] Furthermore, in step S300, an encryption / decryption service is configured with the business data operation interface as the aspect, including the following: before the execution of the business data addition and modification operations, a data encryption / decryption service is added to encrypt sensitive business data; after the execution of the business data retrieval operation, a data decryption service is added with the business data query interface as the aspect to decrypt sensitive business data; and log information of data encryption and decryption service calls is added to each aspect.
[0033] Furthermore, the multi-tenant application system corresponding to this method involves a user side and a service side. The user side includes a user client, and the service side includes authentication services, management services, business services, encryption services, AOP services, and storage services. The user client is connected to the authentication service and the business service, wherein:
[0034] Authentication service: used to verify the identity and password of the user belonging to the tenant, to verify the identity and password of the tenant administrator, and to verify the authorization information of the tenant administrator to the user;
[0035] The management service allows users to designate an existing user under the same tenant as a tenant administrator via the client. The tenant administrator can also create other users belonging to the same tenant and set their passwords via the client.
[0036] Business services are used to generate business data and perform logical processing on that data.
[0037] Encryption / decryption service is used to generate a public key and a public first-level private key for the tenant, a public second-level private key for the tenant administrator, and to generate a tenant first-level private key, a tenant second-level private key, and corresponding decryption for ordinary users;
[0038] AOP service is used to configure encryption / decryption services for business services;
[0039] Storage services are used to store business data, as well as user identity data for each user.
[0040] In the authentication service, the authorization information refers to the permission granted by the tenant administrator to users to decrypt sensitive data within a specified time period.
[0041] The encryption / decryption service can encrypt the public primary private key to generate a public secondary private key based on the identity password of the tenant administrator, encrypt the public primary private key to generate a tenant primary private key based on the unique identity identifier and authorized decryption period of the authorized decryption user, and encrypt the tenant primary private key to generate a tenant secondary private key based on the user password of the authorized decryption user.
[0042] The proposed non-intrusive data security enhancement method for multi-tenant applications involves generating an asymmetric data key for encrypting and decrypting business data for that tenant during tenant creation, creating at least one user belonging to that tenant, and setting a password for that user. The data key is then encrypted using the password of the at least one user belonging to that tenant. When the tenant stores relevant business data, sensitive data for that business is encrypted using the data key generated for that tenant, allowing the at least one user to retrieve the decrypted sensitive business data using the decrypted data key. Furthermore, this method does not require modification of the core functionality implementation code in the application system; the encryption and decryption service can be used by the application system through configuration, while simultaneously managing the entire process from key generation to usage.
[0043] The non-intrusive data security enhancement method for multi-tenant applications achieves secure protection of sensitive business data in multi-tenant applications, manages the entire process from key generation to use, and integrates with existing application systems in a non-intrusive manner, demonstrating excellent portability and effectively supporting the encryption and decryption of sensitive data. Attached Figure Description
[0044] Figure 1 This is an architecture diagram of the multi-tenant application system corresponding to the non-intrusive data security enhancement method in the multi-tenant application described above;
[0045] Figure 2 This is a flowchart illustrating the non-intrusive method for improving data security in multi-tenant applications.
[0046] Figure 3 This is a flowchart illustrating the key generation method.
[0047] Figure 4 This is a flowchart illustrating the method for authorizing the viewing of sensitive business data.
[0048] Figure 5 This is a flowchart illustrating the method for viewing sensitive business data. Detailed Implementation
[0049] The preferred embodiments of the present invention are described below. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0050] like Figure 1 In one implementation example shown, the multi-tenant application system corresponding to the method of this invention involves a user side and a service side. The user side includes a user terminal 10, and the service side includes an authentication service 20, a management service 30, a business service 40, an encryption service 50, an AOP service 60, and a storage service 70. The user terminal 10 is connected to the authentication service 20 and the business service 40, wherein:
[0051] The authentication service 20 is used to verify the identity and password of the user belonging to the tenant, to verify the identity and password of the tenant administrator, and to verify the authorization information of the tenant administrator to the user, wherein the authorization information refers to the user's authorization by the tenant administrator to have decryption rights to sensitive data within a specified time period.
[0052] Management service 30 is used to create a unique ID for the tenant administrator as a unique identifier of the tenant administrator's identity, and to set the identity password for the tenant administrator, as well as to create a unique ID for the user as a unique identifier of the user's identity. Specifically, the user terminal 10 can designate a user under the existing tenant in the system as the tenant administrator; the tenant administrator can also create other users belonging to the tenant through the user terminal 10 and set the user password for that user; to ensure the non-intrusive nature of this patent.
[0053] Business service 40 is used to generate business data and perform logical processing on the business data;
[0054] Encryption / decryption service 50 is used to generate a key for the tenant (the key includes a public key for encrypting business data and a public first-level private key for decrypting data), and to encrypt the public first-level private key to generate a public second-level private key based on the identity password of the tenant administrator, and to generate a tenant first-level private key and a tenant second-level private key for users under the tenant with authorized decryption permissions (the public first-level private key is encrypted based on the unique identity identifier and authorized decryption period of the authorized decryption user to generate the tenant first-level private key, and the tenant second-level private key is encrypted based on the user password of the authorized decryption user). When the tenant saves relevant business data, the service encrypts sensitive data in the business data according to the public key generated for the tenant to generate ciphertext, and when it is determined that at least one user has obtained the decrypted tenant second-level private key, the service decrypts the ciphertext of the business data and provides the user with the plaintext of the business data.
[0055] AOP service 60 is used to configure encryption / decryption service 50 for business service 40. Taking the business data operation interface as the aspect, data encryption / decryption service 50 is added before the method execution to encrypt the business data. Taking the business data query interface as the aspect, data encryption / decryption service 50 is added before the method execution to decrypt sensitive business data. Log information of data encryption and decryption service calls is added to each aspect.
[0056] Storage service 70 is used to store business data and user identity data of each user, including the administrator's public secondary private key and the tenant secondary private key authorized to decrypt users.
[0057] like Figure 2As shown, the non-intrusive method for improving data security in multi-tenant applications provided by this invention specifically includes the following steps:
[0058] S100: When creating a new tenant, the system creates the tenant's tenant administrator and identity password, and generates a public key and a public-level private key for encryption and decryption. The public key is used to encrypt data, and the public-level private key is used to decrypt ciphertext.
[0059] The system uses the tenant administrator's identity password to perform secondary encryption on the tenant's public first-level private key to generate a public second-level private key, which is then saved to the database.
[0060] Combination Figure 3 As shown, step S100 includes the following sub-steps:
[0061] S101: When creating a tenant administrator, the system uses the SM2 algorithm to generate an asymmetric encryption public key and a public-level private key; the public key is used to encrypt data, and the public-level private key is used to decrypt encrypted data.
[0062] S102: The system then uses the plaintext of the tenant administrator's identity password to generate a public secondary private key for SM4 symmetric encryption, and encrypts the tenant administrator's identity password using the SM3 irreversible encryption algorithm.
[0063] S103: The system saves the public secondary private key and public key to the database, which serve as the public secondary private key and public key held by the tenant administrator.
[0064] In the above embodiments, the SM2, SM3, and SM4 algorithms are merely examples. Depending on the specific application environment, other asymmetric encryption algorithms may be used instead of the SM2 algorithm, other symmetric encryption algorithms may be used instead of the SM4 algorithm, and other irreversible encryption algorithms may be used instead of the SM3 algorithm. These will not be elaborated further here.
[0065] S200: The tenant administrator creates other ordinary users belonging to the tenant through client 10 and sets the passwords for the ordinary users.
[0066] When the system creates a new tenant through authentication service 20, it needs to create or designate at least one user as the tenant administrator and set the identity password of the tenant administrator.
[0067] Then, the tenant administrator creates other ordinary users through client 10 and sets the passwords for the ordinary users. The identity password of the tenant administrator and the user passwords are both encrypted using an irreversible encryption algorithm and stored in the database.
[0068] S300: Configure encryption / decryption service 50. Taking the business data operation interface as the aspect, add data encryption / decryption service 50 before the execution of business data addition and modification operations to encrypt sensitive business data. Taking the business data query interface as the aspect, add data decryption service after the execution of business data retrieval operations to decrypt sensitive business data. Add log information of data encryption and decryption service calls to each aspect.
[0069] The ordinary user uses a public key to encrypt the data and stores the encrypted data. When performing decryption operations later, the encryption / decryption service 50 is called, and the relevant logs are also saved.
[0070] S400: Ordinary users encrypt business data to be uploaded using a public key. The server records the use of the public key and saves the encrypted business data to the database.
[0071] S500: When a regular user requests to view sensitive business data, the user must apply to the tenant administrator before viewing the decrypted data. The application includes the user's unique identifier and the time period for which the user requests to view the decrypted data. The tenant administrator, upon approval of the user's application, grants the user permission to decrypt the data within the specified time. The administrator then issues the user a public first-level private key for viewing the data and uses the user's unique identifier, the public first-level private key, and the decryption time period to generate the user's tenant first-level private key. Finally, the tenant first-level private key is encrypted using the user's plaintext password to generate the user's tenant second-level private key, which is then saved to the database. The administrator also records the user's use of the key.
[0072] Combination Figure 4 As shown, step S500 includes the following sub-steps:
[0073] S501: A regular user submits an authorization request to view sensitive business data; the request includes the regular user's unique identifier, the time period for which the sensitive business data is requested to be viewed, and the reason for the request.
[0074] S502: Tenant administrators approve applications submitted by regular users;
[0075] S503: After approval, ordinary users are authorized to decrypt, and tenant administrators use their identity password to decrypt the public secondary private key to obtain the public primary private key.
[0076] S504: The tenant administrator uses the user's unique identifier plus the validity period of the ordinary user to encrypt the public first-level private key to generate the tenant's first-level private key; then, the ordinary user's plaintext password is used to encrypt the newly generated tenant's first-level private key again to generate the tenant's second-level private key.
[0077] S505: The system stores the tenant's secondary private key and authorization information generated in S504 in the database.
[0078] S600: Ordinary users use their user password to decrypt their own tenant secondary private key to obtain the tenant primary private key. Then, based on their unique identifier and the time period for requesting decryption, they decrypt the obtained tenant primary private key to obtain the public primary private key. The public primary private key is then used to decrypt encrypted data and view business data.
[0079] 5 combinations Figure 5 As shown, step S600 includes the following sub-steps:
[0080] S601: The system queries authorization information to determine whether a regular user has permission to view sensitive business data;
[0081] S602: The system obtains the authorization information requested by ordinary users through authentication service 20. If ordinary users...
[0082] If a user has viewing permissions, the system uses the ordinary user's identity and password to decrypt the tenant's secondary private key to obtain the tenant's primary private key. Then, it uses the ordinary user's unique identifier plus a validity period to decrypt the tenant's primary private key.
[0083] Decryption is performed to obtain the public-level private key;
[0084] At the same time, the system also needs to determine the unique identifier of the user who applied to view sensitive data and the time period for the data decryption application recorded in the authentication service 20. Only ordinary users within the validity period can perform the decryption operation.
[0085] S603: If the user identifier and the data period for which decryption is requested are still valid, the sensitive business data will be decrypted using the decrypted primary private key to obtain the plaintext of the sensitive business data for ordinary users to view.
[0086] The non-intrusive method for improving data security in multi-tenant applications provided by this invention has the following characteristics:
[0087] (1) A two-level key system is adopted to enhance the security of the key. Users of the tenant application can apply for a key to view the business data. The tenant administrator confirms and distributes the key and records the user’s use of the key. Sensitive data is encrypted and decrypted using encryption algorithms.
[0088] (2) Non-immersion encryption and decryption services are provided. Data encryption and decryption services are injected into the original application system by using aspect-oriented programming, without modifying the original system code.
[0089] This invention supports data encryption and decryption for existing or newly built applications in a multi-tenant environment. It employs multiple key methods to ensure the security of data transmission and access, and integrates into the existing application system framework using aspect-oriented programming, thereby providing non-intrusive data encryption and decryption services.
Claims
1. A non-intrusive method for improving data security in multi-tenant applications, comprising the following steps: S100: Create a new tenant's tenant administrator and identity password, and generate a public key and a public first-level private key for encryption and decryption for the new tenant. Use the tenant administrator's identity password to perform secondary encryption on the tenant's public first-level private key to generate a public second-level private key. S200: The tenant administrator creates other regular users belonging to the tenant through the client and sets the passwords for these regular users; S300: Configure encryption / decryption services using the business data operation interface as the aspect; S400: Ordinary users encrypt business data to be uploaded using a public key. The server records the use of the public key and saves the encrypted business data to the database. S500: If a regular user needs to view sensitive business data, they must apply to the tenant administrator. The tenant administrator will then generate the tenant's primary private key and secondary private key based on the regular user's application. S600: Ordinary users decrypt the tenant's secondary private key to obtain the tenant's primary private key, decrypt the tenant's primary private key to obtain the public primary private key, and use the public primary private key to decrypt encrypted data and view business data. In step S500, the steps by which the tenant administrator generates the tenant's primary private key and secondary private key for the ordinary user are as follows: S501: A regular user submits an authorization request to view sensitive business data; the authorization request includes the regular user's unique identifier, the time period for which the sensitive business data is requested to be viewed, and the reason for the request; S502: Tenant administrators approve applications submitted by regular users; S503: After approval, ordinary users are authorized to decrypt, and tenant administrators use their identity password to decrypt the public secondary private key to obtain the public primary private key; S504: The tenant administrator uses the user's unique identifier plus the validity period to encrypt the public first-level private key to generate the tenant's first-level private key; then, the tenant administrator uses the plaintext of the user's password to encrypt the newly generated tenant first-level private key again to generate the tenant second-level private key. S505: The system stores the generated tenant secondary private key and authorization information in the database.
2. The non-intrusive method for improving data security in multi-tenant applications according to claim 1, characterized in that: In step S100, the steps for creating a new tenant's tenant administrator and identity password, and generating a public secondary private key are as follows: S101: The system creates a tenant administrator and uses the SM2 algorithm to generate an asymmetric encryption public key and a public-level private key; the public key is used to encrypt data, and the public-level private key is used to decrypt encrypted data. S102: The system then uses the plaintext of the tenant administrator's identity password to generate a public secondary private key for SM4 symmetric encryption, and encrypts the tenant administrator's identity password using the SM3 irreversible encryption algorithm; S103: The system saves the public secondary private key and public key to the database, which serve as the public secondary private key and public key held by the tenant administrator.
3. The non-intrusive method for improving data security in multi-tenant applications according to claim 1, characterized in that: In step S600, the steps for a regular user to decrypt the tenant's secondary private key and primary private key are as follows: S601: The system queries authorization information to determine whether a regular user has permission to view sensitive business data; S602: The system obtains the application authorization information of ordinary users through the authentication service. If the ordinary user has viewing permission, the system uses the ordinary user's identity password to decrypt the tenant's secondary private key to obtain the tenant's primary private key; and uses the ordinary user's unique identifier plus the validity period to decrypt the tenant's primary private key to obtain the public primary private key. S603: If the user identifier and the data decryption request period are still valid, the decrypted public-level private key is used to decrypt the sensitive business data to obtain the plaintext of the sensitive business data for ordinary users to view.
4. The non-intrusive method for improving data security in multi-tenant applications according to claim 3, characterized in that: In step S602, the system also needs to determine the unique identifier of the user who applied to view sensitive data and the time period for applying to decrypt data, which are recorded in the authentication service. Only ordinary users within the validity period can perform the decryption operation.
5. The non-intrusive method for improving data security in multi-tenant applications according to claim 1, characterized in that: In step S300, an encryption / decryption service is configured using the business data operation interface as the aspect, including the following: before the execution of the business data addition and modification operations, a data encryption / decryption service is added to encrypt sensitive business data; after the execution of the business data retrieval operation, a data decryption service is added using the business data query interface as the aspect to decrypt sensitive business data; and log information of data encryption and decryption service calls is added to each aspect.
6. The non-intrusive method for improving data security in multi-tenant applications according to claim 1, characterized in that: The multi-tenant application system corresponding to this method involves a user side and a service side. The user side includes the user client, and the service side includes authentication service, management service, business service, encryption service, AOP service, and storage service. The user client is connected to the authentication service and business service, wherein: Authentication service: used to verify the identity and password of the user belonging to the tenant, to verify the identity and password of the tenant administrator, and to verify the authorization information of the tenant administrator to the user; The management service allows users to designate an existing user under the same tenant as a tenant administrator via the client. The tenant administrator can also create other users belonging to the same tenant and set their passwords via the client. Business services are used to generate business data and perform logical processing on that data. Encryption / decryption service is used to generate a public key and a public first-level private key for the tenant, a public second-level private key for the tenant administrator, and to generate a tenant first-level private key, a tenant second-level private key, and corresponding decryption for ordinary users; AOP service is used to configure encryption / decryption services for business services; Storage services are used to store business data, as well as user identity data for each user.
7. The non-intrusive method for improving data security in multi-tenant applications according to claim 6, characterized in that: In the authentication service, the authorization information refers to the permission granted by the tenant administrator to users to decrypt sensitive data within a specified time period.
8. The non-intrusive method for improving data security in multi-tenant applications according to claim 6, characterized in that: The encryption / decryption service can encrypt the public primary private key to generate a public secondary private key based on the identity password of the tenant administrator, encrypt the public primary private key to generate a tenant primary private key based on the unique identity identifier and authorized decryption period of the authorized decryption user, and encrypt the tenant primary private key to generate a tenant secondary private key based on the user password of the authorized decryption user.
Citation Information
Patent Citations
Open authorization method, open authorization system and authentication and authorization server
CN103795692A
Non-immersive data encryption and decryption method based on multiple encryption algorithms
CN112583809A