Electronic signature encryption method, system and device and medium

By managing the master key and session key in the encryption and decryption chip, the electronic signature trajectory data is encrypted and decrypted, and the security problem of electronic signatures in transmission and storage is solved, achieving higher security and reliability.

CN119788359AActive Publication Date: 2025-04-08SHANDONG SINOCHIP SEMICON CO LTD

Patent Information

Application Number
CN202411880122.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-04-08
Estimated Expiration
2044-12-19

AI Technical Summary

Technical Problem

The security issues of electronic signatures during transmission and storage lead to the possible leakage of personal handwritten biometric information of users, bringing economic and security risks.

Method used

An electronic signature encryption method is adopted to encrypt and decrypt the signature track data in real time by generating and managing the master key and session key in the encryption and decryption chip to ensure the security of the data during transmission and storage.

Benefits of technology

It effectively improves the security and reliability of electronic signatures, prevents signature data leakage, and ensures the security of user personal information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119788359A_ABST
    Figure CN119788359A_ABST
Patent Text Reader

Abstract

The invention relates to the field of information security, in particular to an electronic signature encryption method, system and device and a medium. According to the invention, the encryption and decryption chip is enumerated as HID human body input equipment, the encryption and decryption chip is connected with the electromagnetic screen and is used for acquiring screen coordinate points of the electromagnetic screen, the acquired coordinate points are firstly subjected to effective area filtering, and the effective coordinate points are encrypted by the encryption and decryption chip and then reported to a PC (Personal Computer) end. And the PC terminal decrypts the received encrypted data to obtain coordinate points, converts the coordinate points into coordinates of the current window, draws handwriting in the current window, and finally stores the original coordinate points. And after the user finishes signing, generating a vector picture and encrypting the handwriting data of the signature. The security problem of the electronic signature in the transmission and storage process is solved, and the personal handwritten biological characteristic information of the user is effectively guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security, and in particular to an electronic signature encryption method, system, device and medium. Background Art

[0002] With the development and progress of society, electronic signatures have become a convenient and fast way to identify and sign documents. Electronic signatures represent the authorization and approval of the signatory, and have the same legal effect as handwritten signatures and seals. They have been widely used in financial, mobile and other business systems, providing more convenient and efficient services for enterprises and individuals.

[0003] Electronic signatures are implemented through signature media such as capacitive screens and electromagnetic screens. The electromagnetic screen collects the user's handwriting information in real time, and then uploads the handwriting information to the computer. The computer draws the signature image after receiving the handwriting information. When writing on the electromagnetic screen, the built-in pressure sensor is touched, and the pressure obtained by the pressure sensor is combined with the change in the magnetic field to define the unique Z-axis of the electromagnetic screen technology. The electromagnetic screen uses electromagnetic pressure sensing technology to achieve precise touch and original handwriting writing, making the signature handwriting closer to the original handwriting of the signer. The security of the signature handwriting is the core of electronic signature technology. Once the user's signature information is leaked during the transmission and storage process between the electromagnetic screen and the computer, it will bring serious economic and security risks to the user. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide an electronic signature encryption method, system, device and medium, which solves the security problem of electronic signatures during transmission and storage, and effectively protects the user's personal handwritten biometric information.

