Special compression system based on PUF secret key
Technical Field
The invention relates to the technical field of lossless compression security, in particular to a special compression system based on a PUF (physical unclonable function) key.
Background
Compression and decompression are a pair of operations which are often used in data transmission and storage, and encryption compression and encryption decompression are required in some application scenarios with higher requirements on security. Up to now, most of keys used for encryption compression and encryption decompression are stored in a Non-volatile Memory (NVM), and data information stored in the NVM is easily stolen, thereby causing leakage of protected data.
A Physical Unclonable Function (PUF) is a Physical Function that can be essentially regarded as a fingerprint of hardware, and is a characteristic of a hardware circuit itself, and does not need to be stored in the NVM. The characteristics of the PUF enable the PUF to be very suitable for being used in a safe encryption compression and encryption decompression scene, and not only can the secrecy of a PUF secret key be guaranteed, but also the safety of compressed data can be protected.
In recent years, with the extensive research on PUFs, there have been an increasing variety of PUFs and methods of extracting PUFs. At present, many scholars generate PUFs and produce keys by using an FPGA (Field-Programmable Gate Array) or an embedded circuit, and mostly extract data through PCIE or UART serial ports. However, at present, many methods do not achieve sufficient automation and visualization, do not consider actual production requirements, and are not very friendly to users; and the extraction methods for PUF keys are different, and various adaptations are needed in the application process, so that the process is very complicated.
Disclosure of Invention
In order to solve the problems in the prior art, the invention provides a special compression system based on a PUF (physical unclonable function) key, the system can run efficiently on each major stream of operating systems by using a visual user operating interface compiled by a Python language, the system adopts a PUF key reading module to read a PUF key from a PUF key generating circuit, the compressed file obtained by adopting the system for encryption and compression can only be decrypted and compressed by the system to obtain an original file, and in addition, the system also realizes the decoupling of a PUF key obtaining module and the PUF key generating circuit, so that the complicated adaptive operation is not needed when the PUF key is extracted.
The invention adopts the following technical scheme for solving the technical problems:
the invention provides a special compression system based on a PUF secret key, which comprises: the device comprises a core function unit, a user operation unit and an auxiliary function unit. The core function unit includes: PUF key reading module, compression module and decompression module, the user operation unit includes: user authentication module, GUI operation module and function show module, supplementary functional unit includes: a Worker module and a log module.
And a PUF key reading module which reads the PUF key from the PUF key generation circuit.
The compression module includes: a general compression unit and a special compression unit; the common compression unit performs common compression without encryption on the file to obtain a common compressed file, and the special compression unit performs special encryption compression based on the PUF key on the file to obtain a special compressed file.
The decompression module includes: a common decompression unit and a special decompression unit; wherein, the ordinary decompressing unit performs ordinary decompression without encryption on the file to obtain an original file; and the special decompressing unit performs special encryption and decompression on the file based on the PUF key to obtain an original file.
The dedicated compression unit executes a dedicated compression algorithm and the dedicated decompression unit executes a dedicated decompression algorithm. And the special compression algorithm calls the PUF key reading module to obtain the PUF key, and then adds the PUF key into the compression algorithm and performs compression. And the special decompression algorithm calls the PUF key reading module to obtain the PUF key, adds the PUF key into the decompression algorithm and performs decompression.
The special compression system based on the PUF key further comprises a GUI operation module which provides a visual operation interface main window for a user, and the main window is convenient for the user to operate all compression and decompression functions of the system. The visual user operation interface can run on each large mainstream operation system efficiently.
The special compression system based on the PUF key further comprises a function display module for providing a visual operation interface display board window for a user. And displaying the execution states of the special compression operation and the special decompression operation to a user through a picture display area, a character display area and an audio display area in a display board window.
The special compression system based on the PUF key further comprises a Worker module based on an asynchronous and multi-process technology scheduling compression module and a decompression module, so that the response speed of a GUI operation module, the execution speed of the compression algorithm module and the decompression algorithm module are improved, and the parallel execution of the GUI operation module and the function display module is realized.
The special compression system based on the PUF key further comprises a log module which outputs the log of the system in operation and the user operation record on a main window of a visual operation interface, and the log of the system in operation and the user operation record are stored in a local disk in a file form.
The special compression system based on the PUF secret key also comprises a user authentication module used for authenticating the user identity of the system so as to protect the system from being used by illegal users and further ensure the data security of legal users.
In the special compression system based on the PUF key, the PUF key reading module reads the PUF key by adopting the following method, and the specific steps are as follows:
step A1: the PUF secret key generating circuit is connected with the host through a UART serial port, and the special compression system automatically searches and identifies the UART serial port number of the PUF secret key generating circuit after being started.
Step A2: the host computer sets the baud rate, the read delay, the character format and the parity check bit of the UART serial port, and closes the software flow control and the hardware flow control. Wherein, the character format includes: start bit, stop bit and valid data bit.
Step A3: the PUF key generation circuit is enabled.
Step A4: the PUF key acquisition module detects through a UART serial port, whether a Ready mark transmitted by the PUF key generation circuit is received within a specified time or not is judged, and if the Ready mark is received, the step A5 is carried out; if not, step A3 is repeated, i.e. the PUF key generation circuit is restarted.
Step A5: and setting a key generation mode and a generation delay of the PUF key generation circuit, and starting a PUF key generation process once.
Step A6: the host continuously detects an output stream generated by the PUF key generation circuit, and if a bfp value and a key value are detected within 90 seconds of timeout time, the currently detected bfp value and key value are cached, the PUF key generation process is ended, and the step A7 is entered; if the bfp value or the key value or both are not detected, step A5 is repeated.
Step A7: it is checked whether the bfp value cached in step a6 is less than 150. If the bfp value is less than 150, the key generation mode and the generation delay of the PUF key generation circuit are reset, and step a6 is repeated until the bfp value is not less than 150, and the process proceeds to step A8.
Step A8: it is checked whether the bfp value cached in step A7 is less than or equal to 300. If the bfp value is greater than 300, the key generation mode and the generation delay of the PUF key generation circuit are reset, and step a6 is repeated until the bfp value is equal to or less than 300, and the routine proceeds to step a 9.
Step A9: if the bfp value is not greater than 300 and not less than 150, the key value of the PUF key generated this time is considered to be a correct value, and the current key value is recorded as the PUF key of the dedicated compression unit and the dedicated decompression unit. The PUF key generation circuit is turned off.
The special compression system based on the PUF key provides a visual operation interface for a user, five functional buttons are arranged in a main window of the visual operation interface, namely a display board button, a common compression button, a common decompression button, a special compression button and a special decompression button, and an operation log display area is also arranged in the main window of the visual operation interface.
The specific functions of each function button and the operation log display area are as follows:
and popping up a file selection dialog box after clicking a common compression button, after selecting any type of original file to be subjected to common compression according to the prompt of the dialog box, executing common compression by the system at the background, and outputting the current execution progress in the running log display area.
And popping up a file selection dialog box after clicking a common decompression button, performing common decompression by the system in the background after selecting a common compressed file according to the prompt of the dialog box, and outputting a current execution log in the running log display area.
And after clicking a special compression button, popping up a file selection dialog box, selecting any type of original file to be specially compressed according to the prompt of the dialog box, calling a PUF (physical unclonable function) key acquisition module by a special compression unit to acquire a PUF key, adding the PUF key into a compression algorithm and executing, and outputting a PUF key value used in the operation and a current execution log in an operation log display area.
Clicking the special decompression button pops up a file selection dialog box, and at the moment, the file subjected to special compression is selected, because only special decompression can decompress the file subjected to special compression. After a file is selected, the system firstly calls a PUF key acquisition module to acquire a PUF key, and then the PUF key is added into a decompression algorithm and executed. The running log display area displays the PUF key and the system running log used in the decompression process.
And clicking a display board button to call out a display board window of the visual operation interface. The show board window of visual operation interface includes: the display device comprises a picture display area, a character display area and an audio display area. The main window and the display board window can coexist at the same time without mutual interference, and the display operation performed by the main window can be immediately reflected to the display board window.
After selecting an original file or a special compressed file in the main window and executing a special compression or special decompression operation, displaying the execution state of the special compression operation or the special decompression operation to a user through a picture display area, a character display area and an audio display area in the display window, which is specifically as follows:
if the original file selected in the main window is in a picture format, when the display board window is called out for the first time, the picture content is displayed in the picture display area in a complete and lossless mode; after the special compression operation is carried out on the picture format file in the main window, no display content exists in the picture display area; and after the special compressed picture format file is subjected to special decompression operation in the main window, the picture display area displays the picture content completely and losslessly again. Therefore, the picture display area verifies the functional correctness of the special compression and special decompression based on the PUF key, which is proposed by the invention.
If the original file selected by the main window is in a character format, when the display board window is called for the first time, a segment of character content in the file is displayed in the character display area in a complete and lossless manner; after the special compression operation is carried out on the text format file in the main window, no display content exists in the text display area; after the special decompression operation is carried out on the special compressed character format file in the main window, the character display area displays a segment of character content in the file completely and losslessly again. Therefore, the text display area verifies the functional integrity of the special compression and special decompression based on the PUF key.
If the original file selected by the main window is in an audio format, when the display board window is called for the first time, the music name and the music duration of the music being played are displayed in the audio display area, and the music file can be played circularly by clicking a play button; stopping playing the music file, and after the audio format file is subjected to special compression operation in the main window, clicking a playing button in the audio display area can not normally play the audio file; after the special decompression operation is carried out on the special compressed audio format file in the main window, the audio display area displays the music name and the music duration of the 'music being played' again, and the music file can be played circularly by clicking the play button. Therefore, the audio exhibition area verifies the functional security of a PUF key-based dedicated compression and dedicated decompression proposed by the present invention.
Further, the window of the display board only shows the influence effect of the special compression and special decompression on the picture format file, the text format file and the audio format file, but the special compression and special decompression based on the PUF key provided by the invention can be applied to various types of files and is not limited to the three types of files displayed by the display board. The functional completeness and the safety of the special compression system based on the PUF secret key can be verified through the real-time demonstration of the display board.
Due to the fact that the Worker module is used, various operations triggered by the function buttons can be executed in parallel without mutual interference, and key operations executed by a user and a system are displayed in the running log display area and stored in the log file, and therefore high efficiency of compression operation is achieved. Because the PUF key generation circuit is closely connected with the PUF key used by special compression and special decompression, the file after special compression can only be restored by adopting special decompression on a system provided with the PUF key generation circuit, so that even if the special compressed file is stolen, an illegal user cannot obtain a correct PUF key for decompression to obtain an original file, and the safety of compression operation is improved.
The specific steps of the special compression system based on the PUF secret key provided by the invention are as follows:
step S1: before the system is used, a legal user name and a password are input into an identity authentication dialog box, and then subsequent operation can be carried out; for a legal user who passes the authentication, the system can be selected not to perform the user authentication for a period of time to save the operation time.
Step S2: and selecting the operation to be performed by clicking a common compression button, a common decompression button, a special compression button and a special decompression button in the main window of the user operation interface.
Step S3: the display board window is called by clicking a display board button in a main window of the user operation interface, and the execution states of the special compression operation and the special decompression operation are displayed for the user through a picture display area, a character display area and an audio display area in the display window.
Step S4: every operation executed by the system is output to the running log display area of the main window in a log information with date and time format and is saved in a log file.
Compared with the prior art, the invention adopting the technical scheme has the following technical effects:
(1) the system is developed based on Python language, has good cross-platform characteristics, and can normally and efficiently run on mainstream operating systems such as Windows, Linux and Mac OS;
(2) the main window and the display board window of the visual user operation interface both adopt a Worker module, so that a user can simultaneously perform a plurality of compression and decompression operations without causing the operation interface to be stuck, and the system can synchronously display operation effects on the display panel when performing compression or decompression;
(3) in the proposed PUF key reading method, the PUF key reading module can initiate a plurality of times of PUF key generation requests to the PUF key generation circuit after capturing Ready signals sent by the PUF key generation circuit, and the PUF key generation circuit is not required to be powered on and powered off every time the PUF key generation is requested, so that the PUF key generation efficiency can be improved; in the PUF secret key generation process, as the default PUF secret key generation request input parameters are adopted in the initial setting, the PUF secret key acquired for the first time can meet most of use scenes, and the execution speed of special compression is improved; and in the PUF key generation process, an automatic error correction program is set, so that the key acquisition module can automatically adjust PUF key generation request input parameters according to the bfp value and perform a new key generation process until a correct PUF key value is acquired.
Drawings
Fig. 1 is a diagram showing the specific steps of a PUF key reading method for a PUF-key-based special compression system according to the present invention.
Fig. 2 is a schematic layout diagram of a main window of a visual user operation interface of a private compression system based on a PUF key according to the present invention.
Fig. 3 is a schematic diagram of a layout of a display board window of a visual user operation interface of a PUF key-based special compression system according to the present invention.
Detailed Description
The technical scheme of the invention is explained in detail in the following with the accompanying drawings.
The invention provides a special compression system based on a PUF secret key, which comprises: the device comprises a core function unit, a user operation unit and an auxiliary function unit. The core function unit includes: PUF key reading module, compression module and decompression module, the user operation unit includes: user authentication module, GUI operation module and function show module, supplementary functional unit includes: a Worker module and a log module.
And a PUF key reading module which reads the PUF key from the PUF key generation circuit.
The compression module includes: a general compression unit and a special compression unit; the common compression unit performs common compression without encryption on the file to obtain a common compressed file, and the special compression unit performs special encryption compression based on the PUF key on the file to obtain a special compressed file.
The decompression module includes: a common decompression unit and a special decompression unit; wherein, the ordinary decompressing unit performs ordinary decompression without encryption on the file to obtain an original file; and the special decompressing unit performs special encryption and decompression on the file based on the PUF key to obtain an original file.
The dedicated compression unit executes a dedicated compression algorithm and the dedicated decompression unit executes a dedicated decompression algorithm. And the special compression algorithm calls the PUF key reading module to obtain the PUF key, and then adds the PUF key into the compression algorithm and performs compression. And the special decompression algorithm calls the PUF key reading module to obtain the PUF key, adds the PUF key into the decompression algorithm and performs decompression.
The special compression system based on the PUF key further comprises a GUI operation module which provides a visual operation interface main window for a user, and the main window is convenient for the user to operate all compression and decompression functions of the system. The visual user operation interface can run on each large mainstream operation system efficiently.
The special compression system based on the PUF key further comprises a function display module for providing a visual operation interface display board window for a user. And displaying the execution states of the special compression operation and the special decompression operation to a user through a picture display area, a character display area and an audio display area in a display board window.
The special compression system based on the PUF key further comprises a Worker module based on an asynchronous and multi-process technology scheduling compression module and a decompression module, so that the response speed of a GUI operation module, the execution speed of the compression algorithm module and the decompression algorithm module are improved, and the parallel execution of the GUI operation module and the function display module is realized.
The special compression system based on the PUF key further comprises a log module which outputs the log of the system in operation and the user operation record on a main window of a visual operation interface, and the log of the system in operation and the user operation record are stored in a local disk in a file form.
The special compression system based on the PUF secret key also comprises a user authentication module used for authenticating the user identity of the system so as to protect the system from being used by illegal users and further ensure the data security of legal users.
Specific example 1:
in a special compression system based on a PUF key, a PUF key reading module reads the PUF key by the following method, which is explained in detail with reference to fig. 1, and the specific steps are as follows:
step A1: the PUF secret key generating circuit is connected with the host through a UART serial port, and the special compression system automatically searches and identifies the UART serial port number of the PUF secret key generating circuit after being started.
Step A2: the host computer sets the baud rate of the UART serial port to be 115200 baud, the read delay is 2 seconds, the character format is 10 bits in total, wherein 1 start bit, 1 stop bit and 8 effective data bits, the parity bit is null, and the software flow control and the hardware flow control are closed.
Step A3: the PUF key generation circuit is enabled.
Step A4: the PUF key acquisition module detects through a UART serial port, whether a Ready mark '0 x 16' transmitted by the PUF key generation circuit is received within 10 seconds or not is judged, and if the Ready mark is received, the step A5 is carried out; if not, step A3 is repeated, i.e. the PUF key generation circuit is restarted.
Step A5: and setting a key generation mode and a generation delay of the PUF key generation circuit, setting the key generation mode as a default key generation mode 4, setting the generation delay as 50 seconds, and starting the PUF key generation process once.
Step A6: the host continuously detects an output stream generated by the PUF key generation circuit, and if a bfp value and a key value are detected within 90 seconds after the timeout time is set, the currently detected bfp value and the key value are cached, the PUF key generation process is ended, and the step A7 is entered; if neither the bfp value nor the key value is detected, step A5 is repeated.
Step A7: it is checked whether the bfp value cached in step a6 is less than 150. And if the bfp value is less than 150, resetting the key generation mode and the generation delay of the PUF key generation circuit, setting the key generation mode as a default key generation mode 4, setting the generation delay as 60 seconds, repeating the step A6, and entering the step A8 when the bfp value is not less than 150.
Step A8: it is checked whether the bfp value cached in step A7 is less than or equal to 300. And if the bfp value is larger than 300, resetting the key generation mode and the generation delay of the PUF key generation circuit, setting the key generation mode as a default key generation mode 4, setting the generation delay as 40 seconds, repeating the step A6, and entering the step A9 when the bfp value is smaller than or equal to 300.
Step A9: if the bfp value is not greater than 300 and not less than 150, the key value of the PUF key generated this time is considered to be a correct value, and the current key value is recorded as the PUF key of the dedicated compression unit and the dedicated decompression unit. The PUF key generation circuit is turned off.
Specific example 2:
as shown in FIG. 2, five function buttons are arranged in a main window of the user operation interface, namely a display board button, a common compression button, a common decompression button, a special compression button and a special decompression button, and an operation log display area is further arranged in the main window of the user operation interface.
The specific functions of each function button and the operation log display area are as follows:
and popping up a file selection dialog box after clicking a common compression button, after selecting any type of original file to be subjected to common compression according to the prompt of the dialog box, executing common compression by the system at the background, and outputting the current execution progress in the running log display area.
And popping up a file selection dialog box after clicking a common decompression button, performing common decompression by the system in the background after selecting a common compressed file according to the prompt of the dialog box, and outputting a current execution log in the running log display area.
And after clicking a special compression button, popping up a file selection dialog box, selecting any type of original file to be specially compressed according to the prompt of the dialog box, calling a PUF (physical unclonable function) key acquisition module by a special compression unit to acquire a PUF key, adding the PUF key into a compression algorithm and executing, and outputting a PUF key value used in the operation and a current execution log in an operation log display area.
Clicking the special decompression button pops up a file selection dialog box, and at the moment, the file subjected to special compression is selected, because only special decompression can decompress the file subjected to special compression. After a file is selected, the system firstly calls a PUF key acquisition module to acquire a PUF key, and then the PUF key is added into a decompression algorithm and executed. The running log display area displays the PUF key and the system running log used in the decompression process.
Click the show board button to bring up the show board window. As shown in fig. 3, the display board window includes: the display device comprises a picture display area, a character display area and an audio display area.
And clicking a display board button to call out a display board window of the visual operation interface. The show board window of visual operation interface includes: the display device comprises a picture display area, a character display area and an audio display area. The main window and the display board window can coexist at the same time without mutual interference, and the display operation performed by the main window can be immediately reflected to the display board window.
After selecting an original file or a special compressed file in the main window and executing a special compression or special decompression operation, displaying the execution state of the special compression operation or the special decompression operation to a user through a picture display area, a character display area and an audio display area in the display window, which is specifically as follows:
if the original file selected in the main window is in a picture format, when the display board window is called out for the first time, the picture content is displayed in the picture display area in a complete and lossless mode; after the special compression operation is carried out on the picture format file in the main window, no display content exists in the picture display area; and after the special compressed picture format file is subjected to special decompression operation in the main window, the picture display area displays the picture content completely and losslessly again.
If the original file selected by the main window is in a character format, when the display board window is called for the first time, a segment of character content in the file is displayed in the character display area in a complete and lossless manner; after the special compression operation is carried out on the text format file in the main window, no display content exists in the text display area; after the special decompression operation is carried out on the special compressed character format file in the main window, the character display area displays a segment of character content in the file completely and losslessly again.
If the original file selected by the main window is in an audio format, when the display board window is called for the first time, the music name and the music duration of the music being played are displayed in the audio display area, and the music file can be played circularly by clicking a play button; stopping playing the music file, and after the audio format file is subjected to special compression operation in the main window, clicking a playing button in the audio display area can not normally play the audio file; after the special decompression operation is carried out on the special compressed audio format file in the main window, the audio display area displays the music name and the music duration of the 'music being played' again, and the music file can be played circularly by clicking the play button.
Further, the window of the display board only shows the influence effect of the special compression and special decompression on the picture format file, the text format file and the audio format file, but the special compression and special decompression based on the PUF key provided by the invention can be applied to various types of files and is not limited to the three types of files displayed by the display board. The functional completeness and the safety of the special compression system based on the PUF secret key can be verified through the real-time demonstration of the display board.
Due to the fact that the Worker module is used, various operations triggered by the function buttons can be executed in parallel without mutual interference, and key operations executed by a user and a system are displayed in the running log display area and stored in the log file, and therefore high efficiency of compression operation is achieved. Because the PUF key generation circuit is closely connected with the PUF key used by special compression and special decompression, the file after special compression can only be restored by adopting special decompression on a system provided with the PUF key generation circuit, so that even if the special compressed file is stolen, an illegal user cannot obtain a correct PUF key for decompression to obtain an original file, and the safety of compression operation is improved.
Specific example 3:
the specific steps of the special compression system based on the PUF secret key provided by the invention are as follows:
step S1: before the system is used, a legal user name and a password are input into an identity authentication dialog box, and then subsequent operation can be carried out; for a legal user who passes the authentication, the system can be selected not to perform the user authentication for a period of time to save the operation time.
Step S2: and selecting the operation to be performed by clicking a common compression button, a common decompression button, a special compression button and a special decompression button in the main window of the user operation interface.
Step S3: the display board window is called by clicking a display board button in a main window of the user operation interface, and the execution states of the special compression operation and the special decompression operation are displayed for the user through a picture display area, a character display area and an audio display area in the display window.
Step S4: every operation executed by the system is output to the running log display area of the main window in a log information with date and time format and is saved in a log file.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention.