External storage device encryption and decryption system and method based on Kylin mobile operating system
By designing an encryption and decryption system for external storage devices within the Kylin mobile operating system, the lack of encryption and decryption functionality in the Kylin mobile operating system was resolved. This enabled data encryption, decryption, and management of external storage devices, thereby improving data security.
Patent Information
- Application Number
- CN202111340155.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-12
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2041-11-12
AI Technical Summary
The Kylin mobile operating system lacks encryption and decryption functions for external storage devices, resulting in insufficient data security.
An external storage device encryption and decryption system based on the Kylin mobile operating system was designed, including a web interaction module, a web rendering engine module, and an external storage device management module. The system identifies, mounts, encrypts, and decrypts external storage devices and manages them using keys.
It implements encryption and decryption functions for external storage devices, improving the security of data access and ensuring that encrypted content cannot be read, written, or accessed by other devices.
Smart Images

Figure CN114117476B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of mobile terminal security technology, and in particular to an external storage device encryption and decryption system and method based on a Kylin mobile operating system. Background Art
[0002] Kylin Mobile Operating System is a mobile terminal operating system developed by the National University of Defense Technology. It uses the Linux kernel and a browser engine-based operating environment to provide developers with an interface for direct access to hardware devices and services based on HTML / JavaScript technology, providing users with a convenient and smooth Web application experience.
[0003] External storage devices generally refer to storage devices such as external storage cards (SDCARD) or USB OTG in mobile terminals. Memory cards are mainly used to expand the storage space of terminals, which will store a large amount of important user information. There is currently no complete data protection measure for the information in the memory card, and users can access the information in the memory card at will, which poses a great security risk. Therefore, a complete set of methods that can encrypt and decrypt external storage devices such as memory cards is needed to protect the data security of Kylin mobile operating system terminals.
[0004] Currently, most mobile terminals in the market use the Android system framework, namely, the Linux kernel + HAL + Java API framework. Such mobile terminals do not have the function of encrypting and decrypting external storage cards or USB OTG devices.
[0005] Chinese patent number CN105549914A, entitled "A method and system for mounting an external storage device", discloses encrypting and decrypting an external storage device when mounting it on an Android terminal, but it mainly inputs passwords through the Java API, while the Kirin mobile operating system is based on the Linux kernel + HTML and JavaScript framework. The application layer (HTML + JavaScript) uses an interface implemented in JavaScript to pass data to the bottom layer (C++ layer), and the password in the patent is used to control whether the external storage device is mounted or not. Its encryption module is used to manage devices and corresponding passwords of devices, and does not encrypt the data of external storage devices. Summary of the invention
[0006] The technical problem to be solved by the present invention is: in view of the technical problems existing in the prior art, the present invention provides an external storage device encryption and decryption system and method based on the Kylin mobile operating system, which realizes the Kylin mobile operating system's function of encrypting and decrypting external storage devices.
[0007] In order to solve the above technical problems, the technical solution proposed by the present invention is:
[0008] An external storage device encryption and decryption system based on the Kylin mobile operating system, comprising:
[0009] A Web interaction module, used to obtain operation instructions, call the encryption and decryption interface and input the operation instructions to the encryption and decryption interface, and wait for feedback data from the encryption and decryption interface;
[0010] The Web rendering engine module is used to provide an encryption and decryption interface, obtain operation instructions from the encryption and decryption interface and forward them to the external storage device management module, wait for feedback data from the external storage device management module, and then send the feedback data to the Web interaction module through the encryption and decryption interface;
[0011] The external storage device management module is used to identify the external storage device and feed back the device data to the Web rendering engine module. It is also used to obtain operation instructions from the Web rendering engine module, determine the target external storage device according to the operation instructions, mount the corresponding virtual device, and generate an encryption key or a decryption key. Then, the data in the target external storage device is encrypt or decrypted through the virtual device, and the corresponding feedback information is generated and sent to the Web rendering engine module.
[0012] Furthermore, the external storage device management module includes:
[0013] The device node identification module is used to detect external storage devices by monitoring changes in device nodes, and detect plug-in and pull-out events of external storage devices to form an external storage device information list;
[0014] A device status analysis module, used to obtain the mounting status and encryption status of all detected external storage devices in the external storage device information list;
[0015] A device data analysis module, used to obtain device information of all detected external storage devices in the external storage device information list;
[0016] The data communication module is used to interact with the Web rendering engine module.
[0017] Furthermore, the external storage device management module also includes:
[0018] A virtual conversion module, used to create a virtual device corresponding to the external storage device according to the device information in the external storage device information list;
[0019] The mounting module is used to determine the target external storage device according to the mounting instruction, and mount the virtual device corresponding to the target external storage device to the file system of the Kylin mobile operating system through a preset mounting function.
[0020] Furthermore, the external storage device management module also includes:
[0021] A key information management module, used to generate an encryption key and call a device encryption module according to a password in an operation instruction, or to generate a decryption key and call a device decryption module;
[0022] The device encryption module is used to encrypt the unencrypted data of the external storage device by using the encryption key and the preset encryption algorithm, and is also used to encrypt the data to be written by using the encryption key and the preset encryption algorithm, and then write the encrypted data to be written to the external storage device by using the virtual device;
[0023] The device decryption module is used to read the data to be decrypted from the external storage device through the virtual device, and then decrypt the data to be decrypted through the decryption key and the preset decryption algorithm.
[0024] The present invention also proposes an external storage device encryption and decryption method based on the Kylin mobile operating system, comprising the following steps:
[0025] S1) The Web interaction module obtains an operation instruction, calls an encryption and decryption interface, and inputs the operation instruction to the encryption and decryption interface;
[0026] S2) the Web rendering engine module obtains the operation instruction from the encryption and decryption interface and forwards it to the external storage device management module;
[0027] S3) The external storage device management module obtains an operation instruction from the Web rendering engine module, determines the target external storage device according to the operation instruction, mounts the corresponding virtual device, generates an encryption key or a decryption key, and then encrypts or decrypts the data in the target external storage device through the virtual device, generates corresponding feedback information and sends it to the Web rendering engine module.
[0028] S4) the Web rendering engine module waits for and receives feedback information from the external storage device management module, and sends the feedback information to the Web interaction module through the encryption and decryption interface;
[0029] S5) The Web interaction module waits and receives feedback information from the encryption and decryption interface.
[0030] Furthermore, before step S1), the step of the external storage device management module identifying the external storage device is also included, which specifically includes:
[0031] S01) The device node identification module detects the external storage device by monitoring the changes of the device node, and detects the plugging and unplugging events of the external storage device to form an external storage device information list;
[0032] S02) the device status analysis module obtains the mounting status and encryption status of all detected external storage devices in the external storage device information list, and the device data analysis module obtains the device information of all detected external storage devices in the external storage device information list;
[0033] S03) The data communication module feeds back the mounting status, encryption status and device information of all detected external storage devices to the Web rendering engine module, and the Web rendering engine module feeds back the mounting status, encryption status and device information to the Web interaction module through the encryption and decryption interface.
[0034] Further, step S3) includes the step of encrypting the target external storage device when powered on for the first time, specifically including:
[0035] S311) the key information management module encrypts the default password or the custom password in the password of the operation instruction to obtain an encryption key, and saves the encryption key. If the mode information in the control parameter of the operation instruction is the manual mode, the password verification module saves the password;
[0036] S312) The device encryption module encrypts the unencrypted data of the external storage device using an encryption key and a preset encryption algorithm.
[0037] Further, step S3) includes the step of reading data in the external storage device when the power is not turned on for the first time, specifically including:
[0038] S321) the key information management module generates a decryption key according to a preset decryption algorithm through the encryption key, the encrypted random value and the salt value. If the mode information in the control parameter of the operation instruction is a manual mode, the key information management module generates a decryption key according to the preset decryption algorithm through the random value, the salt value and the custom password in the password;
[0039] S322) The device decryption module reads the data to be decrypted from the target external storage device through the virtual device of the mounted target external storage device, and then decrypts the data to be decrypted through the decryption key and the preset decryption algorithm.
[0040] Furthermore, the operation instruction in step S1) includes control parameters and a Callback function;
[0041] Step S2) specifically includes: the Web rendering engine module obtains the control parameters and the Callback function from the encryption and decryption interface, saves the Callback function in the form of a pointer, parses the control parameters and sends the parsed control parameters to the external storage device management module in an inter-process communication manner;
[0042] Step S4) specifically includes: the external storage device management module sends the feedback information to the Web rendering engine module through inter-process communication, and the Web rendering engine module uses the Callback function pointer to send the feedback information as a Callback function parameter from the encryption and decryption interface to the Web interaction module;
[0043] In step S5), the Web interaction module obtains the returned parameters through the encryption and decryption interface, and obtains the relevant processing information of the external storage device after parsing.
[0044] Further, the operation instruction in step S1) includes control parameters;
[0045] Step S2) specifically includes: the Web rendering engine module defines the parameters of the event attributes and constructs an event processing function, obtains the control parameters from the encryption and decryption interface and then parses the control parameters, and sends the parsed control parameters to the external storage device management module in an inter-process communication manner;
[0046] Step S4) specifically includes: the external storage device management module sends the feedback information to the Web rendering engine module through inter-process communication, and after the Web rendering engine module monitors the feedback information, it uses the feedback information as an event object and dispatches the event to the Web interaction module through the encryption and decryption interface;
[0047] In step S5), the Web interaction module monitors the event object through the encryption and decryption interface of the Web rendering engine module, and obtains the relevant processing information of the external storage device after parsing.
[0048] Compared with the prior art, the advantages of the present invention are:
[0049] The present invention realizes the encryption and decryption functions of the Kylin mobile operating system for external storage devices by configuring an external storage device management module. It can encrypt data in the connected external storage device and decrypt the data when reading the data therein. At the same time, it adopts keys for management, so that the content of the encrypted external storage device cannot be read, written and accessed by other devices, and the Kylin mobile operating system terminal also needs keys when accessing, thereby greatly improving the security of the Kylin mobile operating system terminal's access to the external storage device data. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 This is an overall flow chart of Embodiment 1 of the present invention.
[0051] Figure 2 This is a flow chart of encryption and decryption interface data transmission according to the second embodiment of the present invention.
[0052] Figure 3 This is the first power-on encryption flow chart of the second embodiment of the present invention.
[0053] Figure 4 This is a flowchart of non-first power-on decryption in Embodiment 2 of the present invention.
[0054] Figure 5 This is a flow chart of encryption and decryption interface data transmission according to the third embodiment of the present invention. DETAILED DESCRIPTION
[0055] The present invention is further described below in conjunction with the accompanying drawings and specific preferred embodiments, but the protection scope of the present invention is not limited thereby.
[0056] Embodiment 1
[0057] like Figure 1 As shown, this embodiment proposes an external storage device encryption and decryption system based on the Kylin mobile operating system, including:
[0058] A Web interaction module, used to obtain operation instructions, call the encryption and decryption interface and input the operation instructions to the encryption and decryption interface, and wait for feedback data from the encryption and decryption interface;
[0059] The Web rendering engine module is used to provide an encryption and decryption interface, obtain operation instructions from the encryption and decryption interface and forward them to the external storage device management module, wait for feedback data from the external storage device management module, and then send the feedback data to the Web interaction module through the encryption and decryption interface;
[0060] The external storage device management module is used to identify the external storage device and feed back the device data to the Web rendering engine module. It is also used to obtain operation instructions from the Web rendering engine module, determine the target external storage device according to the operation instructions, mount the corresponding virtual device, and generate an encryption key or a decryption key. Then, the data in the target external storage device is encrypt or decrypted through the virtual device, and the corresponding feedback information is generated and sent to the Web rendering engine module.
[0061] In this embodiment, the Web interaction module is written in HTML5, CSS and Javascript, and is the top layer of the Kylin mobile operating system, providing a user operation interface. Users input operation instructions through the Web interaction module and get feedback results from the user operation interface.
[0062] The Web rendering engine module is a typesetting engine implemented in C++, which is responsible for interpreting the interface content and organizing information. The Web rendering engine module is responsible for implementing the encryption and decryption interface, encapsulating and providing it to the Web interaction module. The Web rendering engine module exchanges data with the external storage device management module through inter-process communication (usually sockets, but can also be pipes, message queues, shared memory, etc.).
[0063] The external storage device management module is responsible for the encryption and decryption of external storage devices, and manages and maintains the status of external storage devices. Figure 1 As shown, in this embodiment, the external storage device management module includes a device node identification module, a device status analysis module, a device data analysis module, a device virtual conversion module, a password verification module, a key information management module, a device encryption module, a device decryption module, an encryption and decryption process status feedback module, a data communication module, and a device mounting module. The functions of each part of the external storage device management module are described below according to the problem to be solved:
[0064] To identify external storage devices, such as Figure 1 As shown, the following parts of the external storage device management module work:
[0065] The device node identification module is used to detect external storage devices by monitoring changes in device nodes, and detect plug-in and unplug events of external storage devices to form an external storage device information list; specifically, the device node identification module monitors changes in underlying device nodes, identifies external storage devices connected to the mobile terminal, detects plug-in and unplug events of external storage devices, records and classifies device node data, and forms an external storage device information list for subsequent operations.
[0066] The device status analysis module is used to obtain the mounting status and encryption status of all detected external storage devices in the external storage device information list; specifically, the device status analysis module checks the status of the external storage devices listed in the external storage device information list to determine whether the external storage device is in a mounted state, whether it has been encrypted, whether the device is damaged, whether the device can be encrypted, etc.
[0067] The device data analysis module is used to obtain the device information of all detected external storage devices in the external storage device information list; specifically, the device data analysis module obtains the file system format, device manufacturer, device storage size and device type of the external storage device in the external storage device information list. Common file system formats include ext2, ext3, ext4, vfat and f2fs, etc., and device types include external storage cards (SDCARD) or USB OTG, etc.
[0068] The data communication module is used to interact with the Web rendering engine module. Figure 1 As shown, in this embodiment, the data communication module sends the password and mounting instructions in the operation instructions, and uploads device information, password verification results, encryption or decryption progress and results, etc.
[0069] When identifying an external storage device, the data communication module sends the mounting status, encryption status and device information of all detected external storage devices in the external storage device information list to the Web rendering engine module, and the Web rendering engine module then sends this information to the Web interaction module through the encryption and decryption interface, so that the mounting status, encryption status and device information of all detected external storage devices in the external storage device information list are displayed on the user operation interface through the Web interaction module for reference when the user issues operation instructions.
[0070] After the user issues an operation instruction, in order to respond to the corresponding operation, such as Figure 1 As shown, the following parts of the external storage device management module work:
[0071] After the user sees the mounting status, encryption status and device information of all detected external storage devices in the external storage device information list, the Kylin mobile operating system needs to make the virtual device the agent of the external storage device, that is, the data of the corresponding external storage device is accessed through the virtual device in the future. Therefore, an operation instruction containing a mounting instruction will be issued to the unmounted external storage device. At this time, the following parts of the external storage device management module work:
[0072] The virtual conversion module is used to create a virtual device corresponding to the external storage device; specifically, the operation instructions issued by the user are generally for the specified external storage device, which contains some information of the target external storage device to be mounted, such as the name, drive letter, etc. The virtual conversion module obtains the external storage device information list from the device data analysis module, and matches the device information of the target external storage device, and creates a virtual device according to the logical starting address, range, address offset, etc., and associates the created virtual device with the target external storage device. The virtual conversion module can also create a corresponding virtual device for the external storage device that does not have a virtual device in the external storage device information list when identifying the external storage device in the previous text, and associate the created virtual device with the corresponding external storage device. This can speed up the mounting process, but may cause data redundancy.
[0073] The mounting module is used to obtain the mounting instruction in the operation instruction through the data communication module, determine the target external storage device according to the mounting instruction, and mount the virtual device corresponding to the target external storage device to the file system of the Kylin mobile operating system through a preset mounting function.
[0074] After the user sees the mount status, encryption status, and device information of all detected external storage devices in the external storage device information list, for unencrypted external storage devices, or when unencrypted data needs to be written to an encrypted external storage device, an operation instruction containing a password will be issued. At this time, the following parts of the external storage device management module work:
[0075] The password verification module is used to obtain the password in the operation instruction through the data communication module, convert the password into data and verify it with the pre-saved password. If the verification is successful, the password is sent to the key information management module. If the verification fails, the verification failure is fed back to the Web rendering engine module through the data communication module. Specifically, the password verification module converts the password input by the user into graphics, numbers, fingerprints, etc., and compares it with the password already existing in the system for verification.
[0076] The key information management module is used to generate an encryption key according to the password in the operation instruction and call the device encryption module; specifically, the key information management module saves the password obtained from the password verification module, the salt required for device encryption, the encryption key and other key information, and provides a read and write interface. When the key is not encrypted, the module will use a random device to generate a random value, combined with the password and the salt required for device encryption (the salt is also randomly generated and unique, which can enhance encryption security.), and then generate an encryption key according to the encryption algorithm.
[0077] The device encryption module is used to encrypt the unencrypted data of the external storage device through the encryption key and the preset encryption algorithm, and is also used to encrypt the data to be written through the encryption key and the preset encryption algorithm, and then write the encrypted data to be written to the external storage device through the virtual device; specifically, the device encryption module is mainly used to encrypt the key and encrypt the data of the external storage device. When the external storage device needs to be encrypted, the module encrypts the data on the device through the encryption algorithm and the encryption key and writes it to the external storage device. When new data needs to be written, the virtual device generated by the device virtual conversion module encrypts the data and writes it to the external storage device.
[0078] The status feedback module is used to calculate the time required for encryption, feed back the progress data to the Web rendering engine module through the data communication module, and when the encryption is completed, feed back the processing result to the Web rendering engine module through the data communication module.
[0079] After the user sees the mount status, encryption status, and device information of all detected external storage devices in the external storage device information list, when the encrypted data needs to be read from the encrypted external storage device, an operation instruction containing the password will be issued. At this time, the following parts of the external storage device management module work:
[0080] The password verification module is used to obtain the password in the operation instruction through the data communication module, convert the password into data and verify it with the pre-saved password. If the verification is successful, the password is sent to the key information management module. If the verification fails, the verification failure is fed back to the Web rendering engine module through the data communication module. Specifically, the password verification module converts the password input by the user into graphics, numbers, fingerprints, etc., and compares it with the password already existing in the system for verification.
[0081] The key information management module is used to generate a decryption key according to the password in the operation instruction and call the device decryption module; specifically, the key information management module stores the password obtained from the password verification module, the salt value (salt) required for device encryption, the encryption key and other key information, and provides a read and write interface. When the key is encrypted, the module will generate a decryption key according to the decryption algorithm through the encryption key, encryption random value and salt value and other information.
[0082] The device decryption module is used to read the data to be decrypted from the external storage device through the virtual device, and then decrypt the data to be decrypted using the decryption key and the preset decryption algorithm. Specifically, when the external storage device needs to be decrypted, that is, when the encrypted external storage device data needs to be read, the decryption key is used to decrypt the device data, and then the decrypted data is obtained through the virtual device generated by the device virtual conversion module.
[0083] The state feedback module is used to calculate the time required for decryption, feed back the progress data to the Web rendering engine module through the data communication module, and when the decryption is completed, feed back the processing result to the Web rendering engine module through the data communication module.
[0084] The encryption and decryption of external storage devices can use symmetric encryption algorithms or asymmetric encryption algorithms, but since asymmetric encryption algorithms take a long time to encrypt and the system boot speed will be slow, symmetric encryption algorithms are generally used. Symmetric encryption algorithms can use DES, 3DES or AES and other algorithms.
[0085] Embodiment 2
[0086] This embodiment proposes an external storage device encryption and decryption method based on the Kylin mobile operating system based on the embodiment 1, including the following steps:
[0087] S1) The Web interaction module obtains an operation instruction, calls an encryption and decryption interface, and inputs the operation instruction to the encryption and decryption interface;
[0088] S2) the Web rendering engine module obtains the operation instruction from the encryption and decryption interface and forwards it to the external storage device management module;
[0089] S3) The external storage device management module obtains an operation instruction from the Web rendering engine module, determines the target external storage device according to the operation instruction, mounts the corresponding virtual device, generates an encryption key or a decryption key, and then encrypts or decrypts the data in the target external storage device through the virtual device, generates corresponding feedback information and sends it to the Web rendering engine module.
[0090] S4) the Web rendering engine module waits for and receives feedback information from the external storage device management module, and sends the feedback information to the Web interaction module through the encryption and decryption interface;
[0091] S5) The Web interaction module waits and receives feedback information from the encryption and decryption interface.
[0092] like Figure 2 As shown, the encryption and decryption interface implementation in this embodiment is as follows:
[0093] Interface input: control instructions, passwords and other data parameters, Callback callback function.
[0094] Interface output: Callback callback function and its parameters.
[0095] The Web interaction module calls the encryption and decryption interface of the Web rendering engine module, and passes in the control parameters and the callback function Callback (which is also used as a parameter). The control parameters can be the mount instructions or passwords issued to the external storage device and other data information. The Callback function is a communication carrier. The Web rendering engine module receives the control parameters and saves the Callback. After processing the business logic, it uses the saved Callback to output the results to the Web interaction module in the form of callback function parameters. Then, the Web interaction module receives the parameters of the Callback callback function in an asynchronous manner, that is, it obtains the feedback results after issuing the operation instructions.
[0096] Therefore, in this embodiment, the operation instruction in step S1) includes control parameters and a Callback function;
[0097] Step S2) specifically includes: the Web rendering engine module obtains the control parameters and the Callback function from the encryption and decryption interface, saves the Callback function in the form of a pointer, parses the control parameters and sends the parsed control parameters to the external storage device management module in an inter-process communication manner;
[0098] Step S4) specifically includes: the external storage device management module sends the feedback information to the Web rendering engine module through inter-process communication, and the Web rendering engine module uses the Callback function pointer to send the feedback information as a Callback function parameter from the encryption and decryption interface to the Web interaction module;
[0099] In step S5), the Web interaction module obtains the returned parameters through the encryption and decryption interface, and obtains the relevant processing information of the external storage device after parsing.
[0100] Before step S1) of this embodiment, the step of the external storage device management module identifying the external storage device is also included, which specifically includes:
[0101] S01) The device node identification module detects the external storage device by monitoring the changes of the device node, and detects the plugging and unplugging events of the external storage device to form an external storage device information list;
[0102] S02) the device status analysis module obtains the mounting status and encryption status of all detected external storage devices in the external storage device information list, and the device data analysis module obtains the device information of all detected external storage devices in the external storage device information list;
[0103] S03) The data communication module feeds back the mounting status, encryption status and device information of all detected external storage devices to the Web rendering engine module, and the Web rendering engine module feeds back the mounting status, encryption status and device information to the Web interaction module through the encryption and decryption interface.
[0104] When the Kylin mobile operating system terminal is powered on for the first time, the user inputs commands through the display interface of the Kylin mobile operating system terminal. The first step is to select the mode, that is, to select the processing mode for encryption and decryption of the external storage device through the Web interaction module. Automatic mode means that the system background automatically processes the external storage device according to the established process. Manual mode means that each time the system is powered on, it needs to use the password user command and other methods to verify successfully before operating the external storage device. Among them, when the user selects the processing mode, the control parameter is the instruction corresponding to the selected mode, which is sent to the Web rendering engine module through the Web interaction module, and at the same time passed to the Callback function to receive the feedback result of the operation. After the interface of the Web rendering engine module receives the data, it saves the Callback function in the form of a pointer. After the control parameter is parsed, the data is transmitted to the external storage device management module through inter-process communication.
[0105] The external storage device management module parses the received parameter data and processes it in different modes:
[0106] If it is in automatic mode, the built-in encryption and decryption method and the default password are used to encrypt and decrypt the external storage device. Figure 3 As shown in , if the system is powered on for the first time and the external storage device is not encrypted, the encryption module is called to encrypt the external storage device and return the result information of whether the encryption of the external storage device is successful or failed. Figure 4 As shown, if the current state is not the first time the system is powered on and the external storage device has been encrypted, the decryption module is called to decrypt the external storage device and return the result information of whether the decryption of the external storage device is successful or failed.
[0107] If it is in manual mode, when the external storage device is not encrypted, it returns information that requires the user to enter a password for the first encryption. The password for the first encryption is a user-defined password. When the external storage device has been encrypted, it returns information that requires the user to enter a decryption password for verification. After the user sees the feedback information, he enters the password, and the control parameter at this time is the password. When receiving the user's password, the external storage device management module will call the encryption module to encrypt the external storage device or call the decryption module to decrypt the external storage device according to the processing logic, and return the result information of the completed processing.
[0108] Therefore, step S3) includes the steps of encrypting the target external storage device when powered on for the first time, reading data in the external storage device when powered on for a non-first time, writing data to the external storage device when powered on for a non-first time, and configuring a virtual device of the target external storage device and mounting it, which are described below respectively:
[0109] In step S1), the control parameters also include mode information, such as Figure 3 As shown, the step of encrypting the target external storage device when powered on for the first time in step S3) specifically includes:
[0110] S311) the data communication module receives and parses the operation instruction. If the mode information in the control parameters of the operation instruction is the automatic mode, the key information management module encrypts the default password with a random value and a salt value according to a preset encryption algorithm to obtain an encryption key, and saves the encryption key in the key information management module. If the mode information in the control parameters of the operation instruction is the manual mode, the data communication module sends the password of the operation instruction to the key information management module via the password verification module, the password verification module saves the password, and the key information management module encrypts the custom password in the password with a random value and a salt value according to a preset encryption algorithm to obtain an encryption key, and saves the encryption key;
[0111] S312) The device encryption module encrypts the unencrypted data of the external storage device through the encryption key and the preset encryption algorithm, the status feedback module calculates the time required for encryption, and feeds back the progress data to the Web rendering engine module through the data communication module, and when the encryption is completed, the processing result is fed back to the Web rendering engine module through the data communication module.
[0112] like Figure 4 As shown, the step of reading data in the external storage device when power is not turned on for the first time in step S3) specifically includes:
[0113] S321) The data communication module receives and parses the operation instruction. If the mode information in the control parameters of the operation instruction is the automatic mode, the key information management module generates a decryption key through the encryption key, the encryption random value and the salt value according to the preset decryption algorithm. If the mode information in the control parameters of the operation instruction is the manual mode, the data communication module sends the password of the operation instruction to the password verification module, and the password verification module compares and verifies the password with the password saved when the power is first turned on. If the verification is successful, the password verification module sends the password to the key information management module. The key information management module generates a decryption key through the random value, the salt value and the custom password in the password according to the preset decryption algorithm; if the verification fails, the password verification module feeds back the verification failure information to the Web rendering engine module through the data communication module and jumps to execute step S4);
[0114] S322) The device decryption module reads the data to be decrypted from the target external storage device through the virtual device of the mounted target external storage device, and then decrypts the data to be decrypted through the decryption key and the preset decryption algorithm. The status feedback module calculates the time required for decryption, and feeds back the progress data to the Web rendering engine module through the data communication module. When the decryption is completed, the processing result is fed back to the Web rendering engine module through the data communication module.
[0115] The step of writing data to the external storage device when power is not turned on for the first time in step S3) specifically includes:
[0116] S331) The data communication module receives and parses the operation instruction. If the mode information in the control parameters of the operation instruction is the automatic mode, the key information management module encrypts the default password with a random value and a salt value according to a preset encryption algorithm to obtain an encryption key, and saves it in the key information management module. If the mode information in the control parameters of the operation instruction is the manual mode, the data communication module sends the password of the operation instruction to the password verification module, and the password verification module compares and verifies the password with the password saved when the power is first turned on. If the verification is successful, the password verification module sends the password to the key information management module, and the key information management module encrypts the custom password in the password with a random value and a salt value according to a preset encryption algorithm to obtain an encryption key, and saves the encryption key; if the verification fails, the password verification module feeds back the verification failure information to the Web rendering engine module through the data communication module and jumps to execute step S4);
[0117] S332) The device encryption module encrypts the data to be written by using an encryption key and a preset encryption algorithm, and then writes the encrypted data to be written into the target external storage device through the virtual device of the mounted target external storage device. The status feedback module calculates the time required for encryption, and feeds back the progress data to the Web rendering engine module through the data communication module. When the encryption is completed, the processing result is fed back to the Web rendering engine module through the data communication module.
[0118] Before the step of reading data from the external storage device when power is not turned on for the first time and the step of writing data to the external storage device when power is not turned on for the first time, there are steps of configuring a virtual device of the target external storage device and mounting it, which specifically include:
[0119] The virtual conversion module obtains the external storage device information list from the device data analysis module, takes the external storage device for which there is no corresponding virtual device as an object, creates the corresponding virtual device, and associates the created virtual device with the corresponding external storage device according to the logical starting address, range and address offset in the device information of the object;
[0120] The data communication module receives and parses the operation instruction, and sends the mount instruction in the operation instruction to the mount module. The mount module mounts the virtual device corresponding to the target external storage device in the mount instruction to the file system of the Kylin mobile operating system through a preset mount function according to the mount instruction.
[0121] In addition to inputting mode information, passwords, mount instructions, etc., users can also use control parameters to query the status of external storage devices, query the progress of the encryption process, query the progress of the decryption process, and erase data on external storage devices. These operations are also processed by calling the encryption and decryption interface of the Web rendering engine module, but the incoming control parameters are changing.
[0122] Embodiment 3
[0123] This embodiment is basically the same as the second embodiment, except that Figure 5 As shown, the encryption and decryption interface implementation in this embodiment is as follows:
[0124] Interface input: control instructions, passwords and other data parameters.
[0125] Interface output: event.
[0126] In this embodiment, the parameters for processing event attributes related to storage encryption are registered in the Web rendering engine module, an event processing function is created and initialized, and then an event is dispatched. The Web interaction module calls the encryption and decryption interface of the Web rendering engine module, passes in control parameters and performs event monitoring. The control parameters are input, and the event monitoring is used to receive events dispatched by the Web rendering engine module. The event object contains data sent by the Web rendering engine module to the Web interaction module. After the Web rendering engine module processes the business logic, it dispatches the processing results in the form of events. The Web rendering engine module receives the event in an asynchronous manner, that is, it obtains the feedback result after issuing the instruction. The Web interaction module can receive information such as the current status and processing results of the external storage device from the encryption and decryption interface.
[0127] Therefore, in this embodiment, the operation instruction in step S1) includes control parameters;
[0128] Step S2) specifically includes: the Web rendering engine module defines the parameters of the event attributes and constructs an event processing function, obtains the control parameters from the encryption and decryption interface and then parses the control parameters, and sends the parsed control parameters to the external storage device management module in an inter-process communication manner;
[0129] Step S4) specifically includes: the external storage device management module sends the feedback information to the Web rendering engine module through inter-process communication, and after the Web rendering engine module monitors the feedback information, it uses the feedback information as an event object and dispatches the event to the Web interaction module through the encryption and decryption interface;
[0130] In step S5), the Web interaction module monitors the event object through the encryption and decryption interface of the Web rendering engine module, and obtains the relevant processing information of the external storage device after parsing.
[0131] The above is only a preferred embodiment of the present invention, and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment, it is not intended to limit the present invention. Therefore, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the content of the technical solution of the present invention shall fall within the scope of protection of the technical solution of the present invention.
Claims
1. An external storage device encryption and decryption system based on Kylin mobile operating system, characterized in that: include: A Web interaction module is used to obtain operation instructions, call the encryption and decryption interface and input the operation instructions to the encryption and decryption interface, and wait for feedback data from the encryption and decryption interface. The Web interaction module is written in HTML5, CSS and Javascript, and is the top layer of the Kylin mobile operating system. It provides a user operation interface. Users input operation instructions through the Web interaction module and get feedback results from the user operation interface; The Web rendering engine module is used to provide an encryption and decryption interface, obtain operation instructions from the encryption and decryption interface and forward them to the external storage device management module, and wait for feedback data from the external storage device management module, and then send the feedback data to the Web interaction module through the encryption and decryption interface. The Web rendering engine module is a typesetting engine implemented in C++, which is responsible for interpreting interface content and collating information. The Web rendering engine module is responsible for implementing the encryption and decryption interface, encapsulating and providing it to the Web interaction module for use. The Web rendering engine module exchanges data with the external storage device management module through inter-process communication; The external storage device management module is used to identify the external storage device and feed back the device data to the Web rendering engine module. It is also used to obtain operation instructions from the Web rendering engine module, determine the target external storage device according to the operation instructions, mount the corresponding virtual device, and generate an encryption key or a decryption key. Then, the data in the target external storage device is encrypt or decrypted through the virtual device, and the corresponding feedback information is generated and sent to the Web rendering engine module.
2. The external storage device encryption and decryption system based on Kylin mobile operating system according to claim 1 is characterized in that: The external storage device management module includes: The device node identification module is used to detect external storage devices by monitoring changes in device nodes, and detect plug-in and pull-out events of external storage devices to form an external storage device information list; A device status analysis module, used to obtain the mounting status and encryption status of all detected external storage devices in the external storage device information list; A device data analysis module, used to obtain device information of all detected external storage devices in the external storage device information list; The data communication module is used to interact with the Web rendering engine module.
3. The external storage device encryption and decryption system based on Kylin mobile operating system according to claim 2 is characterized in that: The external storage device management module also includes: A virtual conversion module, used to create a virtual device corresponding to the external storage device according to the device information in the external storage device information list; The mounting module is used to determine the target external storage device according to the mounting instruction, and mount the virtual device corresponding to the target external storage device to the file system of the Kylin mobile operating system through a preset mounting function.
4. The external storage device encryption and decryption system based on Kylin mobile operating system according to claim 3 is characterized in that: The external storage device management module also includes: A key information management module, used to generate an encryption key and call a device encryption module according to a password in an operation instruction, or to generate a decryption key and call a device decryption module; The device encryption module is used to encrypt the unencrypted data of the external storage device by using the encryption key and the preset encryption algorithm, and is also used to encrypt the data to be written by using the encryption key and the preset encryption algorithm, and then write the encrypted data to be written to the external storage device by using the virtual device; The device decryption module is used to read the data to be decrypted from the external storage device through the virtual device, and then decrypt the data to be decrypted through the decryption key and the preset decryption algorithm.
5. A method for encrypting and decrypting an external storage device based on the Kylin mobile operating system, characterized in that: The following steps are involved: S1) The Web interaction module obtains the operation instruction, calls the encryption and decryption interface and inputs the operation instruction to the encryption and decryption interface. The Web interaction module is written in HTML5, CSS and Javascript, and is the top layer of the Kylin mobile operating system. It provides a user operation interface. The user inputs the operation instruction through the Web interaction module and obtains feedback results from the user operation interface; S2) The Web rendering engine module obtains the operation instruction from the encryption and decryption interface and forwards it to the external storage device management module. The Web rendering engine module is a typesetting engine implemented in C++, which is responsible for interpreting the interface content and collating the information. The Web rendering engine module is responsible for implementing the encryption and decryption interface, encapsulating it and providing it to the Web interaction module for use. The Web rendering engine module exchanges data with the external storage device management module through inter-process communication; S3) The external storage device management module obtains an operation instruction from the Web rendering engine module, determines the target external storage device according to the operation instruction, mounts the corresponding virtual device, generates an encryption key or a decryption key, and then encrypts or decrypts the data in the target external storage device through the virtual device, generates corresponding feedback information and sends it to the Web rendering engine module; S4) The Web rendering engine module waits for and receives feedback information from the external storage device management module, and sends the feedback information to the Web interaction module through the encryption and decryption interface; S5) The Web interaction module waits and receives feedback information from the encryption and decryption interface.
6. The external storage device encryption and decryption method of the Kylin mobile operating system according to claim 5, characterized in that: Before step S1), the process also includes a step in which the external storage device management module identifies the external storage device, which specifically includes: S01) The device node identification module detects the external storage device by monitoring the changes of the device node, and detects the plugging and unplugging events of the external storage device to form an external storage device information list; S02) the device status analysis module obtains the mounting status and encryption status of all detected external storage devices in the external storage device information list, and the device data analysis module obtains the device information of all detected external storage devices in the external storage device information list; S03) The data communication module feeds back the mounting status, encryption status and device information of all detected external storage devices to the Web rendering engine module, and the Web rendering engine module feeds back the mounting status, encryption status and device information to the Web interaction module through the encryption and decryption interface.
7. The external storage device encryption and decryption method of the Kylin mobile operating system according to claim 5, characterized in that: Step S3) includes the step of encrypting the target external storage device when powered on for the first time, specifically including: S311) The key information management module encrypts the default password or the custom password in the password of the operation instruction to obtain an encryption key, and saves the encryption key. If the mode information in the control parameter of the operation instruction is the manual mode, the password verification module saves the password; S312) The device encryption module encrypts the unencrypted data of the external storage device using the encryption key and a preset encryption algorithm.
8. The external storage device encryption and decryption method of the Kylin mobile operating system according to claim 5, characterized in that: Step S3) includes the step of reading data in the external storage device when the power is not turned on for the first time, specifically including: S321) The key information management module generates a decryption key according to a preset decryption algorithm using the encryption key, the encryption random value and the salt value. If the mode information in the control parameter of the operation instruction is a manual mode, the key information management module generates a decryption key according to a preset decryption algorithm using the random value, the salt value and the custom password in the password. S322) The device decryption module reads the data to be decrypted from the target external storage device through the virtual device of the mounted target external storage device, and then decrypts the data to be decrypted using the decryption key and a preset decryption algorithm.
9. The external storage device encryption and decryption method of the Kylin mobile operating system according to claim 5, characterized in that: The operation instruction in step S1) includes control parameters and Callback function; Step S2) specifically includes: the Web rendering engine module obtains the control parameters and the Callback function from the encryption and decryption interface, saves the Callback function in the form of a pointer, parses the control parameters and sends the parsed control parameters to the external storage device management module in an inter-process communication manner; Step S4) specifically includes: the external storage device management module sends the feedback information to the Web rendering engine module through inter-process communication, and the Web rendering engine module uses the Callback function pointer to send the feedback information as a Callback function parameter from the encryption and decryption interface to the Web interaction module; In step S5), the Web interaction module obtains the returned parameters through the encryption and decryption interface, and obtains the relevant processing information of the external storage device after parsing.
10. The external storage device encryption and decryption method of the Kylin mobile operating system according to claim 5, characterized in that: The operation instruction in step S1) includes control parameters; Step S2) specifically includes: the Web rendering engine module defines the parameters of the event attributes and constructs an event processing function, obtains the control parameters from the encryption and decryption interface and then parses the control parameters, and sends the parsed control parameters to the external storage device management module in an inter-process communication manner; Step S4) specifically includes: the external storage device management module sends the feedback information to the Web rendering engine module through inter-process communication. After the Web rendering engine module monitors the feedback information, it uses the feedback information as an event object and dispatches the event to the Web interaction module through the encryption and decryption interface; In step S5), the Web interaction module monitors the event object through the encryption and decryption interface of the Web rendering engine module, and obtains the relevant processing information of the external storage device after parsing.
Citation Information
Patent Citations
Mounting method and system of external storage equipment
CN105549914A
Data encryption mobile storage management method based on virtual disk
CN103065102A
Kernel-level virtual polymerization and parallel encryption method for class-oriented Linux system
CN103294958A