[0005] In order to solve the technical problem, the technical solution adopted by the present invention is: an electronic signature encryption method, comprising the following steps: S01. Inject the master key. The master key is generated by the server. The PC encrypts the master key sent by the server with the session key to obtain the ciphertext PriKey', and then sends the ciphertext PriKey' and the number of master keys to the encryption and decryption chip. The encryption and decryption chip decrypts the ciphertext PriKey' with the session key to obtain the master key plaintext, and stores the master key plaintext in the chip NORFLASH; the master key is used to decrypt the working key, and the working key is used to encrypt the trajectory data when obtaining the electronic signature; S02, signature is turned on, the interface library of the PC generates a signature area according to the window size passed in by the APP, and transmits the starting point coordinates, width and height of the signature area to the encryption and decryption chip, and the encryption and decryption chip generates a handwriting valid area according to the input signature area starting point coordinates, width and height; at the same time, the interface library of the PC also negotiates with the encryption and decryption chip to obtain the session key required for a single coordinate transmission, and after the signature is turned on, the encryption and decryption chip receives the data sent by the handwriting device; S03, real-time signature drawing. After the signature is turned on, the encryption and decryption chip receives the plaintext coordinates sent by the handwriting device, calculates the horizontal coordinate, vertical coordinate and pressure of the original coordinate point, first filters the original coordinate points, filters out the original coordinate points outside the handwriting effective area, and the remaining are valid coordinate points. The valid coordinate points are integrated into the HID format, encrypted into ciphertext coordinates with the session key and sent to the PC. After the interface library of the PC receives the ciphertext coordinates, it uses the session key to decrypt the ciphertext coordinates to obtain the original coordinate value, and then converts the original coordinate value into the current window coordinate, draws the handwriting, and saves the original coordinate value; S04, obtaining the electronic signature. After the user signs, the electronic signature is obtained. The interface library on the PC sends all the stored original coordinate values ​​in segments to the encryption and decryption chip. The encryption and decryption chip encrypts the data using the working key to obtain the encrypted trajectory data and returns it to the PC. Step S04 is specifically as follows: S41, after receiving the command to obtain the electronic signature, the interface library of the PC uses the session key to encrypt the signature trajectory data, and imports the encryption working key and master key number transmitted by the server, and the interface library generates a trajectory image for the original coordinate value and saves it to the specified location of the PC; S42, the encrypted ciphertext of the signature trajectory data, the encrypted working key and the master key number are sent to the encryption and decryption chip. After receiving the data, the encryption and decryption chip first uses the session key to decrypt the plaintext data of the signature trajectory data, and then obtains the corresponding master key PriKey according to the master key number, and uses the master key PriKey to decrypt the encrypted working key WorkKey' to obtain the plaintext working key WorkKey; S43. The plaintext work key WorkKey is used as an encryption key to encrypt the plaintext data of this segment of the signed trajectory data, obtain the encrypted trajectory data, and return it to the PC.

[0006] Furthermore, the session key generation process is: S11, PC and encryption / decryption chip generate their own random numbers pr and dr respectively, and then complete the random number exchange between the two parties; S12, PC sends a command to obtain the public key to the encryption and decryption chip. After receiving the command, the encryption and decryption chip reads the public key in the NORFLASH on the chip and returns it to the PC; S13, the PC generates a random seed, encrypts the random seed using a public key, and sends the encryption result to the encryption and decryption chip, which decrypts the encryption result using an internal private key to obtain the random seed; S14, PC and encryption / decryption chip use the seed key to XOR the random numbers dr and pr bit by bit to obtain the session key.

[0007] Furthermore, the session key adopts a one-time pad mechanism.

[0008] Furthermore, in step S03, the signature handwriting drawing on the PC side is completed in the interface library. A hook is installed in the interface library using the SetWindowsHookEx function to monitor and intercept the message queue sent to the APP window program, and the drawing of the APP window area is achieved by intercepting the WM_PAIT message. The interface library first records the first point collected, and after collecting the second point, GDI plus the graphics device interface is used to complete the straight line drawing. After collecting the third point, a straight line is drawn between the third point and the second point, and the same operation is performed on the last point collected until the entire signature process is completed.

[0009] Furthermore, a buffer is set during the drawing process, drawing is first performed in the buffer, and then the bitmap of the buffer is copied to the canvas at one time.

[0010] Furthermore, when the encryption and decryption chip is used for the first time or the firmware needs to be updated after being locked, the encryption and decryption chip is unlocked first. When unlocking the encryption and decryption chip, not only the locked state of the encryption and decryption chip is released, but also a session key is generated for collecting coordinate communications. At the same time, the encryption and decryption chip detects in real time whether it has been violently disassembled. When the detection point inputs a high level, it is determined that the encryption and decryption chip has been violently disassembled. At this time, the encryption and decryption chip erases the master key and sets the encryption and decryption chip to a locked state.

[0011] Furthermore, when the encryption and decryption chip is unlocked, the interface library of the PC uses a fixed key plus random number mechanism to communicate with the encryption and decryption chip, and all commands are encrypted and transmitted. First, the PC and the encryption and decryption chip generate their own random numbers respectively. After the random numbers of both parties are exchanged, the final communication commands need to add the PC random number and the encryption and decryption chip random number.

[0012] The present invention also discloses an electronic signature encryption system, including a signature handwriting device, an encryption and decryption chip and a PC. The PC is provided with an interface library. The user draws a signature on the signature handwriting device. The encryption and decryption chip is connected to the signature handwriting device and is used to collect coordinate points on the signature handwriting device. The collected coordinate points are first filtered in an effective area to obtain valid point coordinates. The valid point coordinates are encrypted by the encryption and decryption chip and then uploaded to the PC. The PC decrypts the received encrypted data to obtain original coordinate points, and then converts the original coordinate points into current window coordinates. The writing handwriting is drawn in the current window, and finally the original coordinate points are saved. After the user completes the signature, a vector image is generated and the signature handwriting data is encrypted for the user to obtain the electronic signature.

[0013] The present invention also discloses an electronic signature encryption device, comprising a processor and a memory storing program instructions, wherein the processor is configured to execute the electronic signature encryption method as described above when running the program instructions.

[0014] A storage medium stores program instructions, which, when running, execute the electronic signature encryption method as described above.

[0015] Beneficial effects of the invention: The electromagnetic capacitance dual-control screen electronic signature encryption method proposed in the invention adopts original handwriting and a secure encryption mechanism. While supporting original handwriting, the electronic signature supports national secret algorithm encryption, which solves the security problem of signature data in the transmission and storage process, effectively improves the security and reliability of the signature, and has good application prospects in application scenarios such as finance, banking, telecommunications, and government affairs. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 This is a schematic diagram of the structure of the electronic signature encryption system described in Example 1; Figure 2 This is a schematic diagram of the working principle of the electronic signature encryption system described in Example 1; Figure 3 Flowchart for injecting master key; Figure 4 This is a schematic diagram of the HID plain text format; Figure 5 To start the signature flow chart; Figure 6 Flowchart for obtaining electronic signatures; Figure 7 Flowchart of the mechanism for adding random numbers to fixed keys; Figure 8 Flowchart for session key generation. DETAILED DESCRIPTION

[0017] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0018] Example 1 This embodiment 1 discloses an electronic signature encryption system, such as Figure 1 As shown in the figure, it includes a signature handwriting device, an encryption and decryption chip and a PC. The signature handwriting device adopts electromagnetic and capacitive dual control, and the electromagnetic screen and the capacitive screen are bonded together to realize the original handwriting writing of the passive wireless magnetic pen. The encryption and decryption chip adopts the USB3.0 main control chip HX6802, which supports the national secret SM1, SM2, SM3, SM4 and other algorithm modules, and has passed the national commercial secret test. The PC end is equipped with an interface library and contains three software: electronic signature software, unlocking software and decryption software. Data interaction mainly includes data interaction between the signature software and the interface library, between the interface library DLL and HX6802, and between HX6802 and the electromagnetic screen.

