Authentication authentication encryption method

By obtaining the MAC address and product serial number of the device, performing data mixing operations and converting them into coordinate arrays, and using picture pixels to store encrypted information, solving the problems of easy loss of character string keys and low security in the prior art, and achieving high concealment and security of information.

CN120180394APending Publication Date: 2025-06-20QINGDAO HANTEK INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510244696.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-04
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

When the existing software activation technology is encrypted, once the string key is lost or errored, it is difficult to recover data, and the security is not high, making it difficult to meet people's needs at this stage.

Method used

By obtaining the MAC address and product serial number of the device, performing data mixing operations, generating new integers, and then converting them into coordinate arrays, and using picture pixels to store encrypted information. Through custom numeric letter encoding and multiple algorithms, a picture after adding encrypted information is generated.

Benefits of technology

It realizes that the information is highly concealed and secure, and is difficult to detect. Compared with simple string keys, it has higher security, large capacity, supports more data encryption, and is dynamic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120180394A_ABST
    Figure CN120180394A_ABST
Patent Text Reader

Abstract

The invention discloses an authentication authentication encryption method, which comprises the following steps of: S100, acquiring an MAC (Media Access Control) address and a product serial number of equipment, and converting the MAC address and the product serial number into integers; wherein the MAC address is converted into an integer, and the integer is recorded as MACint; converting the serial number into an integer, and recording as SNint; s200, performing data mixing operation on the integer MACint and the integer SNint to generate a new integer, and recording the new integer as Mixedint; s300, converting the integer Mixedint into a coordinate array through a plurality of different algorithms, and recording the coordinate array as A [n1]; s400, a unique number M is obtained through a remainder calculation Mixedint; s500, character string data conversion is carried out; s600, encrypting the information to the picture; according to the method, encryption information is stored by using picture pixels, the capacity is large, encryption of more data can be supported, keys and parameters generated in each time of encryption are different, and the dynamic property is strong.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data encryption, and specifically to an authentication and encryption method. Background Art

[0002] Software activation is an indispensable part of software development. Currently, there are various software activation methods in the market, including license activation, online activation, hardware locking, etc. The main purposes of these methods are to protect the intellectual property rights of software, prevent piracy and illegal copying, and ensure the legal use of software.

[0003] License activation is one of the most common activation methods in the market. It determines the legality of software by verifying the license key input by the user. Since the license key is unique, it can effectively prevent piracy and illegal copying. In addition, license activation can also control the usage period and functions of software, thus providing more business opportunities for software developers.

[0004] Online activation is an activation method that has received increasing attention in recent years. It needs to verify the legality of software through an Internet connection, so the stability of the network needs to be ensured during the activation process. Since online activation can verify the legality of software in real time, it can effectively prevent piracy.

[0005] Hardware locking is also a common software activation method. It needs to bind software to a specific hardware device to ensure that the software can only run on the specified device. The disadvantage of this method is that it will limit the usage scope of the software;

[0006] For the above encryption methods, when encrypting, once the string key is lost or incorrect, it is very difficult to recover the data, and the reliability is not high. The existing technology can no longer meet the needs of people at the present stage. Based on the current situation, it is urgent to improve the existing technology. Summary of the Invention

[0007] The purpose of the present invention is to provide an authentication and encryption method to solve the problems raised in the above background art.

[0008] The present invention provides the following technical solution: An authentication and encryption method, the steps include:

[0009] S100: Obtain the MAC address and product serial number of the device and convert them into integers;

[0010] Conversion of MAC address to integer: First, split the MAC address into 6 bytes, then convert each byte into a decimal value, and finally convert it into an integer through weighted summation, denoted as MAC_int;

[0011] Serial number to integer: directly convert the serial number into an integer, denoted as SN_int.

[0012] S200: perform a data mixing operation on the integers MAC_int and SN_int to generate a new integer, denoted as Mixed_int;

[0013] First, convert MAC_int and SN_int to binary, then align the bits of the binary of MAC_int and the binary of SN_int bit by bit, and perform an exclusive OR operation to generate a new integer Mixed_int.

[0014] S300: convert the integer Mixed_int into a coordinate array through multiple different algorithms, denoted as A[n1]; where n1 is related to the number of activation code strings to be encrypted, and n1 = the number of encrypted activation code strings / the number of characters stored in one pixel.

