E-commerce shop data encryption method and system

Through the combination of AIFT_3DES algorithm and character encoding, the filling problem of traditional 3DES algorithm when the data length does not match is solved, the encryption of the data length is achieved unchanged, efficiency and security are improved, and data integrity is ensured.

CN119155016AActive Publication Date: 2024-12-17LAB FOR AI-POWERED FINANCIAL TECH LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411129792.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-12-17
Estimated Expiration
2044-08-16

AI Technical Summary

Technical Problem

Traditional 3DES algorithms need to be filled when the data length is not 64 bit multiples, resulting in an increase in the encrypted data length, affecting efficiency and integrity.

Method used

Using AIFT_3DES algorithm, character encoding is compressed from 8 bits to 6 bits, and combined with 3DES algorithm, data blocks are split and merged, and redundant data is processed through shift operations to ensure that the data length remains unchanged after encryption, and access is restricted using MySQL permission management. .

Benefits of technology

It effectively reduces the length of data during the encryption process, improves encryption efficiency and security, and ensures the consistency and integrity of the encrypted data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119155016A_ABST
    Figure CN119155016A_ABST
Patent Text Reader

Abstract

The invention relates to the field of data encryption, and discloses an e-commerce shop data encryption method, which comprises the following steps: acquiring data information of to-be-encrypted data, recoding characters in sensitive fields in the to-be-encrypted data by using integers from 0 to 63, and representing each recoded character by using a 6-bit binary system, obtaining the recoded data of the sensitive fields; and encrypting the 64-bit data block and the multiple data block by adopting an AIFT3DES encryption algorithm to obtain the encrypted 64-bit data block and the multiple data block, outputting the encrypted data, performing data storage on the encrypted data, and limiting the access authority of the encrypted data. Through the technical scheme provided by the invention, the length of the encrypted sensitive field can be kept unchanged, and the data security is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data encryption, and in particular to a method and system for encrypting data of an e-commerce store. Background Art

[0002] The existing 3DES is a symmetric key encryption block cipher, which is equivalent to applying the Data Encryption Standard (DES) algorithm three times to each data block. To improve security, the algorithm groups the 24-byte key into 8-byte lengths, with the first eight bytes being KEY1, the middle 8 bytes being KEY2, and the last 8 bytes being KEY3. When encrypting, use KEY1 to perform DES encryption on plaintext data block 1 to obtain C1, use KEY2 to perform DES decryption on C1 to obtain C2, and then use KEY3 to perform DES encryption on C2 to obtain C3. The decryption process is the opposite.

[0003] The traditional 3DES algorithm encrypts data in blocks of 64 bits. If the length of the data is not a multiple of 64 bits, padding is required to make the data length a multiple of 64. If the length of the input data is not a multiple of 64 bits, the data length needs to be padded to a multiple of 64. This increases the length of the encrypted data, which can easily affect the overall efficiency and integrity. Summary of the invention

[0004] The purpose of the present invention is to overcome the shortcomings of the prior art and provide an e-commerce store data encryption method, comprising the following steps:

[0005] Step 1: obtain the data information of the data to be encrypted. If the length of the data to be encrypted is not less than the set length threshold, proceed to step 2. Otherwise, fill the data length of the data to be encrypted to the set length threshold and proceed to step 2.

[0006] Step 2: re-encode the characters in the sensitive field of the data to be encrypted using integers from 0 to 63, and represent each re-encoded character with 6 bits of binary to obtain the re-encoded data of the sensitive field;

[0007] Step 3: If there is more than 64 bits of binary data in the re-encoded data of the sensitive field, split the data into 64-bit data blocks and their multiples, and the remaining binary data, perform 3DES encryption on the 64-bit data blocks and their multiples, retain the excess binary data, and proceed to step 4; if there is no such data, encrypt the 64-bit data blocks and their multiples using the AIFT_3DES encryption algorithm to obtain the encrypted 64-bit data blocks and their multiples, and proceed to step 6;

[0008] Step 4, merging the encrypted 64-bit data block and its multiples with the binary data exceeding the multiple of 64 bits to obtain merged data, and recompiling the merged data with 6 bits as one byte;

[0009] Step 5, shift the last 6 bytes of the merged and compiled data to obtain the encrypted data of the merged data;

[0010] Step six: output the encrypted data, store the encrypted data and restrict access rights to the encrypted data.

[0011] Furthermore, the sensitive field is a preset field, including uppercase English letters and numbers.

[0012] Furthermore, if the data to be encrypted is less than 11 bytes, the data to be encrypted is padded to a length of 11 bytes.

[0013] Further, the encrypted 64-bit data block and its multiples are combined with binary data exceeding 64-bit multiples to obtain combined data, and the combined data is recompiled with 6 bits as one byte, including:

[0014] According to the set character code 0-63, every 6 bits of binary data are compiled into characters, and the characters include uppercase letters, numbers and special characters.

[0015] Further, the shift operation is performed on the last 6 bytes of the merged and recompiled data, including:

[0016] After converting all binary data into characters, the last six characters are shifted, that is, they are shifted according to the character code of 0-63. There is a mapping relationship between characters and character codes. Each character is represented by a number from 0-63. The shift refers to adding and subtracting the number.

[0017] Furthermore, storing the encrypted data as data and restricting access rights to the encrypted data includes:

[0018] Use MySQL's user and permission management functions to limit the tables or fields that users can access; at the same time, limit users to only viewing data.

[0019] An e-commerce store data encryption system, applying the e-commerce store data encryption method, comprises a data server, a data input module, a data filling module, a data processing module, a data encryption module and a data communication module;

[0020] The data input module, data filling module, data encryption module and data processing module are connected in sequence; the data communication module is connected to the data processing module; the data server is connected to the communication module for communication;

[0021] The data input module is used to receive data to be encrypted;

[0022] The data filling module is used to fill the data to be encrypted whose length is less than a set length threshold;

[0023] The data encryption module is used to encrypt data;

[0024] The data server is used to store the encrypted data.

[0025] The beneficial effects of the present invention are:

[0026] 1. The AIFT_3DES encryption algorithm uses a combination of character encoding and the 3DES algorithm to encrypt sensitive fields in e-commerce store data. This method effectively reduces the length of data during encryption by compressing the character encoding from 8 bits to 6 bits, avoiding data padding and improving encryption efficiency and security.

[0027] 2. The length of encrypted data remains unchanged: The AIFT_3DES algorithm ensures that the length of the encrypted data remains unchanged when the input data length is greater than 11 bytes. For data with a length less than 11 bytes, it will be padded to 11 bytes before encryption to meet the minimum length requirement of the 3DES algorithm, ensuring the consistency and integrity of the encrypted data. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 It is a flowchart of an e-commerce store data encryption method;

[0029] Figure 2 It is a schematic diagram of an implementation method of an e-commerce store data encryption method;

[0030] Figure 3 This is a schematic diagram of the principle of an e-commerce store data encryption system. DETAILED DESCRIPTION

[0031] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings, but the protection scope of the present invention is not limited to the following.

[0032] The features and performance of the present invention are further described in detail below in conjunction with the embodiments.

[0033] like Figure 1 As shown, a method for encrypting data of an e-commerce store comprises the following steps:

[0034] Step 1: obtain the data information of the data to be encrypted. If the length of the data to be encrypted is not less than the set length threshold, proceed to step 2. Otherwise, fill the data length of the data to be encrypted to the set length threshold and proceed to step 2.

[0035] Step 2: re-encode the characters in the sensitive field of the data to be encrypted using integers from 0 to 63, and represent each re-encoded character with 6 bits of binary to obtain the re-encoded data of the sensitive field;

[0036] Step 3: If there is more than 64 bits of binary data in the re-encoded data of the sensitive field, split the data into 64-bit data blocks and their multiples, and the remaining binary data, perform 3DES encryption on the 64-bit data blocks and their multiples, retain the excess binary data, and proceed to step 4; if there is no such data, encrypt the 64-bit data blocks and their multiples using the AIFT_3DES encryption algorithm to obtain the encrypted 64-bit data blocks and their multiples, and proceed to step 6;

[0037] Step 4, merging the encrypted 64-bit data block and its multiples with the binary data exceeding the multiple of 64 bits to obtain merged data, and recompiling the merged data with 6 bits as one byte;

[0038] Step 5, shift the last 6 bytes of the merged and compiled data to obtain the encrypted data of the merged data;

[0039] Step six: output the encrypted data, store the encrypted data and restrict access rights to the encrypted data.

[0040] The sensitive fields are preset fields, including uppercase English letters and numbers.

[0041] The method also includes padding the data to be encrypted to a length of 11 bytes if the data to be encrypted is less than 11 bytes.

[0042] The method of combining the encrypted 64-bit data blocks and the multiples thereof with the binary data exceeding the multiples of 64 bits to obtain combined data, and recompiling the combined data with 6 bits as one byte, comprises:

[0043] According to the set character code 0-63, every 6 bits of binary data are compiled into characters, and the characters include uppercase letters, numbers and special characters.

[0044] The shift operation on the last 6 bytes of the merged and recompiled data comprises:

[0045] After converting all binary data into characters, the last six characters are shifted, that is, they are shifted according to the character code of 0-63. There is a mapping relationship between characters and character codes. Each character is represented by a number from 0-63. The shift refers to adding and subtracting the number.

[0046] The storing of encrypted data and restricting access rights to the encrypted data include:

[0047] Use MySQL's user and permission management functions to limit the tables or fields that users can access; at the same time, limit users to only viewing data.

[0048] like Figure 3 As shown, an e-commerce store data encryption system, applying the e-commerce store data encryption method, includes a data server, a data input module, a data filling module, a data processing module, a data encryption module and a data communication module;

[0049] The data input module, data filling module, data encryption module and data processing module are connected in sequence; the data communication module is connected to the data processing module; the data server is connected to the communication module for communication;

[0050] The data input module is used to receive data to be encrypted;

[0051] The data filling module is used to fill the data to be encrypted whose length is less than a set length threshold;

[0052] The data encryption module is used to encrypt data;

[0053] The data server is used to store the encrypted data.

[0054] Specifically, Figure 2 As shown, character re-encoding: First, we found that the sensitive fields in the API store data are all uppercase English letters and numbers. So we used integers from 0 to 63 to re-encode uppercase English letters, numbers and special characters. By representing these characters with 6-bit binary, the ASCII code is compressed from 8-bit binary to 6-bit binary.

[0055] Then the AIFT_3DES encryption algorithm shortens the number of bits of each byte by re-encoding the characters, so that when using the 3DES algorithm, the number of bytes encrypted is increased, effectively reducing the binary data that exceeds 64 bits. Data that exceeds 64 bits is not processed first. After the first 64 bits and their multiples are encrypted, they are merged together and compiled with 6 bits as 1 byte. Then the last 6 bytes are shifted to reduce the impact of unencrypted data, and finally the encrypted data is obtained.

[0056] Because encryption is performed on data blocks of 64 or multiples thereof, there may be redundant binary data that is not encrypted. Therefore, after converting all binary data into characters (bytes), the last six characters (bytes) are shifted, that is, they are shifted according to the character codes of 0-63. There is a mapping relationship between characters and character codes. Each character is represented by a number from 0-63. Shifting refers to adding or subtracting the number.

[0057] Assume that A is represented by the number 10, and shift it by +9 to become the number 19, and 19 represents the character J. By shifting A, it becomes J. The purpose of this shift is to encrypt the redundant binary data that was not encrypted before. Finally, data with all data encrypted at the binary data level is obtained.

[0058] The encrypted data is binary data, so it needs to be compiled again. The compilation is based on the character encoding 0-63 that we set ourselves, and every 6 bits of binary data are compiled into characters. These characters include uppercase letters, numbers and special characters.

[0059] Therefore, for data with an input length greater than 11 bytes, no data is added during the entire process, and the encrypted length remains unchanged. (*For data with an input length less than 11 bytes, it will be padded to a length of 11 bytes, which is exactly 66 bits, meeting the minimum length requirement of 3DES of 64 bits).

[0060] Store authorization data: E-commerce companies use the Tolo e-commerce platform to authorize stores, generate store authorization data, and obtain access tokens. The store authorization data here contains a lot of data about e-commerce privacy, and only specific personnel have the right to access it.

[0061] Use MySQL's user and permission management function to limit which users can access which tables or fields. At the same time, limit users to only view data and not add, delete, or modify data. Only people in the encryption group have the permission to add, delete, or modify data.

[0062] Encrypted data: Migrate the store data to the new server. During the migration process, encrypt the privacy information of the store data according to the AIFT_3DES algorithm to obtain the encrypted data.

[0063] The following are two specific embodiments of the e-commerce store data encryption method:

[0064] Embodiment 1:

[0065] Scenario: The user information database of an e-commerce platform needs to be encrypted to protect user privacy.

[0066] Implementation steps:

[0067] Data preprocessing: Check each record in the user information database to determine its length. For records with a length less than 11 bytes, use a preset padding character (such as "*") to fill it until it reaches 11 bytes.

[0068] Sensitive Field Re-encoding: Identify sensitive fields in user information, such as name, phone number, email address, etc. Re-encode the characters in these sensitive fields using integers from 0 to 63, and convert each encoded character into a 6-bit binary representation.

[0069] Data splitting and encryption: Check the re-encoded binary data. If there are data blocks exceeding 64 bits, split them into 64-bit data blocks and the remaining data. Encrypt the 64-bit data blocks using the 3DES encryption algorithm; the remaining data is retained without encryption.

[0070] Data merging and recompiling: Merge the encrypted data block with the remaining data. Recompile the merged data with 6 bits as one byte and convert it into printable characters (including uppercase letters, numbers and special characters).

[0071] Data shift operation: perform a shift operation on the last 6 bytes of the recompiled data, specifically, add 1 to the character code of each byte (modulo 64).

[0072] Data storage and permission restrictions: Store encrypted user information in the database. Use MySQL's user and permission management functions to restrict access to the encrypted user information table to specific users.

[0073] Embodiment 2:

[0074] Scenario: An e-commerce store needs to encrypt order data to ensure the security of order information.

[0075] Implementation steps:

[0076] Data preprocessing: Check each order record in the order database to determine its length. For records whose length is less than a set threshold (such as 16 bytes), use the preset filling rules (such as repeating the last character) to fill.

[0077] Sensitive Field Recoding: Identify sensitive fields in order data, such as buyer name, buyer address, product name, etc. Recode the characters in these sensitive fields using integers from 0 to 63, and convert each encoded character into a 6-bit binary representation.

[0078] Data splitting and encryption: Check the re-encoded binary data, and if there are data blocks longer than 64 bits, split them into 64-bit data blocks. Encrypt all 64-bit data blocks using the AIFT_3DES encryption algorithm.

[0079] Data merging and recompiling: Merge the encrypted data blocks. Recompile the merged data with 6 bits as one byte and convert them into printable characters in the ASCII character set.

[0080] Data shift operation: perform a shift operation on the last 6 bytes of the recompiled data, specifically, perform a subtraction operation (modulo 64) on the character code of each byte.

[0081] Data storage and permission restrictions: Encrypted order data is stored in the database. Using MySQL's permission management function, only order processing personnel and store administrators can access the encrypted order data table, and can only view the data.

Claims

1. An e-commerce store data encryption method, characterized in that: The steps include: Step 1: obtain the data information of the data to be encrypted. If the length of the data to be encrypted is not less than the set length threshold, proceed to step 2. Otherwise, fill the data length of the data to be encrypted to the set length threshold and proceed to step 2. Step 2: re-encode the characters in the sensitive field of the data to be encrypted using integers from 0 to 63, and represent each re-encoded character with 6 bits of binary to obtain the re-encoded data of the sensitive field; Step 3: If there is more than 64 bits of binary data in the re-encoded data of the sensitive field, split the data into 64-bit data blocks and the remaining binary data, perform 3DES encryption on the 64-bit data blocks and the remaining binary data, retain the remaining binary data, and proceed to step 4; if there is no such data, encrypt the 64-bit data blocks and the remaining binary data using the AIFT_3DES encryption algorithm to obtain the encrypted 64-bit data blocks and the remaining binary data, and proceed to step 6; Step 4, merging the encrypted 64-bit data block and its multiples with the binary data exceeding the multiple of 64 bits to obtain merged data, and recompiling the merged data with 6 bits as one byte; Step 5, shift the last 6 bytes of the merged and compiled data to obtain the encrypted data of the merged data; Step six: output the encrypted data, store the encrypted data and restrict access rights to the encrypted data.

2. The method for encrypting data of an e-commerce store according to claim 1, characterized in that: The sensitive fields are preset fields, including uppercase English letters and numbers.

3. The method for encrypting data of an e-commerce store according to claim 2, characterized in that: The method also includes padding the data to be encrypted to a length of 11 bytes if the data to be encrypted is less than 11 bytes.

4. The method for encrypting data of an e-commerce store according to claim 3, characterized in that: The method of combining the encrypted 64-bit data blocks and the multiples thereof with the binary data exceeding the multiples of 64 bits to obtain combined data, and recompiling the combined data with 6 bits as one byte, comprises: According to the set character code 0-63, every 6 bits of binary data are compiled into characters, and the characters include uppercase letters, numbers and special characters.

5. The method for encrypting data of an e-commerce store according to claim 4, characterized in that: The shift operation on the last 6 bytes of the merged and recompiled data comprises: After converting all binary data into characters, the last six characters are shifted, that is, they are shifted according to the character code of 0-63. There is a mapping relationship between characters and character codes. Each character is represented by a number from 0-63. The shift refers to adding and subtracting the number.

6. The method for encrypting data of an e-commerce store according to claim 5, characterized in that: The storing of encrypted data and restricting access rights to the encrypted data include: Use MySQL's user and permission management functions to limit the tables or fields that users can access; at the same time, limit users to only viewing data.

7. An e-commerce store data encryption system, characterized in that: An e-commerce store data encryption method according to any one of claims 1 to 7 is applied, comprising a data server, a data input module, a data filling module, a data processing module, a data encryption module and a data communication module; The data input module, data filling module, data encryption module and data processing module are connected in sequence; the data communication module is connected to the data processing module; the data server is connected to the communication module for communication; The data input module is used to receive data to be encrypted; The data filling module is used to fill the data to be encrypted whose length is less than a set length threshold; The data encryption module is used to encrypt data; The data server is used to store the encrypted data.

Citation Information

Patent Citations

  • Method, device and system for creating multi-dimension inter-network protocol

    CN101127768A

  • A method and a system for improving the safety of sensitive information of a database

    CN109271797A

  • Three-dimensional blue-green two-dimensional code short-distance secure communication method based on underwater image enhancement technology

    CN113285764A

  • Internet e-commerce platform user privacy data encryption method

    CN116702171A