[0019] In this embodiment, the encryption and decryption chip HX6802 is enumerated as a HID human input device, and the HX6802 communicates with the electromagnetic screen via UART. Figure 2 As shown in the figure, the user draws the signature through the electromagnetic capacitance dual control evaluation, and the HX6802 collects the coordinate points of the electromagnetic screen. The collected coordinate points are first filtered in the effective area, and the effective coordinate points are encrypted by the HX6802 encryption engine SM4 and reported to the PC through the USB interface. The PC receives the encrypted data and decrypts it by SM4 to obtain the coordinate points, then converts the coordinate points into the current window coordinates, draws the handwriting in the current window, and finally saves the original coordinate points. After the user completes the signature, a vector image is generated and the handwriting data of the signature is encrypted.

[0020] Example 2 This embodiment discloses an electronic signature encryption method, which is implemented based on the system described in Example 1 and includes three aspects: device unlocking, handwritten signature, and secure communication mechanism.

[0021] Device unlocking: When the user uses the device for the first time or needs to re-update the firmware after the device is locked, the user needs to unlock the device first. When the device is unlocked, it is necessary not only to release the device lock state, but also to generate the SM2 key pair that needs to be encrypted when collecting coordinates for communication. The HX6802 firmware detects in real time whether the device has been violently disassembled. When the detection point inputs a high level, it is determined that the device has been violently disassembled. At this time, HX6802 erases the master key and sets the device to a locked state.

[0022] Handwritten signature, handwritten signature mainly includes functional interfaces such as injecting master key, signature startup, real-time signature drawing, and obtaining electronic signature.

[0023] The master key is generated by the server and imported into the encryption and decryption chip HX6802 through the PC. It supports up to 16 sets of master keys, numbered 1-16. This key is used to decrypt the working key. Working key: used to encrypt the trajectory data when obtaining the electronic signature.

[0024] like Figure 3 As shown in the figure, the process of injecting the master key is: the PC and the encryption and decryption chip HX6802 negotiate the session key, then the PC encrypts the master key sent by the server with the session key to obtain the ciphertext PriKey', and sends the ciphertext PriKey' and the number of master keys to HX6802, HX6802 decrypts the ciphertext PriKey' with the session key to obtain the master key plaintext, and stores the master key plaintext in the chip NORFLASH.

[0025] After the signature is turned on, the interface library generates a signature area according to the window size passed in by the APP, and transmits the horizontal coordinate x of the signature area, the vertical coordinate y of the signature area, the width w of the signature area, and the height h of the signature area to HX6802; at the same time, the DLL also needs to negotiate with HX6802 for the SM4 encryption key required for a single coordinate transmission. After the signature is turned on, HX6802 enables the serial port receiving interrupt to receive the serial port data sent by the electromagnetic screen. HX6802 converts the horizontal and vertical coordinates, width and height of the input signature area starting point into the effective area of ​​the electromagnetic screen. The effective area of ​​the electromagnetic gun is used to filter out the original coordinate points outside the effective area of ​​the electromagnetic screen.

