Electronic identity card sensitive information transmission method based on color and gravity sensing

By embedding encrypted data into the electronic identity card and combining it with the display of device gravity information, and by using an encoder-decoder neural network and RSA algorithm, the problems of security in obtaining private keys and security in displaying sensitive information in the electronic identity card are solved, achieving efficient encrypted transmission and energy saving.

CN121567481BActive Publication Date: 2026-05-08HANGZHOU CITY BRAIN CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU CITY BRAIN CO LTD
Filing Date
2026-01-23
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing encrypted transmission methods for electronic identity cards have security issues related to private key acquisition, frequent modification of sensitive information leading to increased energy consumption, and directly displaying encrypted images reducing security.

Method used

By employing a color and gravity sensing-based approach, encrypted data is embedded in the electronic identity card using an encoder-decoder neural network. A public-private key pair is generated using the RSA algorithm, and the encrypted image is displayed in conjunction with the device's gravity information, thereby enhancing security.

Benefits of technology

It improves the security of encrypted data, reduces energy consumption, enhances the protection of sensitive information, and solves the problem of security in the transmission and display of private keys.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121567481B_ABST
    Figure CN121567481B_ABST
Patent Text Reader

Abstract

The application discloses a color and gravity sensing-based electronic identity card sensitive information transmission method, which comprises the following steps: S10, performing encryption-decryption model training to obtain an encryption-decryption model; S20, generating a public key and a private key pair for each user according to an RSA algorithm, and using the public key to perform encrypted transmission and storage when the user uploads sensitive information; generating a binary secret message by using the private key value, re-segmenting and sorting the secret message according to color information of an original electronic identity card image, generating a new binary message, embedding the original electronic identity card image through the encryption-decryption model, and forming a secret-containing image; generating a mask picture according to the color information; S30, in the process of displaying the electronic identity card on a mobile terminal, displaying the secret-containing electronic identity card according to device physical gravity information, combining the mask layer and the secret-containing picture; and S40, separating the secret-containing picture and cracking and restoring the private key by using the encryption-decryption model and the physical gravity information, and then performing corresponding secret message decryption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of electronic identity information processing technology, specifically relating to a method for transmitting sensitive information of electronic identity cards based on color and gravity sensing. Background Technology

[0002] Steganography is a method of encrypting and transmitting information. It can transmit secret information in a way that is imperceptible to the naked eye, and it can also be used as a digital watermark to identify documents. Traditional steganography methods generally hide information in the spatial domain or the frequency domain. However, traditional steganography methods have certain limitations in terms of resistance to steganography, robustness, and capacity.

[0003] In the processing of electronic identity cards, most current solutions directly use encrypted data as secret messages, and then obtain the private key through conventional methods, such as cryptographic platforms, to decrypt sensitive data. Firstly, ensuring the security of obtaining the private key is a problem. Secondly, changes to sensitive information lead to frequent QR code generation, increasing energy consumption. Furthermore, directly displaying encrypted images without adding obfuscated images also reduces security. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a method for transmitting sensitive information of electronic identity cards based on color and gravity sensing. This method uses an encoder-decoder neural network to encrypt the color space of the image itself and the gravity sensing information of the mobile device to encrypt the encrypted data and add obfuscation data to enhance the security of the data.