[0015] S400: obtain a unique number M through a remainder calculation of Mixed_int.

[0016] S500: string data conversion;

[0017] Convert the encrypted string data into numbers through a custom digital and alphabetic encoding.

[0018] S600: encrypt information into a picture;

[0019] First, determine the arrangement order of the R, G, B, and A data of the selected pixel points according to the value of the number M;

[0020] Then, calculate the pixel coordinates in the picture according to the order in the A[n1] array.

[0021] Finally, take out the data of the corresponding pixel points, and modify the RGBA data of the selected pixel points to encrypt the text information. Randomly select addition or subtraction to calculate the values of R, G, B, and A corresponding to the pixel, and finally generate a picture with the encrypted information added.

[0022] The present invention has the following beneficial effects:

[0023] The encryption method of the present invention embeds information into picture pixels, has strong concealment and is difficult to be detected. Compared with a simple string key, it has higher security;

[0024] The present invention uses picture pixels to store encrypted information, has a large capacity, can support more data encryption, and the keys and parameters generated by each encryption are different, with strong dynamics. Even if the input is the same, the results are different, which forms a sharp contrast with fixed string encryption. Description of the Drawings

[0025] Figure 1 Schematic diagram of the coordinates and RGBA encryption information of the original picture of the present invention;

[0026] Figure 2 Schematic diagram of the coordinates and RGBA encryption information of the encrypted picture of the present invention. Specific implementation manner

[0027] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art in the technical field of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0028] The present invention provides the following technical solution: an authentication and encryption method, and the specific steps include:

[0029] S100: Obtain the MAC address and product serial number of the device and convert them into integers;

[0030] Conversion of MAC address to integer: First, the MAC address is split into 6 bytes, then each byte is converted into a decimal value, and finally it is converted into an integer through weighted summation, denoted as MAC_int.

[0031] As an optional embodiment of the present invention, in this embodiment, the MAC address of the device is: 00:1A:2B:3C:4D:5E; the steps for converting it into an integer are as follows:

[0032] (1) The MAC address is split into the following 6 bytes: 0x00, 0x1A, 0x2B, 0x3C, 0x4D, 0x5E;

[0033] (2) The decimal numbers converted from each byte are: byte_5 = 0, byte_4 = 26, byte_3 = 43, byte_2 = 60, byte_1 = 77, byte_0 = 94;

[0034] (3) Weighted summation: When the MAC address is converted into an integer, from right to left, each pair of bytes (hexadecimal numbers) is multiplied by the corresponding weight, and the weight is a power of 0xFF (from the 0th power of 0xFF to the 5th power of 0xFF); specifically: MAC_int = byte_5 * 0xFF^5 + byte_4 * 0xFF^4 + byte_3 * 0xFF^3 + byte_2 * 0xFF^2 + byte_1 * 0xFF^1 + byte_0 * 0xFF^0 = 112394521950.

[0035] Convert the serial number to an integer: directly convert the serial number into an integer, denoted as SN_int;

[0036] In this embodiment, since the serial number SN: 19880808081234 is composed of integer digits, it can be directly converted to the integer SN_int: 19880808081234.

[0037] S200: Perform a data mixing operation on the integer MAC_int and SN_int to generate a new integer, denoted as Mixed_int; the specific steps include:

[0038] First, convert MAC_int and SN_int to binary, then align the bits of the binary of MAC_int and the binary of SN_int bit by bit, and perform an exclusive OR operation to generate a new integer Mixed_int.

[0039] In this embodiment, the exclusive OR operation is a binary operation that operates on two binary digits: if the two digits are the same, the result is 0; if the two digits are different, the result is 1; by using the exclusive OR operation, it can be ensured that the information in the MAC address and the serial number is taken into account in the final result;

[0040] In this embodiment, MAC_int is converted to binary as: 000000000001101000101011001111000100110101011110;

[0041] In this embodiment, SN_int is converted to binary as: 0001 0010 0001 0100 1101 110010000000 1110 0111 0101 0010;

[0042] In this embodiment, align the bits of the two bit by bit, and fill in 1 for the insufficient bits to perform the exclusive OR operation:

[0043] MAC_int: 0000 0000 0001 1010 0010 1011 0011 1100 0100 1101 01011110;

[0044] SN_int: 0001 0010 0001 0100 1101 1100 1000 0000 1110 0111 01010010;

[0045] The obtained binary calculation result is: 0001 0010 0000 1110 1111 0111 1011 110010101010 0000 1100;

[0046] The obtained decimal calculation result is: 19855495178764;

[0047] Therefore, Mixed_int = 19855495178764.

[0048] S300: Convert the integer Mixed_int into a coordinate array through multiple different algorithms, denoted as A[n1]; where n1 is related to the number of activation code strings to be encrypted, and n1 = the number of encrypted activation code strings / the number of characters stored in one pixel;

[0049] In this embodiment, n1 is equal to the number of the algorithms, and the algorithms are not fixed, not unique, and have no order. In this embodiment, assume that for a picture with a pixel of 128*128, the activation code string to be encrypted is assumed to be the string S "kol1mayumo56". It can be known that the number of characters in the string is 12, and one pixel can store 4 characters; so n1 = 12 / 4 = 3;

[0050] Therefore, now n1 = 3, so the coordinate array A[n1] can be calculated through three different algorithms: the iterative division algorithm, the lg function algorithm, and the ln function algorithm, and the calculation is as follows:

[0051] A[1] = 128 * (Mixed_int % 128) + (Mixed_int % 128) = 11868;

[0052] A[2] = 128 * lg(Mixed_int) + (lg(Mixed_int) * 2) = 1834;

[0053] A[3] = 128 * ln(Mixed_int) + (ln(Mixed_int) * 3) = 5460;

[0054] Therefore, the coordinate array A[n1] = {11868, 1834, 5460}.

[0055] S400: Obtain a unique number M through the remainder calculation of Mixed_int;

[0056] For example, obtain M from Mixed_int through the remainder calculation;

[0057] M = Mixed_int % 24 = 4;

[0058] Among them, the number B is between 0 and 23; the color of one pixel is one of the four: R, G, B, A (red, green, blue, and transparent), and there are a total of 24 combinations in the order of permutation and combination. For example, when M = 4, the order of the pixel points is RGBA.

[0059] S500: String data conversion;

[0060] Convert the encrypted string data into numbers through a custom alphanumeric encoding.

[0061] Since the string data to be encrypted consists of pure English and numbers, such as string S. In order to embed it into an image, a custom alphanumeric encoding will be used. Each character of string S is converted into a set of numbers through the custom alphanumeric encoding. This conversion uses a custom alphanumeric encoding to ensure the security of the string data. For example, any string containing all numbers and letters is: 0123456789abcdefghijklmnopqrstuvwxyz. Among them, if we take a string kol1, it is converted to the numbers 20, 24, 21, 1. Therefore, the string S as kol1mayumo56 is converted to the numbers: 20, 24, 21, 01, 22, 10, 34, 30, 22, 24, 05, 06.

[0062] S600: Encrypt information into an image

[0063] (1) Determine the arrangement order of the R, G, B, and A data of the selected pixel points according to the value of the number M.

[0064] (2) Calculate the pixel point coordinates in the image according to the order in the A[n1] array.

[0065] (3) Extract the data of the corresponding pixel points, and modify the RGBA data of the selected pixel points to encrypt the text information. Randomly select addition or subtraction to calculate the values of R, G, B, and A corresponding to the pixels, and finally generate an image with the encrypted information added.

[0066] In this embodiment, A[n1] = {11868, 1834, 5460}. If the string to be encrypted is kol1mayumo56, then according to the alphanumeric encoding as 20, 24, 21, 01, 22, 10, 34, 30, 22, 24, 05, 06, taking every four as a group, they are respectively a1: (20, 24, 21, 01), a2: (22, 10, 34, 30), a3: (22, 24, 05, 06);

[0067] The ordinate of the first pixel point 11868 of A[n1] is: 11868 / 128 = 92.71875, rounding down = 92; the abscissa is 0.71875 * 128 = 92. The coordinates of the first pixel point 11868 of A[n1] are (92, 92);

[0068] The ordinate of the second pixel point 1834 of A[n1] is: 1834 / 128 = 14.328125, rounded down = 14; the abscissa is 0.328125 * 128 = 42; the coordinates of the second pixel point 1834 of A[n1] are (14, 42);

[0069] The ordinate of the third pixel point 5460 of A[n1] is: 5460 / 128 = 42.65625, rounded down = 42; the abscissa is 0.65625 * 128 = 84; the coordinates of the third pixel point 5460 of A[n1] are (42, 84);

[0070] Reference Figure 1 , in this embodiment, the original RGBA of the first pixel point with coordinates (92, 92) is (60, 51, 58, 47); the original RGBA of the second pixel point with coordinates (14, 42) is (53, 49, 46, 63); the original RGBA of the third pixel point with coordinates (42, 84) is (64, 63, 62, 54);

[0071] Reference Figure 2 , so, randomly select or mix and select addition or subtraction to the RGBA values of the corresponding pixels, and determine the RGBA data of the pixels that finally store the modified data in the order of RGBA according to the value of the number M as follows:

[0072] The calculated RGBA of the first pixel point with coordinates (92, 92) is (40, 75, 37, 48); where, 40 = 60 - 20; 75 = 51 + 24; 37 = 58 - 21; 48 = 47 + 01.

[0073] The calculated RGBA of the second pixel point with coordinates (14, 42) is (75, 59, 80, 33); where, 75 = 53 + 22; 59 = 49 + 10; 80 = 46 + 34; 33 = 63 + 30.

[0074] The calculated RGBA of the third pixel point with coordinates (42, 84) is (42, 87, 67, 60); where, 42 = 64 - 22; 87 = 63 + 24; 67 = 62 + 05; 60 = 54 + 06.

[0075] Although the present invention has been described in detail with reference to the foregoing embodiments, for those skilled in the art, they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. An authentication and encryption method, characterized in that: The steps include: S100: Obtain the MAC address and product serial number of the device and convert them into integers; the steps include: MAC address converted to integer, recorded as MAC_int; The serial number is converted to an integer, recorded as SN_int; S200: performing a data mixing operation on the integers MAC_int and SN_int to generate a new integer, which is recorded as Mixed_int; S300: converting the integer Mixed_int into a coordinate array through a variety of different algorithms, recorded as A[n1]; S400: Obtain a unique number M by calculating Mixed_int by taking the remainder; S500: character string data conversion; Convert the encrypted string data into numbers through custom alphanumeric encoding; S600: encrypting information into a picture; the steps include: S601: Determine the arrangement order of R, G, B, and A data of the selected pixel point according to the value of the number M; S602: Calculate the pixel coordinates in the image according to the order in the A[n1] array; S603: Take out the data of the corresponding pixel point, and modify the RGBA data of the selected pixel point to encrypt the text information, and calculate the R, G, B, A values ​​corresponding to the pixel by addition or subtraction, and finally generate a picture with the encrypted information added.

2. The authentication and encryption method according to claim 1, characterized in that: The steps to convert a MAC address to an integer include: S101: Split the MAC address into 6 bytes; S102: Convert each byte into a decimal value; S103: Convert into an integer by weighted summation, recorded as MAC_int.

3. The authentication and encryption method according to claim 1, characterized in that: Converting a serial number to an integer directly converts the serial number into an integer, denoted as SN_int.

4. The authentication and encryption method according to claim 1, characterized in that: Step S200 includes: S201: Convert MAC_int and SN_int into binary; S202: Align the binary values ​​of MAC_int and SN_int bit by bit, perform an XOR operation, and generate a new integer Mixed_int.

5. The authentication and encryption method according to claim 1, characterized in that: In S300, n1 in the coordinate array A[n1] is related to the number of activation code strings to be encrypted.

6. The authentication and encryption method according to claim 5, characterized in that: n1 = number of encrypted activation code strings / number of characters stored in one pixel.

7. The authentication and encryption method according to claim 5, characterized in that: n1 is equal to the number of algorithms, and the algorithms are not fixed, unique, or sequential.

8. The authentication and encryption method according to claim 1, characterized in that: The algorithms include: iterative division algorithm, lg function algorithm, and ln function algorithm.

9. The authentication and encryption method according to claim 1, characterized in that: In step S603, the addition or subtraction method used to calculate the R, G, B, A values ​​corresponding to each pixel can be randomly selected or mixed.

10. The authentication and encryption method according to claim 1, characterized in that: The value range of the number M is between 0 and 23.