Blockchain-based address book data encryption method and device, equipment, medium and product
By using blockchain-based hashing and digital certificate generation technologies, address book data is encrypted and stored on the blockchain, solving the problems of insufficient data security and poor traceability in traditional address book processing, and achieving data security and reliability.
Patent Information
- Application Number
- CN202411814170.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2044-12-10
AI Technical Summary
In the traditional OA office portal system address book processing, there are problems with insufficient data security and lack of traceability. In particular, data is easily lost and formatted inconsistently during the data collection process, affecting user data security and privacy protection.
A blockchain-based encryption method for address book data is adopted. Through hash preprocessing, digital certificate generation, and blockchain storage technology, the confidentiality and immutability of the data are ensured. Public and private keys are generated using hash algorithms and digital certificates to encrypt the address book data, and the certificates are uploaded to the blockchain for storage and management.
It implements encrypted protection for contact list data, ensuring data security and traceability, avoiding single points of failure and data tampering, and enhancing data reliability and availability.
Smart Images

Figure CN119544369B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data encryption technology, and in particular to a blockchain-based address book data encryption method, device, equipment, medium and product. Background Art
[0002] With the rapid development of the internet industry, user data and privacy are receiving increasing attention. Traditional OA (Office Office Portal) systems address book processing, due to the sensitivity of address book information, data loss during data collection, and inconsistent formats, have created bottlenecks in user data security and privacy protection.
[0003] Related technologies typically rely on APIs provided by the mobile operating system or third-party SDKs to obtain user contact data and perform deduplication, standardization, and cleansing to ensure data accuracy and consistency. However, this traditional data encryption approach suffers from issues such as insufficient security and a lack of traceability. Summary of the Invention
[0004] Based on this, it is necessary to provide a blockchain-based address book data encryption method, device, computer equipment, computer-readable storage medium and computer program product to address the technical problems of insufficient security and lack of traceability in the above-mentioned traditional data encryption practices.
[0005] In a first aspect, the present application provides a method for encrypting address book data based on blockchain, the method comprising:
[0006] Obtain the target user's address book data, perform hash preprocessing on the address book data, and obtain the preprocessed address book data;
[0007] Generate a target digital certificate corresponding to the target user based on the preprocessed address book data. The target digital certificate includes a public key and a private key. The public key is used to encrypt the preprocessed address book data to obtain encrypted address book data, and the private key is used to decrypt the encrypted communication data.
[0008] Upload the target digital certificate to the target blockchain signed with the target user.
[0009] In one embodiment, performing hash preprocessing on the address book data to obtain preprocessed address book data includes:
[0010] Determine the hash preprocessing strategy based on the SHA-256 hash algorithm, the preset obfuscation function, and the Whirlpool hybrid hash strategy;
[0011] According to the hash preprocessing strategy, the address book data is preprocessed to obtain preprocessed address book data.
[0012] In one embodiment, generating a target digital certificate corresponding to a target user based on the pre-processed address book data includes:
[0013] Get the preset public-private key pair generation strategy based on bilinear pairings;
[0014] According to the public key-private key pair generation strategy based on bilinear pairing and the preprocessed address book data, a target digital certificate is generated, which includes a public key, a private key and a signature.
[0015] In one embodiment, uploading the target digital certificate to the target blockchain contracted with the target user includes:
[0016] Obtaining a preset data compression strategy, compressing the target digital certificate, and obtaining a compressed target digital certificate;
[0017] Upload the compressed target digital certificate to the target blockchain.
[0018] In one embodiment, obtaining a preset data compression strategy, compressing a target digital certificate, and obtaining a compressed target digital certificate includes:
[0019] Process the target digital certificate in blocks to obtain multiple digital certificate data blocks;
[0020] Performing fractal transformation on each digital certificate data block to obtain a transformed digital certificate data block;
[0021] The transformed digital certificate data blocks are quantized and encoded respectively to obtain a compressed target digital certificate.
[0022] In one embodiment, the address book data includes contact numbers and user identity association data of the target user, and the method further includes:
[0023] Obtain a preset message expansion policy, expand the contact number, and obtain the expanded contact number;
[0024] Mixing the corresponding expanded contact number and the contact number to obtain a mixed contact number;
[0025] Perform hash preprocessing on the address book data, including:
[0026] Generate a number processing strategy based on the SHA-256 hash algorithm and a preset obfuscation function, and perform hash pre-processing on the mixed contact number according to the number processing strategy;
[0027] According to the hash preprocessing strategy, the mixed contact number is hash preprocessed.
[0028] In a second aspect, the present application further provides a device for encrypting address book data, the device comprising:
[0029] The data preprocessing module is used to obtain the address book data of the target user, perform hash preprocessing on the address book data, and obtain the preprocessed address book data;
[0030] A digital certificate generation module is used to generate a target digital certificate corresponding to the target user based on the preprocessed address book data. The target digital certificate includes a public key and a private key. The public key is used to encrypt the preprocessed address book data to obtain encrypted address book data, and the private key is used to decrypt the encrypted communication data.
[0031] The encrypted data notarization module is used to upload the target digital certificate to the target blockchain signed with the target user.
[0032] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0033] Obtain the target user's address book data, perform hash preprocessing on the address book data, and obtain the preprocessed address book data;
[0034] Generate a target digital certificate corresponding to the target user based on the preprocessed address book data. The target digital certificate includes a public key and a private key. The public key is used to encrypt the preprocessed address book data to obtain encrypted address book data, and the private key is used to decrypt the encrypted communication data.
[0035] Upload the target digital certificate to the target blockchain signed with the target user.
[0036] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:
[0037] Obtain the target user's address book data, perform hash preprocessing on the address book data, and obtain the preprocessed address book data;
[0038] Generate a target digital certificate corresponding to the target user based on the preprocessed address book data. The target digital certificate includes a public key and a private key. The public key is used to encrypt the preprocessed address book data to obtain encrypted address book data, and the private key is used to decrypt the encrypted communication data.
[0039] Upload the target digital certificate to the target blockchain signed with the target user.
[0040] In a fifth aspect, the present application further provides a computer program product, the computer program product comprising a computer program, which, when executed by a processor, implements the following steps:
[0041] Obtain the target user's address book data, perform hash preprocessing on the address book data, and obtain the preprocessed address book data;
[0042] Generate a target digital certificate corresponding to the target user based on the preprocessed address book data. The target digital certificate includes a public key and a private key. The public key is used to encrypt the preprocessed address book data to obtain encrypted address book data, and the private key is used to decrypt the encrypted communication data.
[0043] Upload the target digital certificate to the target blockchain signed with the target user.
[0044] The blockchain-based address book data encryption method, apparatus, computer device, storage medium, and computer program product described above encrypt user address book data by first obtaining the target user's address book data and performing hash preprocessing on the address book data to obtain preprocessed address book data, which is now the encrypted address book data. Based on the preprocessed address book data, a target digital certificate corresponding to the target user is generated. The target digital certificate includes a public key and a private key. The public key is used to encrypt the preprocessed address book data to obtain encrypted address book data, and the private key is used to decrypt the encrypted communication data. The uniqueness of each user's digital certificate ensures the uniqueness and immutability of each data block. The public key in the target digital certificate is used to encrypt communication data, and only the party holding the corresponding private key can decrypt the data, thereby helping to ensure the confidentiality of the data during transmission. Finally, the target digital certificate is uploaded to the target blockchain contracted with the target user. This facilitates the use of blockchain technology to achieve distributed data storage and sharing, avoids single points of failure and data tampering, enhances data reliability and availability, and facilitates data traceability.
[0045] The blockchain-based address book data encryption method of this application adopts multiple technical means such as hash processing, digital certificate generation and blockchain storage to realize the encryption and storage of user address book information and ensure its non-tamperability, thereby effectively preventing data leakage and tampering. Moreover, the blockchain technology is used to realize the distributed storage and sharing of data, avoiding single point failures and data tampering, and enhancing the reliability and availability of data. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 This is a diagram of an application environment for a blockchain-based address book data encryption method in one embodiment;
[0047] Figure 2This is a flowchart of a method for encrypting address book data based on blockchain in one embodiment;
[0048] Figure 3 This is a flowchart of the address book data import and encryption process in one embodiment;
[0049] Figure 4 A flowchart of obtaining pre-processed address book data in one embodiment;
[0050] Figure 5 A flowchart of generating a target digital certificate in one embodiment;
[0051] Figure 6 A flowchart of uploading a target digital certificate to a target blockchain in one embodiment;
[0052] Figure 7 A flowchart of obtaining a compressed target digital certificate in one embodiment;
[0053] Figure 8 A flowchart of performing hash preprocessing on a contact number in one embodiment;
[0054] Figure 9 A schematic diagram illustrating the relationship between operation changes and blockchain in one embodiment;
[0055] Figure 10 This is a flowchart of the specific execution process of the blockchain-based address book data encryption method in a detailed embodiment;
[0056] Figure 11 This is a structural block diagram of a device for encrypting address book data in one embodiment;
[0057] Figure 12 is a diagram of the internal structure of a computer device in one embodiment;
[0058] Figure 13 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0060] With the rapid development of the internet industry, user data and privacy are receiving increasing attention. Traditional OA (Office Office Portal) systems address book processing, due to the sensitivity of address book information, data loss during data collection, and inconsistent formats, have created bottlenecks in user data security and privacy protection.
[0061] Related technologies typically rely on APIs provided by the mobile operating system or third-party SDKs to obtain user contact data and perform deduplication, standardization, and cleansing to ensure data accuracy and consistency. However, this traditional data encryption approach suffers from issues such as insufficient security and a lack of traceability.
[0062] In response to the technical problems of insufficient security and lack of traceability in the above-mentioned traditional data encryption practices, the embodiment of the present application provides a blockchain-based address book data encryption method, which adopts asymmetric encryption algorithms, hash algorithms, digital certificate mechanisms and other technical means to solve the security and privacy protection problems existing in the address book processing of traditional OA office portal systems, improve the security and efficiency of the data processing process, realize encryption protection of user address book data, and use distributed storage technology to store the encrypted address book data on multiple nodes of the blockchain, and realize data management and interaction through smart contracts, thereby ensuring the privacy and traceability of the data. The blockchain-based address book data encryption method can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented as an independent server or a server cluster consisting of multiple servers.
[0063] In one embodiment, Figure 2 As shown, this method is applied to Figure 1 The terminal in the example is used for illustration. It is understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0064] Step 202: Acquire the address book data of the target user, perform hash preprocessing on the address book data, and obtain preprocessed address book data.
[0065] The target user is an employee or consumer within a company. Address book data represents the target user's identity or contact information. Address book data may include the target user's name, contact number, email address, and user account. To ensure the privacy of the target user's address book data, hash pre-processing can be performed to convert the address book data into a unique value of a fixed length, making it difficult to reverse engineer the original data and achieving data anonymization.
[0066] For example, the address book data structure of a target user is:
[0067] User ID: 01234;
[0068] Name: Zhang San;
[0069] Mobile phone number: 123-456-7890;
[0070] Email: ZS@example.com
[0071] }, after hash preprocessing, multiple encrypted strings are obtained, and the encrypted strings are composed of elements such as numbers, letters, and symbols.
[0072] Step 204: Generate a target digital certificate corresponding to the target user based on the preprocessed address book data. The target digital certificate includes a public key and a private key. The public key is used to encrypt the preprocessed address book data to obtain encrypted address book data, and the private key is used to decrypt the encrypted communication data.
[0073] Digital certificates can be used to verify the identity of the target user, ensuring the security and legitimacy of communications. A digital certificate consists of a public key, a private key, and a signature. The public key is used to encrypt pre-processed address book data to ensure confidentiality. The private key is used to decrypt the data and is held only by the target user, ensuring data privacy and security.
[0074] Specifically, a pair of public and private keys can be generated according to a pre-set encryption algorithm, and then the private key can be used to sign the request for creating a certificate signature to generate a certificate signature request. The identity of the certificate signature request is then verified to be legitimate. After the identity is confirmed to be legitimate, a digital certificate is generated. Therefore, the digital certificate includes the public key, private key and signature information.
[0075] Step 206: Upload the target digital certificate to the target blockchain signed with the target user.
[0076] The target blockchain is a blockchain platform that has signed a cooperation agreement with the target user. The target user can manage, verify and share the target digital certificate through the target blockchain to ensure the security and transparency of the data.
[0077] When uploading a target digital certificate, the smart contract interface is invoked to upload the target digital certificate to the blockchain. The target blockchain will record the transaction of uploading the target digital certificate, ensuring the immutability of the certificate information. A smart contract is a type of automation that runs on the blockchain. It defines and executes contract terms in code. Smart contracts can automatically execute, verify, and enforce contract terms, ensuring that transactions and agreements between parties proceed according to pre-set conditions and rules. When the pre-set conditions of the smart contract are met, the smart contract will execute automatically without third-party intervention.
[0078] Specifically, the process of importing and encrypting address book data can be referred to Figure 3 As shown, in summary, after obtaining the address book data, its data structure and fields are first analyzed, then HASH processing is performed, and then a digital certificate is generated and stored, and finally the generated digital certificate is uploaded to the corresponding node of the blockchain.
[0079] For example, a company enters each employee's address book information into the system and encrypts it using a hash algorithm. The system then generates a unique digital certificate based on each employee's address book information and uploads it to the blockchain for storage. Simultaneously, an encrypted certificate is generated for any direct or indirect operation of the address book and recorded on the blockchain. This ensures that in the event of a data risk or incident, all historical operational changes can be traced back to the source using a decryption key, ensuring data security. By using a blockchain-based intelligent encryption method for address book privacy, the company's OA office system's "Address Book Management" module can protect users' privacy information and improve the efficiency and accuracy of address book management. This method can also be widely applied in other fields, such as finance and healthcare.
[0080] The above-mentioned blockchain-based address book data encryption method adopts multiple technical means such as hash processing, digital certificate generation and blockchain storage to realize the encryption and storage of user address book information and ensure its non-tamperability, thereby effectively preventing data leakage and tampering. Moreover, blockchain technology is used to realize distributed storage and sharing of data, avoiding single point failures and data tampering, and enhancing data reliability and availability.
[0081] In one embodiment, Figure 4 As shown, the address book data is hash preprocessed to obtain the preprocessed address book data, including:
[0082] Step 402: Determine a hash preprocessing strategy based on the SHA-256 hash algorithm, a preset obfuscation function, and a Whirlpool hybrid hash strategy.
[0083] Specifically, in order to enhance the confidentiality and security of the address book data after preprocessing, a hybrid encryption algorithm can be used. In this embodiment, the hash preprocessing strategy is determined based on the SHA-256 hash algorithm, the preset obfuscation function and the Whirlpool hybrid hash strategy, which helps to increase the complexity of the hash calculation and thus improve the security of the data after encryption.
[0084] For example, the specific formula of the hash preprocessing strategy is:
[0085] H'(input_data)= SHA-256(F(Whirlpool(PBKDF2(input_data, salt, iterations))));
[0086] In the formula, H' is used to represent the preprocessed address book data obtained according to the hash preprocessing strategy; the SHA-256 hash algorithm is a cryptographic hash function that can convert data of arbitrary length into a unique hash value of fixed length (256 bits, or 32 bytes); F is a custom obfuscation function, i.e., a preset obfuscation function, defined as: F(x) = (x XOR constant)>> shift_amount | (x << (32 - shift_amount)), where constant is a preset constant value and shift_amount is a shift dynamically calculated based on the input data. By introducing a preset obfuscation function, the complexity and unpredictability of the hash value can be further enhanced.
[0087] Whirlpool is a cryptographic hash function used to generate a 512-bit hash value, providing high security and collision resistance. It is commonly used in digital signatures to ensure the uniqueness and non-repudiation of signatures, and to ensure that data has not been tampered with during transmission or storage. PBKDF2 (Password-Based Key Derivation Function 2) is a cryptographic base key derivation function 2, a function used to generate encryption keys from passwords. It can enhance the security of passwords and prevent brute force and dictionary attacks through multiple hash operations, that is, combined with salt and iterations algorithms. input_data is used to represent input data, which in this embodiment is the address book data. Salt is used to represent a randomly generated string to increase the complexity and security of the hash function. Iterations is used to represent the number of iterations of the PBKDF2 function, that is, the number of times the hash function needs to be executed to improve security.
[0088] Step 404: pre-process the address book data according to the hash pre-processing strategy to obtain pre-processed address book data.
[0089] Specifically, the preprocessed address book data is represented as a SHA-256 hash value. Each user's detailed information (name, phone number, email address, etc.) is processed through the above preprocessing steps, and the resulting hash value serves as the preprocessed address book data. The preprocessed address book data can be represented as a hash value, a list of hash values, or a key-value pair.
[0090] In this embodiment, a hash preprocessing strategy is determined based on the SHA-256 hash algorithm, a preset obfuscation function, and a Whirlpool hybrid hash strategy, which helps to increase the complexity of hash calculations and thus improve the security of encrypted data.
[0091] In one embodiment, Figure 5 As shown, based on the pre-processed address book data, a target digital certificate corresponding to the target user is generated, including:
[0092] Step 502: Obtain a preset public key-private key pair generation strategy based on bilinear pairings.
[0093] In order to enhance the security and effectiveness of digital certificates, this embodiment introduces bilinear pairing technology to improve the generation and verification process of public key-private key pairs, thereby improving the reliability and unforgeability of digital certificates.
[0094] Specifically, the public key-private key pair generation strategy includes: first selecting a secure bilinear pairing e: G1×G2 →G T , where G1, G2 and G T are all cyclic groups, and their orders are the same. Then, randomly select a private key sk ∈ Z*n (n is the order of the groups G1 and G2), and calculate the public key pk = e(g1, g2) sk , where g1∈G1 and g2∈G2 are both generators of the group.
[0095] Step 504: Generate a target digital certificate according to the public key-private key pair generation strategy based on bilinear pairing and the pre-processed address book data. The target digital certificate includes a public key, a private key, and a signature.
[0096] Specifically, the signing and verification process of a digital certificate includes: selecting a secure hash function H, calculating the signature σ=(r,s), where r=g1 −1 (H(m)+sk*r)mod n, where m is the address book data to be signed; the receiver uses the public key pk and signature σ to verify the validity of the signature. If e(g1, g2) r *pk -r =1, it indicates that the signature is valid and a target digital certificate is generated.
[0097] For example, assuming g1=3 and g2=4, and assuming g1 and g2 are generators of groups G1 and G2, calculate the public key pk = e(3, 4) 5 =12, assuming the result of e is 12. The signing process is as follows:
[0098] Calculate the hash value, assuming H(m) = 7;
[0099] Calculate the signature: select r=2 (assuming g1=3), calculate s= g1 −1 (H(m)+sk*r)mod n=3 -1 (7+5*2) mod 10 = 7 (inverse element), then s = 7*17 mod 10 = 119 mod 10 = 9, that is, the corresponding signature σ = (2, 9).
[0100] The verification process is as follows:
[0101] Calculate e(g1, g2) r *pk -r =e(3, 4) 2 *12 -2 ;
[0102] Assume e(3, 4) 2 *12 -2 =6, then 6*12 -2 =18 (assuming 12 -2 =3);
[0103] Calculation 18 mod 10 = 8 ≠ 1, therefore, the signature is invalid.
[0104] In this embodiment, by introducing bilinear pairing technology, the generation and verification process of the public key-private key pair is improved, thereby improving the reliability and unforgeability of the digital certificate.
[0105] In one embodiment, Figure 6 As shown, upload the target digital certificate to the target blockchain signed with the target user, including:
[0106] Step 602: Obtain a preset data compression strategy, compress the target digital certificate, and obtain a compressed target digital certificate.
[0107] In order to further improve the efficiency of blockchain storage, the present invention adopts a data compression algorithm based on fractal coding.
[0108] Step 604: Upload the compressed target digital certificate to the target blockchain.
[0109] Specifically, after obtaining the compressed target digital certificate, it is uploaded to the target blockchain.
[0110] In this embodiment, compressing the target digital certificate through a data compression strategy helps to improve the storage efficiency of the annual target blockchain.
[0111] In one embodiment, Figure 7 As shown, obtaining a preset data compression strategy, compressing the target digital certificate, and obtaining a compressed target digital certificate includes:
[0112] Step 702: Process the target digital certificate in blocks to obtain multiple digital certificate data blocks.
[0113] For example, taking the target digital certificate as {User ID: 12345; Department: Technology Department; Position: Software Engineer; Mobile Number: 123-456-7890; Email: user@example.com}, it is divided into two digital certificate data blocks, namely: {User ID: 12345; Department: Technology Department} and {Position: Software Engineer; Mobile Number: 123-456-7890; Email: user@example.com}.
[0114] Step 704: Perform fractal transformation on each digital certificate data block to obtain a transformed digital certificate data block.
[0115] For example, still taking the example of step 702 above as an example, after obtaining two digital certificate data blocks, each digital certificate data block is subjected to fractal transformation processing. Specifically, for each digital certificate data block, a suitable affine transformation A and a compression mapping are first selected. , so that each digital certificate data block can be transformed through its subset and affine transformation A and compression mapping Approximately reconstructed.
[0116] For example, for the digital certificate data block {user ID: 12345; department: technology department}, select a suitable affine transformation A and a compression mapping , assuming that B1 is the digital certificate data block, B'1 is a subset of B1 or the result of the transformation, through the affine transformation A and the compression mapping ,get .
[0117] Specifically, assume that B'1 is the user ID: 12345, and through affine transformation A, we get A(B'1); through compression mapping ,get .
[0118] Step 706: quantize and encode each transformed digital certificate data block to obtain a compressed target digital certificate.
[0119] In order to reduce the storage space of data, the transformed digital certificate data block is quantized and encoded.
[0120] For example, assume that the coefficients of B1 after quantization are [1, 2, 3, 4]; encode these coefficients, and assume that the encoding result obtained is [01, 10, 11, 00]; store the encoding result [01, 10, 11, 00] on the target blockchain.
[0121] Accordingly, during decoding and reconstruction, the stored coefficients and the corresponding inverse transformation are used to reconstruct the individual digital certificate data blocks of the target digital certificate, thereby restoring the complete target digital certificate. For example, the encoding result [01, 10, 11, 00] is obtained from the target blockchain; the encoding is decoded to obtain the quantized coefficients [1, 2, 3, 4]; the inverse transformation of the affine transformation A and the compression mapping are used. The digital certificate data block is reconstructed by the inverse transformation. Assume that the inverse transformation result is {User ID: 12345; Department: Technology Department}. The processing process of the remaining digital certificate data blocks is similar, and finally a complete digital certificate is reconstructed.
[0122] In this embodiment, a data compression algorithm based on fractal coding effectively compresses digital certificates. Specifically, the block processing, fractal transformation, quantization, and encoding steps reduce data storage space, while the decoding and reconstruction steps ensure the complete recovery of the digital certificate. This approach not only improves blockchain storage efficiency but also enhances data security and reliability.
[0123] In one embodiment, Figure 8 As shown, the address book data includes the contact number and user identity association data of the target user, and the method further includes:
[0124] Step 802: Obtain a preset message expansion policy, expand the contact number, and obtain the expanded contact number.
[0125] This embodiment aims to enhance the complexity and unpredictability of the hash algorithm by adding a triple optimization method of address book contact number attribution extension function, salt value and iteration number, thereby improving anti-collision ability. Specifically, the preset message expansion strategy is a kind of address book mobile phone number attribution extension function, which increases the complexity of the data by obtaining the number segment information of the mobile phone number, thereby enhancing the diversity and randomness of the hash input data. The introduction of a random salt value increases the uniqueness and unpredictability of the hash value and prevents rainbow table attacks. In addition, through multiple hash iterations, the complexity and anti-collision ability of the hash calculation are increased. The contact number is the original contact number, that is, the contact number in plain text.
[0126] For example, assume that the mobile phone number obtained from the address book data is 13800138000. After querying the mobile phone number location database or API interface, the obtained number segment information is city A. For mobile phone numbers with number segments belonging to city A, the following extension function is used:
[0127] extend_message_A = (F(x) XOR 0x12345678) << 3;
[0128] In the formula, 0x12345678 is a preset constant value; the << operation indicates a 3-bit shift to the left. For other number segment attribution information, different extended operations can be designed to implement it.
[0129] The expanded message (or the output of the custom obfuscation function F if no additional expansion operation is used) is then combined with the original input data (or data that has undergone other preprocessing) as the final input data to enter the subsequent hashing process.
[0130] Step 804: Mix the corresponding extended contact number and the contact number to obtain a mixed contact number.
[0131] To further enhance the privacy of the contact number, the expanded contact number and the original contact number may be combined to form a hybrid.
[0132] For example, assuming that the original contact number is 13800138000, the mixed contact number is 0x5CFCC4B5013800138000.
[0133] Step 806: Generate a number processing strategy based on the SHA-256 hash algorithm and a preset obfuscation function, and perform hash pre-processing on the mixed contact number according to the number processing strategy.
[0134] For example, when the extended message function is used, the number processing strategy is:
[0135] hash_value_initial=SHA256(salt||extend_message_beijing||input_data_processed).
[0136] Step 808: Perform hash preprocessing on the mixed contact number according to the hash preprocessing strategy.
[0137] For example, when no extended message function is used, the hash preprocessing strategy is:
[0138] hash_value_initial = SHA256(salt || F(x) || input_data_processed).
[0139] On this basis, the number of iterations is further increased to improve the anti-collision ability of the hash algorithm. For example, iterate 3 to 4 times:
[0140] hash_value_final = SHA256(SHA256(hash_value_initial) || salt)
[0141] for i in range(2):
[0142] hash_value_final = SHA256(SHA256(hash_value_final) || salt)
[0143] In this embodiment, a triple optimization approach—the extended function for contact number attribution, the salt value, and the number of iterations—significantly enhances the complexity and unpredictability of the hash algorithm, improving collision resistance. Specifically, the extended message function increases data complexity, the salt value enhances the uniqueness of the hash value, and multiple hash iterations further enhance collision resistance. This approach is not only suitable for protecting the security of address book data, but can also be widely applied to other scenarios requiring a strong hash algorithm.
[0144] In addition, if Figure 9 The diagram of the relationship between operation changes and the blockchain, shown here, uses an optimized hash algorithm to process single operation changes to address book data (including but not limited to read, write, modify, and audit operations). When an operation change occurs in the address book, the response conditions preset in the created smart contract model trigger a response action, which records the change and forms structured data information. The contract value is generated according to the contract rules and encryption rules, and the contract value is stored in the blockchain.
[0145] In some embodiments, the method further includes: establishing a multi-level index structure on the target blockchain.
[0146] For example, a multi-level index structure is established within each index level. For example, the first-level index could be a primary index table that records each user's ID and the address of the corresponding second-level index table; the second-level index table records each department's primary key and the address of the corresponding third-level index table. This multi-level index structure reduces the number of matches during queries and improves query efficiency. Furthermore, for high-frequency queries, asynchronous queries and caching mechanisms are implemented to reduce the number of blockchain accesses.
[0147] In some embodiments, the method further includes: after generating the public key, encrypting the public key.
[0148] Specifically, when a user enters their contact information, it is encrypted using the public key to ensure data security and privacy. The encryption algorithm can use existing symmetric encryption algorithms such as AES, and can be adjusted and optimized based on actual circumstances. When accessing the contact information, the user decrypts the data using their private key to obtain the original plaintext data. The decryption algorithm is the same as the encryption algorithm and can also be adjusted and optimized based on actual circumstances.
[0149] It's important to note that before implementing this blockchain-based address book data encryption method, the smart contract must be deployed on the target blockchain. This means completing infrastructure deployment, including blockchain network configuration and smart contract customization. Blockchain network configuration involves setting up nodes within the blockchain network, including both validating and non-validating nodes, to ensure network reliability and high availability. Smart contract customization involves writing a smart contract based on address book requirements on the selected blockchain platform (i.e., the target blockchain). This contract defines the address book's data structure, fields, and permission controls, while also introducing automated data validation logic to ensure data compliance.
[0150] Furthermore, this blockchain's address book data encryption method enables address book backup and recovery by relying on the blockchain's encryption and decryption processes for structured address book information. In the event of data loss or recovery, the decryption process restores the data, ensuring data recoverability. Furthermore, this blockchain's address book data encryption method can configure audit logs for direct and indirect address book operations, which are encrypted and written as part of the blockchain data. Smart contract rules can further leverage audit logs to restrict access and sharing of private and sensitive information, enhancing data privacy and security. Furthermore, the introduction of zero-knowledge proofs (ZKPs) and homomorphic encryption (HE) technologies further enhances data privacy protection.
[0151] This embodiment adopts the above method and realizes the encryption and storage of user address book information through multiple technical means such as hash processing, digital certificate generation and blockchain storage, and ensures its non-tamperability, thereby effectively preventing problems such as data leakage and tampering; moreover, blockchain technology is used to realize distributed storage and sharing of data, avoiding problems such as single point failure and data tampering, and enhancing data reliability and availability; in addition, through the triple optimization method of address book mobile phone number attribution extension function, salt value, and number of iterations, the complexity and unpredictability of the hash algorithm are enhanced, and the collision resistance and security are improved.
[0152] In a detailed embodiment, Figure 10As shown, the specific implementation process of the blockchain-based address book data encryption method includes the following steps:
[0153] Step 1002: Infrastructure deployment.
[0154] Specifically, this step consists of two parallel sub-steps: blockchain network configuration and smart contract customization. Blockchain network configuration involves setting up nodes in the blockchain network, including both validating and non-validating nodes, to ensure network reliability and high availability. Smart contract customization involves writing a smart contract on the selected blockchain platform based on the address book's requirements, defining the address book data structure, permission control, and other aspects.
[0155] Step 1004: User identity verification.
[0156] Specifically, this step consists of two parallel sub-steps: data structuring and permission control setup and verification. Data structuring aims to split and encrypt address book information according to the contract structure. Permission control setup and verification aims to set appropriate permission levels based on user roles, departments, or other attributes, and perform verification and authorization operations within the smart contract to ensure the security of accessing and modifying address book data.
[0157] Step 1006: Data encryption and storage.
[0158] Specifically, this step consists of two parallel sub-steps: a privacy-preserving encryption scheme and distributed storage optimization. The privacy-preserving encryption scheme aims to ensure the confidentiality and integrity of contact data based on appropriate asymmetric encryption and hashing algorithms. Distributed storage optimization aims to shard data storage to improve system scalability and fault tolerance.
[0159] Step 1008: Data backup and recovery.
[0160] Specifically, the backup and recovery of address books is achieved by relying on the blockchain to encrypt and decrypt the structured information of the address book. In the event of data loss or recovery, the data is restored through the decryption process to ensure data recoverability.
[0161] Step 1010, security and traceability.
[0162] Specifically, this step consists of two parallel sub-steps: access audit logging and blockchain oversight. The access audit log records user actions on address book data, including access, modification, and sharing, and stores them on the blockchain to create an immutable audit log. Blockchain oversight aims to ensure data security by introducing smart contract rules to restrict access and sharing of sensitive information, for example.
[0163] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0164] Based on the same inventive concept, embodiments of the present application also provide a device for encrypting contact data based on blockchain for implementing the aforementioned method for encrypting contact data. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations in one or more embodiments of the device for encrypting contact data provided below can be found in the aforementioned limitations on the method for encrypting contact data based on blockchain, and will not be further elaborated here.
[0165] In one embodiment, Figure 11 As shown, a device for encrypting address book data is provided, including: a data pre-processing module 1102, a digital certificate generation module 1104 and an encrypted data evidence storage module 1106, wherein:
[0166] The data preprocessing module 1102 is used to obtain the address book data of the target user and perform hash preprocessing on the address book data to obtain the preprocessed address book data;
[0167] A digital certificate generation module 1104 is configured to generate a target digital certificate corresponding to a target user based on the pre-processed address book data. The target digital certificate includes a public key and a private key. The public key is used to encrypt the pre-processed address book data to obtain encrypted address book data, and the private key is used to decrypt the encrypted address book data.
[0168] The encrypted data notarization module 1106 is used to upload the target digital certificate to the target blockchain signed with the target user.
[0169] In one embodiment, the data preprocessing module 1102 is further used to: determine a hash preprocessing strategy based on the SHA-256 hash algorithm, a preset obfuscation function, and a Whirlpool mixed hash strategy; and preprocess the address book data according to the hash preprocessing strategy to obtain preprocessed address book data.
[0170] In one embodiment, the data preprocessing module 1102 is also used to: obtain a preset public key-private key pair generation strategy based on bilinear pairings; generate a target digital certificate based on the public key-private key pair generation strategy based on bilinear pairings and the preprocessed address book data, and the target digital certificate includes a public key, a private key and a signature.
[0171] In one embodiment, the encrypted data evidence storage module 1106 is further used to: obtain a preset data compression strategy, compress the target digital certificate, and obtain a compressed target digital certificate; and upload the compressed target digital certificate to the target blockchain.
[0172] In one embodiment, the encrypted data evidence storage module 1106 is also used to: process the target digital certificate in blocks to obtain multiple digital certificate data blocks; perform fractal transformation on each digital certificate data block to obtain a transformed digital certificate data block; and quantize and encode each transformed digital certificate data block to obtain a compressed target digital certificate.
[0173] In one embodiment, the data preprocessing module 1102 is further used to: obtain a preset message expansion strategy, expand the contact number, and obtain an extended contact number; mix the corresponding extended contact number and the contact number to obtain a mixed contact number; generate a number processing strategy based on the SHA-256 hash algorithm and a preset obfuscation function, and perform hash preprocessing on the mixed contact number according to the number processing strategy; and perform hash preprocessing on the mixed contact number according to the hash preprocessing strategy.
[0174] Each module in the aforementioned address book data encryption device may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0175] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 12As shown. The computer device includes a processor, memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store user address book data, access records, and other data. The network interface of the computer device is used to communicate with external terminals via a network connection. When executed by the processor, the computer program implements a blockchain-based address book data encryption method.
[0176] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 13 As shown. The computer device includes a processor, memory, a communication interface, a display screen, and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used to communicate with external terminals via wired or wireless means. Wireless means can be achieved through Wi-Fi, mobile cellular networks, NFC (near-field communication), or other technologies. When executed by the processor, the computer program implements a blockchain-based address book data encryption method. The display screen of the computer device can be a liquid crystal display or an electronic ink display. The input device of the computer device can be a touch layer covering the display screen, keys, trackball, or touchpad provided on the computer device housing, or an external keyboard, touchpad, or mouse.
[0177] Those skilled in the art will understand that Figure 12 and Figure 13 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0178] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0179] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0180] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0181] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0182] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.
[0183] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0184] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A blockchain-based address book data encryption method, characterized in that: The method comprises: Obtaining the target user's address book data, performing hash preprocessing on the address book data to obtain preprocessed address book data; the address book data includes the target user's contact number and user identity association data; Generate a target digital certificate corresponding to the target user based on the preprocessed address book data, wherein the target digital certificate includes a public key and a private key, wherein the public key is used to encrypt the preprocessed address book data to obtain encrypted address book data, and the private key is used to decrypt the encrypted address book data; Uploading the target digital certificate to the target blockchain contracted with the target user; The method further comprises: Obtaining a preset message expansion strategy, expanding the contact number, and obtaining an expanded contact number; Mixing the corresponding extended contact number and the contact number to obtain a mixed contact number; The performing hash preprocessing on the address book data includes: Generate a number processing strategy based on the SHA-256 hash algorithm and a preset obfuscation function, and perform hash pre-processing on the mixed contact number according to the number processing strategy; According to the hash preprocessing strategy, the mixed contact number is hash preprocessed.
2. The method according to claim 1, characterized in that The performing hash preprocessing on the address book data to obtain preprocessed address book data includes: Determine the hash preprocessing strategy based on the SHA-256 hash algorithm, the preset obfuscation function, and the Whirlpool hybrid hash strategy; The address book data is preprocessed according to the hash preprocessing strategy to obtain the preprocessed address book data.
3. The method according to claim 2, characterized in that Generating a target digital certificate corresponding to the target user based on the pre-processed address book data includes: Get the preset public-private key pair generation strategy based on bilinear pairings; The target digital certificate is generated according to the public key-private key pair generation strategy based on bilinear pairing and the pre-processed address book data. The target digital certificate includes a public key, a private key and a signature.
4. The method according to claim 1, wherein The uploading of the target digital certificate to the target blockchain contracted with the target user includes: Obtaining a preset data compression strategy, compressing the target digital certificate, and obtaining a compressed target digital certificate; Upload the compressed target digital certificate to the target blockchain.
5. The method according to claim 4, characterized in that The step of obtaining a preset data compression strategy, compressing the target digital certificate, and obtaining a compressed target digital certificate includes: Processing the target digital certificate in blocks to obtain multiple digital certificate data blocks; Performing fractal transformation on each of the digital certificate data blocks to obtain transformed digital certificate data blocks; The transformed digital certificate data blocks are quantized and encoded respectively to obtain the compressed target digital certificate.
6. The method according to claim 1, characterized in that The method also includes: establishing a multi-level index structure on the target blockchain.
7. A device for encrypting address book data, characterized in that: The device comprises: A data preprocessing module is used to obtain the address book data of the target user and perform hash preprocessing on the address book data to obtain preprocessed address book data; the address book data includes the contact number and user identity association data of the target user; a digital certificate generation module, configured to generate a target digital certificate corresponding to the target user based on the preprocessed address book data, wherein the target digital certificate includes a public key and a private key, wherein the public key is used to encrypt the preprocessed address book data to obtain encrypted address book data, and the private key is used to decrypt the encrypted address book data; An encrypted data notarization module, used to upload the target digital certificate to the target blockchain contracted with the target user; The device is also used to obtain a preset message expansion strategy, expand the contact number to obtain an extended contact number; mix the corresponding extended contact number and the contact number to obtain a mixed contact number; the data preprocessing module is also used to generate a number processing strategy based on the SHA-256 hash algorithm and a preset confusion function, and perform hash preprocessing on the mixed contact number according to the number processing strategy; and perform hash preprocessing on the mixed contact number according to the hash preprocessing strategy.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Mobile phone address book synchronization method and device based on block chain, and medium
CN111027088A
Block chain-based information management method and device, equipment and medium
CN119089471A