CN-122002276-A - Mobile phone number management method, device, equipment and storage medium
Abstract
The present disclosure provides a method, a device and a storage medium for managing mobile phone numbers, wherein the method is used for encrypting and storing mobile phone numbers, and comprises the steps of obtaining an encryption key of a mobile phone number to be encrypted currently from a key bank, encrypting the mobile phone number by using the encryption key, and generating ciphertext data of the mobile phone number; and constructing an index for the mobile phone number ciphertext data, and synchronously storing the mobile phone number ciphertext data and the index. Compared with the traditional encrypted mobile phone number ciphertext cannot be subjected to fuzzy matching directly, the technical scheme realizes the construction of the index of the mobile phone number ciphertext, further realizes the efficient fuzzy matching of the mobile phone number ciphertext under the condition that the original mobile phone number is not exposed, and improves the usability of the system.
Inventors
- YUAN YULONG
- SUN DEHUA
Assignees
- 北京嗨学网教育科技股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260210
Claims (9)
- 1. The mobile phone number management method is characterized by comprising the following steps of: Obtaining an encryption key of a mobile phone number to be encrypted currently from a key library, and encrypting the mobile phone number by using the encryption key to generate mobile phone number ciphertext data; and constructing an index for the mobile phone number ciphertext data, and synchronously storing the mobile phone number ciphertext data and the index.
- 2. The method of claim 1, wherein the encryption key is stored in the keystore by: acquiring an initial dynamic key which is randomly generated and the encryption key to be stored currently; combining the initial dynamic key and the encryption key to generate a dynamic key; And encrypting the dynamic key by adopting an asymmetric encryption algorithm, generating a final key and storing the final key as storage data into the key store.
- 3. The method of claim 1, wherein obtaining an encryption key for a current mobile phone number to be encrypted from a key store, and encrypting the mobile phone number using the encryption key, further comprises: Obtaining authority level data of the mobile phone number, selecting different encryption keys according to different authority levels, encrypting the mobile phone number under different authority levels by using the different encryption keys, and generating mobile phone number ciphertext data under different authority levels.
- 4. The method of claim 1, wherein the encryption key is used to encrypt the cell phone number using different masking rules.
- 5. The method according to any one of claims 1 to 4, wherein constructing an index to the phone number ciphertext data comprises: Performing slicing processing on the mobile phone number to obtain a plurality of data slices of the mobile phone number; and carrying out hash operation on each data slice, generating a hash value of each data slice, and taking the hash value as an index of the data slice.
- 6. The method of claim 5, wherein hashing each of the pieces of data comprises: Acquiring randomly generated disturbance factors; combining the disturbance factors with the data sheet to generate index features; And carrying out hash operation on the index features to obtain the hash value.
- 7. A mobile phone number management device, which is used for encrypting and storing a mobile phone number, and comprises: The mobile phone number encryption module is used for obtaining an encryption key of a mobile phone number to be encrypted currently from a key library, encrypting the mobile phone number by using the encryption key and generating mobile phone number ciphertext data; and the index constructing module constructs an index for the mobile phone number ciphertext data and synchronously stores the mobile phone number ciphertext data and the index.
- 8. A mobile phone number management apparatus, comprising: A processor; A memory for storing processor-executable instructions; wherein the processor is configured to implement the method of any one of claims 1 to 6 when executing the executable instructions.
- 9. A non-transitory computer readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the method of any of claims 1 to 6.
Description
Mobile phone number management method, device, equipment and storage medium Technical Field The disclosure relates to the technical field of data storage, and in particular relates to a mobile phone number management method, a device, equipment and a storage medium. Background In the existing user data management scene, the mobile phone number is used as core identification information of a user and is widely applied to business processes such as registration login, message notification, marketing recommendation and the like. In order to meet the supervision requirements and ensure the privacy of users, the mobile phone numbers are usually required to be stored in an encrypted mode. In the current data security system, personal information such as a mobile phone number is usually encrypted by an AES encryption algorithm and then stored, so that the original text cannot be reversely analyzed when a database is leaked. However, in service application, it is often required to perform query, matching, duplication removal or fuzzy search according to the mobile phone number (for example, locating the user according to the last four digits), but the conventional cipher text of the mobile phone number after AES encryption cannot be directly subjected to fuzzy matching. Therefore, how to realize efficient fuzzy matching of the mobile phone number in the ciphertext state without exposing the original mobile phone number is a technical problem to be solved urgently by those skilled in the art. Disclosure of Invention In view of this, the present disclosure provides a method, apparatus, device and storage medium for managing mobile phone numbers, where the method implements efficient fuzzy query in the state of mobile phone number ciphertext by constructing an index for the mobile phone number ciphertext encrypted by AES, thereby improving usability of the system. According to an aspect of the present disclosure, there is provided a method for managing a mobile phone number, configured to encrypt and store the mobile phone number, including: Obtaining an encryption key of a mobile phone number to be encrypted currently from a key library, and encrypting the mobile phone number by using the encryption key to generate mobile phone number ciphertext data; and constructing an index for the mobile phone number ciphertext data, and synchronously storing the mobile phone number ciphertext data and the index. In one possible implementation, when storing the encryption key in the keystore, the storing is performed by: acquiring an initial dynamic key which is randomly generated and the encryption key to be stored currently; combining the initial dynamic key and the encryption key to generate a dynamic key; And encrypting the dynamic key by adopting an asymmetric encryption algorithm, generating a final key and storing the final key as storage data into the key store. In one possible implementation manner, when an encryption key of a mobile phone number to be encrypted is obtained from a key store and the mobile phone number is encrypted by using the encryption key, the method further includes: Obtaining authority level data of the mobile phone number, selecting different encryption keys according to different authority levels, encrypting the mobile phone number under different authority levels by using the different encryption keys, and generating mobile phone number ciphertext data under different authority levels. In one possible implementation, when the encryption key is used to encrypt the mobile phone number, different mask rules are used to perform encryption processing. In one possible implementation manner, when constructing an index for the mobile phone number ciphertext data, the method includes: Performing slicing processing on the mobile phone number to obtain a plurality of data slices of the mobile phone number; and carrying out hash operation on each data slice, generating a hash value of each data slice, and taking the hash value as an index of the data slice. In one possible implementation manner, when performing a hash operation on each data slice, the method includes: Acquiring randomly generated disturbance factors; combining the disturbance factors with the data sheet to generate index features; And carrying out hash operation on the index features to obtain the hash value. According to a second aspect of the present disclosure, there is provided a mobile phone number management apparatus for encrypting and storing a mobile phone number, including: The mobile phone number encryption module is used for obtaining an encryption key of a mobile phone number to be encrypted currently from a key library, encrypting the mobile phone number by using the encryption key and generating mobile phone number ciphertext data; and the index constructing module constructs an index for the mobile phone number ciphertext data and synchronously stores the mobile phone number ciphertext data and the index. According to a third