[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:

[0006] A method for transmitting sensitive information on an electronic identity card based on color and gravity sensing includes the following steps:

[0007] S10, train the encryption-decryption model to obtain the encryption-decryption model;

[0008] S20: The user platform generates a specific public-private key pair for each user based on the RSA algorithm. When a user uploads sensitive information, the public key is used for encrypted transmission and storage. At the same time, the private key value is used to generate a binary secret message. Based on the color information of the original electronic identity card image, the secret message is re-segmented and sorted to generate a new binary message. This new binary message is then embedded into the original electronic identity card image through an encryption-decryption model to form a encrypted image. Simultaneously, a masking image is generated based on the color information.

[0009] S30, during the display of electronic identity card on mobile device, displays encrypted electronic identity card based on device physical gravity information, combined with masked image and encrypted image;

[0010] S40 uses an encryption-decryption model and physical gravity information to separate the encrypted image, decrypt the private key, and then decrypt the corresponding secret message.

[0011] In one possible implementation, the encryption-decryption model training in S10 includes an encryption training component, specifically comprising:

[0012] S101, Generate a random binary string BKey0';

[0013] S102, Randomly generate training images for electronic identity cards;

[0014] S103, divide the color of the user's electronic identity card training image into three channels (HLS), count the values ​​of the corresponding channels, and generate three matrices of size ImageW*ImageH: MatrixH, MatrixL, and MatrixS for an ImageW*ImageH image.

[0015] S104 generates two 3*64 matrices m0 and n0, where m0 is used to record the weight values ​​of hue, brightness and saturation for subsequent reordering, and n0 is used to record the maximum proportion of hue, brightness and saturation for subsequent image restoration and color optimization.

[0016] S105, each block is based on the weight value of hue. Brightness weighting value and the weight value of saturation. Sum of interval weights ;

[0017] S106, Use the generated n0 matrix to form a mask image MaskImage;

[0018] S107, use the random binary string BKey0' as the secret message, use the electronic identity card training image as the carrier image, and input the secret message into the encoding network to generate a secret image a;

[0019] S108, the discriminator is used to distinguish between the electronic identity card training image and the encrypted image a, and the results are fed back to the encoder for multiple iterations to obtain the encrypted image b, which is more similar to the electronic identity card training image.

[0020] In one possible implementation, m0 and n0 are calculated as follows:

[0021] S1041, Divide the electronic identity card training image into 64 blocks, calculate the average hue H of each block, find the proportion of the bucket interval corresponding to the average hue H, and the hue H value with the highest proportion in that block, to obtain the hue H weight value. and the hue H value with the largest proportion of pixels in the block ;

[0022] S1042, divide the electronic identity card training image into 64 blocks, calculate the average brightness L of each block, find the proportion of the bucket interval corresponding to the average brightness L, and the brightness L value with the highest proportion in that block, to obtain the brightness L weight value. The brightness L value of the block with the largest pixel proportion ;

[0023] S1043, divide the electronic identity card training image into 64 blocks, calculate the average saturation S of each block, find the proportion of the bucket interval corresponding to the average saturation S, and the saturation S value with the highest proportion in that block, to obtain the saturation S weight value. The saturation S value with the largest proportion of pixels in the block .

[0024] In one possible implementation, the encryption-decryption model training in S10 includes a decryption part, specifically including:

[0025] S109, Add a mask image MaskImage, randomly increase the mask image MaskImage with 0.1-0.5 transparency through the blending mode, blend with the dense image b, and form a dense electronic identity card training image;

[0026] S110, The training image containing the encrypted electronic identity card is trained through a decryption network to separate the mask image and the encrypted image, thus obtaining the mask image (MaskImage). and dense image b ;

[0027] S111, the separated dense image b Using the same method as S103-S104, S1041-S1043, and S105, the n0' matrix is ​​obtained. , , and , , The comparison is performed, where j is the sequence number of the 64 blocks. The difference ratio of the maximum HSL distribution value corresponding to each block is calculated and fed back to the discriminator. Multiple iterations are performed to ensure that the separated dense image b is optimal. More closely resembles the training image for electronic identity cards;

[0028] S112, for the separated dense image b The encrypted data is obtained by using a decryption network.

[0029] S113 uses a loss function to determine the decoding result and feeds it back to the decoder to obtain a more accurate decryption result.

[0030] In one possible implementation, in S20, the user platform generates a specific public-private key pair for each user based on the RSA algorithm, and uses the public key to encrypt and store sensitive information when the user uploads it; simultaneously, generating a binary secret message from the private key value specifically includes:

[0031] S201, The user platform generates a public key-private key pair for each user according to the RSA algorithm, including public key Key1 and private key Key2;

[0032] S202, Public key Key1 is sent to the front end for encrypted transmission and storage of user-entered data;

[0033] S203, using the private key Key2, generate a first binary string BKey2 with a length that is a multiple of 64 by padding the end with 0.

[0034] In one possible implementation, in step S20, the secret message is re-segmented and sorted according to the color information of the electronic identity card itself to generate a new binary message, which is then embedded into the original image of the electronic identity card to form a encrypted image. Specifically, this includes:

[0035] S204, divide the color of the original image of the user's electronic identity card into three channels (HLS), count the values ​​of the corresponding channels, and generate three matrices of size ImageW*ImageH: MatrixH, MatrixL, and MatrixS for an image.

[0036] MatrixH represents the hue value of the corresponding pixel, ranging from 0 to 360. The data values ​​are divided into 12 buckets, each with an interval of 30, to generate a distribution histogram.

[0037] MatrixL is used to statistically analyze the brightness values ​​of pixels at corresponding locations, with values ​​ranging from 0 to 1. The data values ​​are divided into 5 buckets, with each bucket having an interval of 0.2, and a distribution histogram is generated.

[0038] MatrixS is used to statistically analyze the saturation of pixels at corresponding locations, with values ​​ranging from 0 to 100. The data values ​​are divided into 5 buckets, each with an interval of 20, and a distribution histogram is generated.

[0039] S205, generate two 3*64 matrices m and n, where m is used to record the weight values ​​of hue, brightness and saturation for subsequent reordering, and n is used to record the maximum proportion of hue, brightness and saturation for subsequent image restoration and color optimization.

[0040] S206, each block is based on the weight value of hue. Brightness weighting value and the weight value of saturation. Sum of interval weights ;

[0041] S207, divide the first binary string BKey2 into 64 segments, and according to... Reorder the strings from largest to smallest to generate the second binary string BKey2';

[0042] S208, use the n matrix to generate the mask image MaskImage;

[0043] S209, the obtained second binary string BKey2' is used as the secret message, the original image of the electronic identity card is used as the carrier image, and the secret message is fed into the encoding network to generate a secret image, that is, a secret electronic identity card.

[0044] In one possible implementation, m and n are calculated as follows:

[0045] S2051, divide the original image of the electronic identity card into 64 blocks, calculate the average hue H of each block, find the proportion of the bucket interval corresponding to the average hue H, and the hue H value with the highest proportion in that block, to obtain the hue H weight value. and the hue H value with the largest proportion of pixels in the block ;

[0046] S2052, divide the original image of the electronic identity card into 64 blocks, calculate the average brightness L of each block, find the proportion of the bucket interval corresponding to the average brightness L, and the brightness L value with the highest proportion in that block, to obtain the brightness L weight value. The brightness L value of the block with the largest pixel proportion ;

[0047] S2053, divide the original image of the electronic identity card into 64 blocks, calculate the average saturation S of each block, find the proportion of the bucket interval corresponding to the average saturation S, and the saturation S value with the highest proportion in that block, to obtain the saturation S weight value. The saturation S value with the largest proportion of pixels in the block .

[0048] In one possible implementation, in S204, MatrixH is used to statistically analyze the hue values ​​of pixels at corresponding positions, with a value range of 0 to 360. The data values ​​are divided into 12 buckets, with each bucket having an interval of 30, and a distribution histogram is generated.

[0049] MatrixL is used to statistically analyze the brightness values ​​of pixels at corresponding locations, with values ​​ranging from 0 to 1. The data values ​​are divided into 5 buckets, with each bucket having an interval of 0.2, and a distribution histogram is generated.

[0050] MatrixS is used to statistically analyze the saturation of pixels at corresponding locations, with values ​​ranging from 0 to 100. The data values ​​are divided into 5 buckets, each with an interval of 20, and a distribution histogram is generated.

[0051] In one possible implementation, the specific operation of generating the mask image MaskImage using an n-matrix in S208 is as follows: the original electronic identity card image is reduced to 1 / 64, generating 64 images, each denoted as Maski, where i represents the index of the 64 images; the Maski images are then transformed, including rotating them. deg) rotation, blur ( The Gaussian blur filter uses the `rotate()` function to rotate an element around a fixed point without distortion, where `deg` is the rotation angle; and the `blur()` function applies a blur effect to the element, where `px` is the blur unit in pixels. The transparency is achieved by sequentially combining the 64 processed Mask images into a single MaskImage of the same size as the original electronic ID card image. The mask image is generated by processing the scaled-down original image using n matrix data, and then combining the 64 processed scaled-down original images into a single mask image of the same size as the original electronic ID card image.

[0052] In one possible implementation, S30 specifically includes:

[0053] S301 uses the deviceorientation event of h5 to obtain the physical gravity information of the mobile device, and at the same time the mobile device obtains the encrypted electronic identity card and the mask image MaskImage; deviceorientation is a standard DOM event defined by the HTML5 deviceApi specification, used to obtain the physical orientation information of the device;

[0054] S302, Overlay an HTML block-level element on the encrypted electronic identity card, with the HTML block-level element using MaskImage as the background image;

[0055] S303. Based on the physical gravity information returned in real time by the deviceorientation event, the center point position is confirmed. When the center point is in the center of the image, that is, in the central 2*2 area of ​​the 8*8 or 64 parts, the MaskImage is given a transparency of 0.1. As the center point expands outward, the transparency value is increased layer by layer until the outermost circle of the center point is reached, where a transparency of 0.5 is given. The processed mask image MaskImage and the encrypted electronic identity card are then mixed.

[0056] In one possible implementation, the physical gravity information in S301 is obtained in the following way:

[0057] The `deviceorientation` event in HTML5 is used to obtain the event objects triggered when the device orientation changes. These include alpha, beta, and gamma. Alpha is the rotation angle around the z-axis, ranging from 0 to 360°, representing the device's azimuth angle; beta is the tilt angle around the x-axis, ranging from -180° to 180°; and gamma is the tilt angle around the y-axis, ranging from -90° to 90°. The `devicemotion` event in HTML5 is used to obtain the acceleration values ​​of the device's movement, including gravity, resulting in the gravitational acceleration along the x, y, and z axes. The rotational speed values ​​are also obtained, resulting in the rotational speeds around the beta, gamma, and alpha axes. Combining these values, a low-pass filter is used to remove high-frequency noise, separating a stable gravity vector. This gravity vector is then mapped to the screen coordinate system to obtain the device's physical gravity information in the real world. `devicemotion` is a standard DOM event defined in the HTML5 device API specification, used to obtain device acceleration information.

[0058] In one possible implementation, S40 specifically includes:

[0059] S401, the decryption end obtains the masked image and the mobile end returns the corresponding physical gravity information;

[0060] S402, input the encrypted image into the encryption-decryption model, and combine it with physical gravity information to obtain the second binary string of the secret message Bkey2' and the separated original image IMG';

[0061] S403, then the image undergoing color restoration is weighted according to S103-S104, S1041-S1043 and S105-S106 in the encryption steps. The second binary string Bkey2' is reversed according to the weight to obtain the corresponding private key Key2.

[0062] S404: Obtain the original privacy data based on the encrypted privacy data and the corresponding private key Key2 transmitted from the user platform. If the data is decoded correctly, it is considered to have passed the anti-counterfeiting verification.

[0063] The present invention offers the following advantages: Firstly, encryption of sensitive user information typically occurs at the ID card generation stage, thus public-private key pair generation usually happens at this stage. This scheme solves the problem of how to encrypt and transmit public-private key pairs. Secondly, directly displaying encrypted images makes them easier to crack. Introducing mobile device gravity sensing allows for the display of obfuscated data when the device's gravity position changes, enhancing security. Furthermore, addressing the issue of encrypted sensitive data being frequently modified, using encrypted public-private key pairs for transmission enhances steganography effectiveness and saves resources. Attached Figure Description

[0064] Figure 1 This is a flowchart illustrating the steps of a method for transmitting sensitive information of an electronic identity card based on color and gravity sensing, according to an embodiment of the present invention. Detailed Implementation

[0065] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0066] Reference Figure 1 The diagram shows a flowchart of a method for transmitting sensitive information of an electronic identity card based on color and gravity sensing according to an embodiment of the present invention, including the following steps:

[0067] S10, train the encryption-decryption model to obtain the encryption-decryption model;

[0068] S20: The user platform generates a specific public-private key pair for each user based on the RSA algorithm. When a user uploads sensitive information, the public key is used for encrypted transmission and storage. At the same time, the private key value is used to generate a binary secret message. Based on the color information of the original electronic identity card image, the secret message is re-segmented and sorted to generate a new binary message. This new binary message is then embedded into the original electronic identity card image through an encryption-decryption model to form a encrypted image. Simultaneously, a masking image is generated based on the color information.

[0069] S30, during the display of electronic identity card on mobile device, displays encrypted electronic identity card based on device physical gravity information, combined with masked image and encrypted image;

[0070] S40, through an encryption-decryption model and physical gravity information, allows the decryptor to separate the encrypted image, recover the private key, and then decrypt the corresponding secret message. The decryptor is typically a system platform that obtains private information by verifying an electronic identity card.

[0071] In a specific application example, the encryption-decryption model training in S10 includes an encryption training component, specifically comprising:

[0072] S101, Generate a random binary string BKey0';

[0073] S102, Randomly generate training images for electronic identity cards;

[0074] S103, divide the color of the user's electronic identity card training image into three channels (HLS), count the values ​​of the corresponding channels, and generate three matrices of size ImageW*ImageH: MatrixH, MatrixL, and MatrixS for an ImageW*ImageH image.

[0075] S104 generates two 3*64 matrices m0 and n0, where m0 is used to record the weight values ​​of hue, brightness and saturation for subsequent reordering, and n0 is used to record the maximum proportion of hue, brightness and saturation for subsequent image restoration and color optimization.

[0076] S105, each block is based on the weight value of hue. Brightness weighting value and the weight value of saturation. Sum of interval weights ;

[0077] S106, Use the generated n0 matrix to form a mask image MaskImage;

[0078] S107, use the random binary string BKey0' as the secret message, use the electronic identity card training image as the carrier image, and input the secret message into the encoding network to generate a secret image a;

[0079] S108, the discriminator is used to distinguish between the electronic identity card training image and the encrypted image a, and the results are fed back to the encoder for multiple iterations to obtain the encrypted image b, which is more similar to the electronic identity card training image.

[0080] The calculation methods for m0 and n0 are as follows:

[0081] S1041, Divide the electronic identity card training image into 64 blocks, calculate the average hue H of each block, find the proportion of the bucket interval corresponding to the average hue H, and the hue H value with the highest proportion in that block, to obtain the hue H weight value. and the hue H value with the largest proportion of pixels in the block ;

[0082] S1042, divide the electronic identity card training image into 64 blocks, calculate the average brightness L of each block, find the proportion of the bucket interval corresponding to the average brightness L, and the brightness L value with the highest proportion in that block, to obtain the brightness L weight value. The brightness L value of the block with the largest pixel proportion ;

[0083] S1043, divide the electronic identity card training image into 64 blocks, calculate the average saturation S of each block, find the proportion of the bucket interval corresponding to the average saturation S, and the saturation S value with the highest proportion in that block, to obtain the saturation S weight value. The saturation S value with the largest proportion of pixels in the block .

[0084] Furthermore, S1041 to S1043 can be implemented in the following ways:

[0085] S1041, Divide the electronic identity card training image into 64 blocks, and calculate the average hue (avg) of each block. Q is the total pixel value of a single block, j is the order of this block within the 64 blocks, i is the order of the pixel within the block, and H is the hue value. i avgH is the hue value of the i-th pixel within the block. j Find the average pixel value of the j-th block. Record the weight values ​​of the corresponding bucket intervals in the MatrixH distribution histogram. This represents the percentage of the corresponding bucket, and the H value that maximizes the pixel proportion of that block is obtained. Recorded as ;

[0086] S1042, Divide the electronic identity card training image into 64 blocks and calculate the average brightness of each block. / Q, where Q is the total pixel value of a single block, and L is the luminance value, which can be found by referring to H. Record the weight values ​​of the corresponding bucket intervals in the MatrixL distribution histogram. This represents the proportion of the corresponding bucket, and the L value that maximizes the pixel proportion of that block is obtained. Recorded as ;

[0087] S1043, divide the electronic identity card training image into 64 blocks and calculate the average saturation of each block. / Q, where Q is the total pixel value of a single block, S is the saturation value, and the rest can be found in H. Record the weight values ​​of the corresponding bucket intervals in the MatrixS distribution histogram. This represents the proportion of the corresponding bucket, and the S-value that maximizes the pixel proportion of that block is obtained. , .

[0088] In a specific application example, training an encryption-decryption model includes the decryption part, specifically:

[0089] S109, Add a mask image MaskImage, randomly increase the mask image MaskImage with 0.1-0.5 transparency through the blending mode, blend with the dense image b, and form a dense electronic identity card training image;

[0090] S110, The training image containing the encrypted electronic identity card is trained through a decryption network to separate the mask image and the encrypted image, thus obtaining the mask image (MaskImage). and dense image b ;

[0091] S111, the separated dense image b Using the same method as S103-104, S1041-1043, and S105, the n0' matrix is ​​obtained. , , and , , The comparison is performed, where j is the sequence number of the 64 blocks. The difference ratio of the maximum HSL distribution value corresponding to each block is calculated and fed back to the discriminator. Multiple iterations are performed to ensure that the separated dense image b is optimal. More closely resembles the training image for electronic identity cards;

[0092] S112, for the separated dense image b The encrypted data is obtained by using a decryption network.

[0093] S113 uses a loss function to determine the decoding result and feeds it back to the decoder to obtain a more accurate decryption result.

[0094] In a specific application example, the user platform in S20 generates a specific public-private key pair for each user based on the RSA algorithm. When a user uploads sensitive information, the public key is used for encrypted transmission and storage. Simultaneously, the private key value is used to generate a binary secret message, specifically including:

[0095] S201, The user platform generates a public key-private key pair for each user according to the RSA algorithm, including public key Key1 and private key Key2;

[0096] S202, Public key Key1 is sent to the front end for encrypted transmission and storage of user-entered data;

[0097] S203, using the private key Key2, generate a first binary string BKey2 with a length that is a multiple of 64 by padding the end with 0.

[0098] Furthermore, in S20, the secret message is re-segmented and sorted according to the color information of the electronic identity card itself to generate a new binary message, which is then embedded into the original image of the electronic identity card to form a encrypted image. Specifically, this includes:

[0099] S204, divide the color of the original image of the user's electronic identity card into three channels (HLS), count the values ​​of the corresponding channels, and generate three matrices of size ImageW*ImageH: MatrixH, MatrixL, and MatrixS for an image.

[0100] S205, generate two 3*64 matrices m and n, where m is used to record the weight values ​​of hue, brightness and saturation for subsequent reordering, and n is used to record the maximum proportion of hue, brightness and saturation for subsequent image restoration and color optimization.

[0101] S206, each block is based on the weight value of hue. Brightness weighting value and the weight value of saturation. Sum of interval weights ;

[0102] S207, divide the first binary string BKey2 into 64 segments, and according to... Reorder the strings from largest to smallest to generate the second binary string BKey2';

[0103] S208, use the n matrix to generate the mask image MaskImage;

[0104] S209, the obtained second binary string BKey2' is used as the secret message, the original image of the electronic identity card is used as the carrier image, and the secret message is fed into the encoding network to generate a secret image, that is, a secret electronic identity card.

[0105] The calculation methods for m and n are as follows:

[0106] S2051, divide the original image of the electronic identity card into 64 blocks, calculate the average hue H of each block, find the proportion of the bucket interval corresponding to the average hue H, and the hue H value with the highest proportion in that block, to obtain the hue H weight value. and the hue H value with the largest proportion of pixels in the block ;

[0107] S2052, divide the original image of the electronic identity card into 64 blocks, calculate the average brightness L of each block, find the proportion of the bucket interval corresponding to the average brightness L, and the brightness L value with the highest proportion in that block, to obtain the brightness L weight value. The brightness L value of the block with the largest pixel proportion ;

[0108] S2053, divide the original image of the electronic identity card into 64 blocks, calculate the average saturation S of each block, find the proportion of the bucket interval corresponding to the average saturation S, and the saturation S value with the highest proportion in that block, to obtain the saturation S weight value. The saturation S value with the largest proportion of pixels in the block .

[0109] Furthermore, S2051 to S2053 can be implemented in the following ways:

[0110] S2051, divide the original image of the electronic identity card into 64 blocks, and calculate the average hue (avg) of each block. Q is the total pixel value of a single block, j is the order of this block within the 64 blocks, i is the order of the pixel within the block, and H is the hue value. i avgH is the hue value of the i-th pixel within the block. j Find the average pixel value of the j-th block. Record the weight values ​​of the corresponding bucket intervals in the MatrixH distribution histogram. This represents the percentage of the corresponding bucket, and the H value that maximizes the pixel proportion of that block is obtained. Recorded as For example, if there are 4 pixels in this range with values ​​[100, 100, 100, 60], then avgH j The value is 360 / 4 = 90, and maxHj is 100.

[0111] S2052, divide the original image of the electronic identity card into 64 blocks, and calculate the average brightness of each block. / Q, where Q is the total pixel value of a single block, and L is the luminance value, which can be found by referring to H. Record the weight values ​​of the corresponding bucket intervals in the MatrixL distribution histogram. This represents the proportion of the corresponding bucket, and the L value that maximizes the pixel proportion of that block is obtained. Recorded as ;

[0112] S2053 divides the original image of the electronic identity card into 64 blocks and calculates the average saturation of each block. / Q, where Q is the total pixel value of a single block, S is the saturation value, and the rest can be found in H. Record the weight values ​​of the corresponding bucket intervals in the MatrixS distribution histogram. This represents the proportion of the corresponding bucket, and the S-value that maximizes the pixel proportion of that block is obtained. , .

[0113] Furthermore, in S208, the specific operation of generating the mask image MaskImage using an n-matrix is ​​as follows: the original electronic identity card image is reduced to 1 / 64, generating 64 images, each denoted as Maski, where i represents the index of the 64 images; the Maski images are then transformed, including rotating them. deg) rotation, blur ( The Gaussian blur filter uses the `rotate()` function to rotate an element around a fixed point without distortion, where `deg` is the rotation angle; and the `blur()` function applies a blur effect to the element, where `px` is the blur unit in pixels. The transparency is achieved by sequentially combining the 64 processed Mask images into a single MaskImage of the same size as the original electronic ID card image. The mask image is generated by processing the scaled-down original image using n matrix data, and then combining the 64 processed scaled-down original images into a single mask image of the same size as the original electronic ID card image.

[0114] Another embodiment of the present invention provides a method for transmitting sensitive information of an electronic identity card based on color and gravity sensing, wherein S30 specifically includes:

[0115] S301, using the `deviceorientation` event in HTML5, obtains the `DeviceOrientationEvent` object, which is the event triggered when the device orientation changes. This object contains: `alpha`: the rotation angle around the z-axis (perpendicular to the screen plane), ranging from 0-360°, representing the device's azimuth angle; `beta`: the tilt angle around the x-axis (the horizontal axis of the device's left-right direction), ranging from approximately -180° to 180°; and `gamma`: the tilt angle around the y-axis (the horizontal axis of the device's up-down direction), ranging from approximately -90° to 90°. Using the `devicemotion` event in HTML5, obtains the acceleration (including gravitational force) values ​​of the device movement, resulting in the gravitational acceleration along the x, y, and z axes, and the rotational speed (`rotationRate`) values, resulting in the rotational speeds around the beta, gamma, and alpha axes. By combining these values, a low-pass filter is used to remove high-frequency noise, separating a stable gravity vector. Mapping the gravity vector to the screen coordinate system yields the device's physical gravity information in the real world. Simultaneously, the mobile device obtains a encrypted electronic identity card and a mask image (MaskImage). `deviceorientation` is a standard DOM event defined by the HTML5 deviceAPI specification, used to obtain the device's physical orientation information. `devicemotion` is a standard DOM event defined by the HTML5 deviceAPI specification, used to obtain the device's acceleration information.

[0116] S302, Overlay an HTML block-level element on the encrypted electronic identity card, with the HTML block-level element using MaskImage as the background image;

[0117] S303: Based on the real-time physical gravity information returned by the deviceorientation event, the center point position is determined. When the center point is at the center of the image (i.e., the central 2x2 area out of 64 parts in an 8x8 format), the MaskImage is given an opacity of 0.1. As the center point expands outwards, the opacity value is increased layer by layer until the outermost edge of the center point is given an opacity of 0.5. The processed MaskImage and the encrypted electronic identity card are then blended, using a mix-blend-mode of overlay. The mix-blend-mode attribute specifies how the content of an element should blend with its direct parent background, while overlay is a layer blending mode.

[0118] Another embodiment of the present invention provides a method for transmitting sensitive information of an electronic identity card based on color and gravity sensing, wherein S40 specifically includes:

[0119] S401, the decryption end obtains the masked image and the mobile end returns the corresponding physical gravity information;

[0120] S402, input the encrypted image into the encryption-decryption model, and combine it with physical gravity information to obtain the second binary string of the secret message Bkey2' and the separated original image IMG';

[0121] S403, then the image undergoing color restoration is weighted according to S103-S104, S1041-S1043 and S105-S106 in the encryption steps. The second binary string Bkey2' is reversed according to the weight to obtain the corresponding private key Key2.

[0122] S404: Obtain the original privacy data based on the encrypted privacy data and the corresponding private key Key2 transmitted from the user platform. If the data is decoded correctly, it is considered to have passed the anti-counterfeiting verification.

[0123] The above-described method for transmitting sensitive information on electronic identity cards based on color and gravity sensing involves the user platform generating a specific public-private key pair for each user using the RSA algorithm. When a user uploads sensitive information, the public key is used for encrypted transmission and storage. Simultaneously, the private key value is used to generate a binary secret message. Then, based on the color information of the electronic identity card itself, the secret message is re-segmented and sorted to generate a new binary message, which is then embedded into the electronic identity card. At the same time, obfuscated information is generated and embedded into the electronic identity card using the same steps to create an obfuscated identity card. During the display of the electronic identity card on the mobile device, a coded image is displayed based on physical gravity information. The decryptor obtains the gravity information range corresponding to the coded information using the private key, decrypts the coded image to recover the private key, and then decrypts the corresponding secret message. By utilizing an encoder-decoder neural network to encrypt the color space of the image itself and the physical gravity information of the mobile device, the encrypted data is further encrypted, and obfuscated data is added to enhance data security.

[0124] It should be understood that the exemplary embodiments described herein are illustrative and not restrictive. Although one or more embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art will understand that various changes in form and detail may be made without departing from the spirit and scope of the invention as defined by the appended claims.

Claims

1. A method for transmitting sensitive information of an electronic identity card based on color and gravity sensing, characterized in that, Includes the following steps: S10, train the encryption-decryption model to obtain the encryption-decryption model; S20: The user platform generates a specific public-private key pair for each user based on the RSA algorithm. When a user uploads sensitive information, the public key is used for encrypted transmission and storage. At the same time, the private key value is used to generate a binary secret message. Based on the color information of the original electronic identity card image, the secret message is re-segmented and sorted to generate a new binary message. This new binary message is then embedded into the original electronic identity card image through an encryption-decryption model to form a encrypted image. Simultaneously, a masking image is generated based on the color information. S30, during the display of electronic identity card on mobile device, displays encrypted electronic identity card based on device physical gravity information, combined with masked image and encrypted image; S40 uses an encryption-decryption model and physical gravity information to separate the encrypted image, decrypt the private key, and then decrypt the corresponding secret message.

2. The method for transmitting sensitive information of electronic identity cards based on color and gravity sensing as described in claim 1, characterized in that, Training the encryption-decryption model in S10 includes an encryption training component, specifically: S101, Generate a random binary string BKey0'; S102, Randomly generate training images for electronic identity cards; S103, divide the color of the user's electronic identity card training image into three channels (HLS), count the values ​​of the corresponding channels, and generate three matrices of size ImageW*ImageH: MatrixH, MatrixL, and MatrixS for an ImageW*ImageH image. S104 generates two 3*64 matrices m0 and n0, where m0 is used to record the weight values ​​of hue, brightness and saturation for subsequent reordering, and n0 is used to record the maximum proportion of hue, brightness and saturation for subsequent image restoration and color optimization. S105, each block is based on the weight value of hue. Brightness weighting value and the weight value of saturation. Sum of interval weights ; S106, Use the generated n0 matrix to form a mask image MaskImage; S107, use the random binary string BKey0' as the secret message, use the electronic identity card training image as the carrier image, and input the secret message into the encoding network to generate a secret image a; S108, the discriminator is used to distinguish between the electronic identity card training image and the encrypted image a, and the results are fed back to the encoder for multiple iterations to obtain the encrypted image b, which is more similar to the electronic identity card training image.

3. The method for transmitting sensitive information of an electronic identity card based on color and gravity sensing as described in claim 2, characterized in that, The calculation methods for m0 and n0 are as follows: S1041, Divide the electronic identity card training image into 64 blocks, calculate the average hue H of each block, find the proportion of the bucket interval corresponding to the average hue H, and the hue H value with the highest proportion in that block, to obtain the hue H weight value. and the hue H value with the largest proportion of pixels in the block ; S1042, divide the electronic identity card training image into 64 blocks, calculate the average brightness L of each block, find the proportion of the bucket interval corresponding to the average brightness L, and the brightness L value with the highest proportion in that block, to obtain the brightness L weight value. The brightness L value of the block with the largest pixel proportion ; S1043, divide the electronic identity card training image into 64 blocks, calculate the average saturation S of each block, find the proportion of the bucket interval corresponding to the average saturation S, and the saturation S value with the highest proportion in that block, to obtain the saturation S weight value. The saturation S value with the largest proportion of pixels in the block .

4. The method for transmitting sensitive information of an electronic identity card based on color and gravity sensing as described in claim 3, characterized in that, Training the encryption-decryption model in S10 includes the decryption part, specifically: S109, Add a mask image MaskImage, randomly increase the mask image MaskImage with 0.1-0.5 transparency through the blending mode, blend with the dense image b, and form a dense electronic identity card training image; S110, The training image containing the encrypted electronic identity card is trained through a decryption network to separate the mask image and the encrypted image, thus obtaining the mask image (MaskImage). and dense image b ; S111, the separated dense image b Using the same method as S103-S104, S1041-S1043, and S105, the n0' matrix is ​​obtained. , , and , , The comparison is performed, where j is the sequence number of the 64 blocks. The difference ratio of the maximum HSL distribution value corresponding to each block is calculated and fed back to the discriminator. Multiple iterations are performed to ensure that the separated dense image b is optimal. More closely resembles the training image for electronic identity cards; S112, for the separated dense image b The encrypted data is obtained by using a decryption network. S113 uses a loss function to determine the decoding result and feeds it back to the decoder to obtain a more accurate decryption result.

5. The method for transmitting sensitive information of an electronic identity card based on color and gravity sensing as described in claim 4, characterized in that, In S20, the user platform generates a specific public-private key pair for each user based on the RSA algorithm. When a user uploads sensitive information, the public key is used for encrypted transmission and storage. Simultaneously, the private key value is used to generate a binary secret message, specifically including: S201, The user platform generates a public key-private key pair for each user according to the RSA algorithm, including public key Key1 and private key Key2; S202, Public key Key1 is sent to the front end for encrypted transmission and storage of user-entered data; S203, using the private key Key2, generate a first binary string BKey2 with a length that is a multiple of 64 by padding the end with 0.

6. The method for transmitting sensitive information of an electronic identity card based on color and gravity sensing as described in claim 5, characterized in that, In S20, the secret message is re-segmented and sorted according to the color information of the electronic identity card itself to generate a new binary message, which is then embedded into the original image of the electronic identity card to form a encrypted image. Specifically, this includes: S204, divide the color of the original image of the user's electronic identity card into three channels (HLS), count the values ​​of the corresponding channels, and generate three matrices of size ImageW*ImageH: MatrixH, MatrixL, and MatrixS for an image. S205, generate two 3*64 matrices m and n, where m is used to record the weight values ​​of hue, brightness and saturation for subsequent reordering, and n is used to record the maximum proportion of hue, brightness and saturation for subsequent image restoration and color optimization. S206, each block is based on the weight value of hue. Brightness weighting value and the weight value of saturation. Sum of interval weights ; S207, divide the first binary string BKey2 into 64 segments, and according to... Reorder the strings from largest to smallest to generate the second binary string BKey2'; S208, use the n matrix to generate the mask image MaskImage; S209, the obtained second binary string BKey2' is used as the secret message, the original image of the electronic identity card is used as the carrier image, and the secret message is fed into the encoding network to generate a secret image, that is, a secret electronic identity card.

7. The method for transmitting sensitive information of an electronic identity card based on color and gravity sensing as described in claim 6, characterized in that, The calculation methods for m and n are as follows: S2051, divide the original image of the electronic identity card into 64 blocks, calculate the average hue H of each block, find the proportion of the bucket interval corresponding to the average hue H, and the hue H value with the highest proportion in that block, to obtain the hue H weight value. and the hue H value with the largest proportion of pixels in the block ; S2052, divide the original image of the electronic identity card into 64 blocks, calculate the average brightness L of each block, find the proportion of the bucket interval corresponding to the average brightness L, and the brightness L value with the highest proportion in that block, to obtain the brightness L weight value. The brightness L value of the block with the largest pixel proportion ; S2053, divide the original image of the electronic identity card into 64 blocks, calculate the average saturation S of each block, find the proportion of the bucket interval corresponding to the average saturation S, and the saturation S value with the highest proportion in that block, to obtain the saturation S weight value. The saturation S value with the largest proportion of pixels in the block .

8. The method for transmitting sensitive information of an electronic identity card based on color and gravity sensing as described in claim 6, characterized in that, In S204, MatrixH is used to statistically analyze the hue values ​​of pixels at corresponding positions, with a value range of 0 to 360. The data values ​​are divided into 12 buckets, with each bucket having an interval of 30, and a distribution histogram is generated. MatrixL is used to statistically analyze the brightness values ​​of pixels at corresponding locations, with values ​​ranging from 0 to 1. The data values ​​are divided into 5 buckets, with each bucket having an interval of 0.2, and a distribution histogram is generated. MatrixS is used to statistically analyze the saturation of pixels at corresponding locations, with values ​​ranging from 0 to 100. The data values ​​are divided into 5 buckets, each with an interval of 20, and a distribution histogram is generated.

9. The method for transmitting sensitive information of an electronic identity card based on color and gravity sensing as described in claim 6, characterized in that, In S208, the specific operation of generating the mask image MaskImage using an n-matrix is ​​as follows: the original electronic identity card image is reduced to 1 / 64, generating 64 images, each denoted as Maski, where i represents the index of the 64 images; the Maski images are then transformed, including rotating them. deg) rotation, blur ( The Gaussian blur filter is applied, where the `rotate()` function rotates an element around a fixed point without distortion, `deg` is the rotation angle; the `blur()` function applies a blur effect to the element, `px` is the blur unit in pixels, and... The transparency is achieved by sequentially combining the 64 processed Mask images into a single MaskImage of the same size as the original electronic ID card image. The mask image is generated by processing the scaled-down original image using n matrix data, and then combining the 64 processed scaled-down original images into a single mask image of the same size as the original electronic ID card image.

10. The method for transmitting sensitive information of an electronic identity card based on color and gravity sensing as described in claim 6, characterized in that, S30 specifically includes: S301 uses the h5 deviceorientation event to obtain the physical gravity information of the mobile device, and at the same time the mobile device obtains the encrypted electronic identity card and the mask image MaskImage; deviceorientation is a standard DOM event defined by the HTML5 deviceApi specification, used to obtain the physical orientation information of the device; S302, Overlay an HTML block-level element on the encrypted electronic identity card, with the HTML block-level element using MaskImage as the background image; S303. Based on the physical gravity information returned in real time by the deviceorientation event, the center point position is confirmed. When the center point is in the center of the image, that is, in the central 2*2 area of ​​the 8*8 or 64 parts, the MaskImage is given a transparency of 0.

1. As the center point expands outward, the transparency value is increased layer by layer until the outermost circle of the center point is reached, where a transparency of 0.5 is given. The processed mask image MaskImage and the encrypted electronic identity card are then mixed.

11. The method for transmitting sensitive information of an electronic identity card based on color and gravity sensing as described in claim 10, characterized in that, The physical gravity information described in S301 is obtained through the following methods: The `deviceorientation` event in HTML5 is used to obtain the event objects triggered when the device orientation changes. These include alpha, beta, and gamma. Alpha is the rotation angle around the z-axis, ranging from 0 to 360°, representing the device's azimuth angle; beta is the tilt angle around the x-axis, ranging from -180° to 180°; and gamma is the tilt angle around the y-axis, ranging from -90° to 90°. The `devicemotion` event in HTML5 is used to obtain the acceleration values ​​of the device's movement, including gravity, resulting in the gravitational acceleration along the x, y, and z axes. The rotational speed values ​​are also obtained, resulting in the rotational speeds around the beta, gamma, and alpha axes. Combining these values, a low-pass filter is used to remove high-frequency noise, separating a stable gravity vector. This gravity vector is then mapped to the screen coordinate system to obtain the device's physical gravity information in the real world. `devicemotion` is a standard DOM event defined in the HTML5 device API specification, used to obtain device acceleration information.

12. The method for transmitting sensitive information of an electronic identity card based on color and gravity sensing as described in claim 6, characterized in that, S40 specifically includes: S401, the decryption end obtains the masked image and the mobile end returns the corresponding physical gravity information; S402, input the encrypted image into the encryption-decryption model, and combine it with physical gravity information to obtain the second binary string of the secret message Bkey2' and the separated original image IMG'; S403, then the image undergoing color restoration is weighted according to S103-S104, S1041-S1043 and S105-S106 in the encryption steps. The second binary string Bkey2' is reversed according to the weight to obtain the corresponding private key Key2. S404: Obtain the original privacy data based on the encrypted privacy data and the corresponding private key Key2 transmitted from the user platform. If the data is decoded correctly, it is considered to have passed the anti-counterfeiting verification.

Citation Information

Patent Citations

  • Mosaic puzzle camouflage steganography method for rotating image blocks

    CN115908092A

  • Image encryption and decryption method and electronic equipment

    CN117201688A