[0026] After the signature is turned on, HX6802 starts the real-time signature drawing process. After the signature is turned on, HX6802 receives the serial port data sent by the electromagnetic screen serial port and calculates the horizontal coordinate x, vertical coordinate y, and pressure p of the original coordinate point. First, the original coordinate points are filtered to remove the original coordinate points outside the effective area of ​​the electromagnetic screen. The remaining coordinate points are valid coordinate points, and the valid coordinate points are integrated into the HID format (HID plain text format is as follows Figure 4 After receiving the data, the interface library decrypts the data through SM4 to obtain the coordinate value, then converts the coordinate value into the current window coordinate, draws the handwriting, and saves the original coordinate value. Figure 5 shown.

[0027] PC-side handwriting drawing: PC-side signature handwriting drawing is completed on the DLL side, which is convenient for client program calls and porting. Use the SetWindowsHookEx function on the DLL side to install a hook to monitor and intercept the message queue sent to the APP window program, and intercept the WM_PAIT message to draw the APP window area. The DLL side first records the first point collected, and after collecting the second point, uses the GDI+ graphics device interface to complete the straight line drawing. The straight line drawing process is: first, convert the brush width according to the current pressure sensitivity, and set the brush end line type to a round endpoint (LineCapRound); secondly, call SmoothingModeAntiAlias ​​to eliminate aliasing; finally, call DrawLine to complete the straight line drawing between the two points.

[0028] After collecting the third point, a straight line is drawn between the third point and the second point, and the whole signature process is completed in this way. The whole drawing process uses a double buffer mechanism, first drawing in the buffer, and then copying the bitmap of the buffer to the canvas at one time to solve the problem of interface flickering during the drawing process (the other side of the buffer is performed during the interface display process, which is an existing technology and will not be repeated here).

[0029] After the user signs, the electronic signature will be acquired. The PC interface library will send all the stored original coordinate values ​​to HX6802 in segments. HX6802 will perform SM4 symmetric encryption on the data to obtain encrypted trajectory data. Figure 6 The process is specifically as follows: S41, after receiving the command to obtain the electronic signature, the interface library of the PC uses the session key to encrypt the signature trajectory data, and imports the encryption working key and master key number transmitted by the server, and the interface library generates a trajectory image for the original coordinate value and saves it to the specified location of the PC; S42, the encrypted ciphertext of the signature trajectory data, the encrypted working key and the master key number are sent to HX6802. After receiving the data, HX6802 first uses the session key to decrypt the plaintext data of the signature trajectory data, and then obtains the corresponding master key PriKey according to the master key number, and uses the master key PriKey to decrypt the encrypted working key WorkKey' to obtain the plaintext working key WorkKey; S43. The plaintext work key WorkKey is used as an encryption key to encrypt the plaintext data of this segment of the signed trajectory data, obtain the encrypted trajectory data, and return it to the PC.

[0030] The electronic signature encryption method described in this embodiment involves two communication mechanisms, one is a fixed key plus random number mechanism, and the other is a session key negotiation mechanism.

[0031] When the device is unlocked, the PC interface library uses a "fixed key + random number" mechanism to communicate with HX6802, encrypting all commands for transmission. The "fixed key + random number" mechanism ensures that the encrypted data transmitted each time is random, and even if the communication data is leaked, it cannot be cracked by brute force. Figure 7 As shown in the figure, first, the PC and HX6802 generate their own random numbers P0 and D0 respectively, and then complete the exchange of random numbers between the two parties. Finally, the communication commands need to add the PC random number and 6802 random number. Among them, LEN is the length of the ciphertext data, and the data after LEN is the ciphertext data encrypted by the fixed key.

[0032] The single-point transmission and master key injection processes in the handwritten signature process must all be encrypted, and the encryption key used each time the user starts the signature process is different to ensure the security of the signature data on the data link. Figure 8 The implementation mechanism of "one-time one-pass" is as follows: S11, PC and encryption / decryption chip generate their own random numbers pr and dr respectively, and then complete the random number exchange between the two parties; S12, PC sends a command to obtain the public key to the encryption and decryption chip. After receiving the command, the encryption and decryption chip reads the public key in the NORFLASH on the chip and returns it to the PC; S13, the PC generates a 16-byte random seed, encrypts the random seed using the public key, and sends the encryption result to the encryption and decryption chip. The encryption and decryption chip uses the internal private key to decrypt the encryption result to obtain the random seed; S14, PC and encryption / decryption chip use the seed key to XOR the random numbers dr and pr bit by bit to obtain the session key.

[0033] In this method, the interfaces involved include starting signature, clearing signature, ending signature, obtaining electronic signature, etc. The definitions are shown in the following table.

[0034] Table 1 Function interface design Example 3 The embodiment of the present disclosure provides an electronic signature encryption device, including a processor and a memory. Optionally, the device may also include a communication interface and a bus. The processor, the communication interface, and the memory may communicate with each other through the bus. The communication interface may be used for information transmission. The processor may call the logic instructions in the memory to execute the electronic signature encryption method of the above embodiment.

[0035] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.

[0036] The memory, as a computer-readable storage medium, can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor executes the function application and data processing by running the program instructions / modules stored in the memory, that is, implementing the electronic signature encryption method in the above embodiment.

[0037] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory may include a high-speed random access memory and may also include a non-volatile memory.

[0038] Example 4 An embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute the above-mentioned electronic signature encryption method.

[0039] The computer-readable storage medium mentioned above may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.

[0040] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, and other media that can store program codes, or a transient storage medium.

[0041] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the scope of protection. As used in the description in the text, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of one or more associated listings. In addition, when used in this application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the presence of other identical elements in the process, method or device including the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.

[0042] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. The technicians may clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

Claims

1. An electronic signature encryption method, characterized in that: The following steps are involved: S01. Inject the master key. The master key is generated by the server. The PC encrypts the master key sent by the server with the session key to obtain the ciphertext PriKey', and then sends the ciphertext PriKey' and the number of master keys to the encryption and decryption chip. The encryption and decryption chip decrypts the ciphertext PriKey' with the session key to obtain the master key plaintext, and stores the master key plaintext in the chip NORFLASH; the master key is used to decrypt the working key, and the working key is used to encrypt the trajectory data when obtaining the electronic signature; S02, signature is turned on, the interface library of the PC generates a signature area according to the window size passed in by the APP, and transmits the starting point coordinates, width and height of the signature area to the encryption and decryption chip, and the encryption and decryption chip generates a handwriting valid area according to the input signature area starting point coordinates, width and height; at the same time, the interface library of the PC also negotiates with the encryption and decryption chip to obtain the session key required for a single coordinate transmission, and after the signature is turned on, the encryption and decryption chip receives the data sent by the handwriting device; S03, real-time signature drawing. After the signature is turned on, the encryption and decryption chip receives the plaintext coordinates sent by the handwriting device, calculates the horizontal coordinate, vertical coordinate and pressure of the original coordinate point, first filters the original coordinate points, filters out the original coordinate points outside the handwriting effective area, and the remaining are valid coordinate points. The valid coordinate points are integrated into the HID format, encrypted into ciphertext coordinates with the session key and sent to the PC. After the interface library of the PC receives the ciphertext coordinates, it uses the session key to decrypt the ciphertext coordinates to obtain the original coordinate value, and then converts the original coordinate value into the current window coordinate, draws the handwriting, and saves the original coordinate value; S04, obtaining the electronic signature. After the user signs, the electronic signature is obtained. The interface library on the PC sends all the stored original coordinate values ​​in segments to the encryption and decryption chip. The encryption and decryption chip encrypts the data using the working key to obtain the encrypted trajectory data and returns it to the PC. Step S04 is specifically as follows: S41, after receiving the command to obtain the electronic signature, the interface library of the PC uses the session key to encrypt the signature trajectory data, and imports the encryption working key and master key number transmitted by the server, and the interface library generates a trajectory image for the original coordinate value and saves it to the specified location of the PC; S42, the encrypted ciphertext of the signature trajectory data, the encrypted working key and the master key number are sent to the encryption and decryption chip. After receiving the data, the encryption and decryption chip first uses the session key to decrypt the plaintext data of the signature trajectory data, and then obtains the corresponding master key PriKey according to the master key number, and uses the master key PriKey to decrypt the encrypted working key WorkKey' to obtain the plaintext working key WorkKey; S43. The plaintext work key WorkKey is used as an encryption key to encrypt the plaintext data of this segment of the signed trajectory data, obtain the encrypted trajectory data, and return it to the PC.

2. The electronic signature encryption method according to claim 1, characterized in that: The process of generating a session key is: S11, PC and encryption / decryption chip generate their own random numbers pr and dr respectively, and then complete the random number exchange between the two parties; S12, PC sends a command to obtain the public key to the encryption and decryption chip. After receiving the command, the encryption and decryption chip reads the public key in the NORFLASH on the chip and returns it to the PC; S13, the PC generates a random seed, encrypts the random seed using a public key, and sends the encryption result to the encryption and decryption chip, which decrypts the encryption result using an internal private key to obtain the random seed; S14, PC and encryption / decryption chip use the seed key to XOR the random numbers dr and pr bit by bit to obtain the session key.

3. The electronic signature encryption method according to claim 2, characterized in that: The session key uses a one-time pad mechanism.

4. The electronic signature encryption method according to claim 1, characterized in that: In step S03, the signature handwriting drawing on the PC side is completed in the interface library. A hook is installed in the interface library using the SetWindowsHookEx function to monitor and intercept the message queue sent to the APP window program. The drawing of the APP window area is achieved by intercepting the WM_PAIT message. The interface library first records the first point collected, and after collecting the second point, GDI plus the graphics device interface is used to complete the straight line drawing. After collecting the third point, a straight line is drawn between the third point and the second point. The same operation is performed on the last point collected until the entire signature process is completed.

5. The electronic signature encryption method according to claim 4, characterized in that: During the drawing process, a buffer is set up, drawing is first done in the buffer, and then the bitmap in the buffer is copied to the canvas at once.

6. The electronic signature encryption method according to claim 1, characterized in that: When the encryption and decryption chip is used for the first time or the firmware needs to be updated after being locked, the encryption and decryption chip must be unlocked first. When unlocking the encryption and decryption chip, not only the locked state of the encryption and decryption chip must be released, but also a session key for collecting coordinate communications must be generated; at the same time, the encryption and decryption chip detects in real time whether it has been violently disassembled. When the detection point inputs a high level, it is determined that the encryption and decryption chip has been violently disassembled. At this time, the encryption and decryption chip erases the master key and sets the encryption and decryption chip to a locked state.

7. The electronic signature encryption method according to claim 6, characterized in that: When the encryption and decryption chip is unlocked, the interface library of the PC uses a fixed key plus random number mechanism to communicate with the encryption and decryption chip, and all commands are encrypted and transmitted. First, the PC and the encryption and decryption chip generate their own random numbers respectively. After the random numbers are exchanged between the two parties, the final communication commands need to add the PC random number and the encryption and decryption chip random number.

8. An electronic signature encryption system, characterized in that: It includes a signature handwriting device, an encryption and decryption chip and a PC. The PC is provided with an interface library. The user draws a signature on the signature handwriting device. The encryption and decryption chip is connected to the signature handwriting device to collect coordinate points on the signature handwriting device. The collected coordinate points are first filtered in an effective area to obtain valid point coordinates. The valid point coordinates are encrypted by the encryption and decryption chip and then uploaded to the PC. The PC decrypts the received encrypted data to obtain the original coordinate points, and then converts the original coordinate points into the current window coordinates. The writing handwriting is drawn in the current window, and finally the original coordinate points are saved. After the user completes the signature, a vector image is generated and the signature handwriting data is encrypted for the user to obtain an electronic signature.

9. An electronic signature encryption device, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to execute the electronic signature encryption method according to any one of claims 1 to 7 when running the program instructions.

10. A storage medium storing program instructions, characterized in that: When the program instructions are executed, the electronic signature encryption method according to any one of claims 1 to 7 is executed.

Citation Information

Patent Citations

  • Method, device and system for safely transferring data between electronic signature tools

    CN101883096A

  • Method for importing secret keys safely, electronic signature tool, authentication device and system

    CN101989991A

  • Encrypted signature handwriting device and method

    CN103294943A

  • Credible electronic handwriting generation method and device and storage medium

    CN116881940A

  • Electromagnetic signature method capable of protecting handwriting characteristics of user

    CN118965380A

Cited By

  • Digital signature generation and authentication system and method

    CN121530596A