WO2022068693A1 - 预处理方法、处理方法、解密及读取方法、设备、介质 - Google Patents

预处理方法、处理方法、解密及读取方法、设备、介质 Download PDF

Info

Publication number
WO2022068693A1
WO2022068693A1 PCT/CN2021/120296 CN2021120296W WO2022068693A1 WO 2022068693 A1 WO2022068693 A1 WO 2022068693A1 CN 2021120296 W CN2021120296 W CN 2021120296W WO 2022068693 A1 WO2022068693 A1 WO 2022068693A1
Authority
WO
WIPO (PCT)
Prior art keywords
read
data
version file
file
instruction
Prior art date
Application number
PCT/CN2021/120296
Other languages
English (en)
French (fr)
Inventor
刘季
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2022068693A1 publication Critical patent/WO2022068693A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Definitions

  • Embodiments of the present disclosure relate to, but are not limited to, the field of embedded systems, and in particular, relate to a method for preprocessing a basic system of an embedded system, a method for processing a version file of an embedded system, and a version of an embedded system A method for decrypting data in a file, a method for reading data in a version file in an embedded system, an electronic device, and a computer-readable storage medium.
  • Embodiments of the present disclosure provide a method for preprocessing a basic system of an embedded system, a method for processing a version file of an embedded system, a method for decrypting data in a version file of an embedded system, and an embedded system A method for reading data in a version file in an electronic device, and a computer-readable storage medium.
  • a preprocessing method for a basic system of an embedded system including: receiving a modification instruction; The source code is processed to obtain a read-related instruction carrying the verification data.
  • the step of processing the source code of the predetermined read-related instruction in the source code file of the basic system according to the modification instruction to obtain the read-related instruction carrying the verification data includes: The source code file of the basic system is modified so that the source code file of the read-related instruction carries a check code.
  • the basic system is a Linux system
  • the predetermined read-related instructions include cat instructions and/or ls instructions.
  • a method for generating an encrypted version file of an embedded system including: compressing an initial version file to obtain a binary file; and encrypting the binary file by using a predetermined encryption algorithm to obtain a binary file. Obtaining an encrypted version file; and storing the encrypted version file on a storage device, wherein the storage device is installed with the basic system preprocessed by the preprocessing method.
  • the generating method further includes, before the step of compressing the initial version file, compiling and producing the initial version file.
  • the initial version file includes multiple application programs, and in the step of compiling and making the initial version file, a part of the multiple application programs is configured with the permission to read decrypted data, so The rest of the applications described above are not configured with permission to read decrypted data.
  • a method for decrypting data in an encrypted version file of an embedded system wherein the encrypted version file is generated by the generating method, and the decrypting method includes: judging the received Whether the read-related instruction carries the verification data; when the received read-related instruction carries the verification data, the received read instruction is performed according to the predetermined decryption algorithm corresponding to the predetermined encryption algorithm. The data pointed to by the relevant instruction is decrypted.
  • the decryption method further includes, before the step of judging whether the received read-related instruction carries the verification data: judging whether the received read-related instruction has the authority to obtain decrypted data; when When the received read-related command has the authority to obtain decrypted data, the step of judging whether the received read-related command carries the verification data is performed.
  • the decryption method further includes, performed before the step of judging whether the received read-related instruction has the authority to obtain decrypted data: from the storage device, the encrypted data pointed to by the read-related instruction.
  • a method for reading data in an encrypted version file of an embedded system wherein the encrypted version file is generated by the generating method, and the reading method includes: receiving a read After the relevant instruction is fetched, the decryption method is executed; when there is decrypted data, the decrypted data is returned to the upper-layer application that sends the read relevant instruction.
  • the encrypted data pointed to by the read-related command is returned to the upper-layer application that sent the read-related command.
  • an electronic device includes: a storage device on which a first executable program, a second executable program, a third executable program and a fourth executable program are stored At least one of the programs; at least one processor, when the at least one processor calls the first executable program, implements the preprocessing method, when the at least one processor calls the second executable program When the at least one processor calls the third executable program, the decryption method is implemented, and when the at least one processor calls the fourth executable program, Implement the read method.
  • a computer-readable storage medium on which an executable program is stored, and when the executable program is invoked, any one of the following methods can be implemented: the preprocessing method; the generating method; the decrypting method; or the reading method.
  • the basic system eg, Linux system
  • predetermined read-write related instructions carry check data.
  • an encryption algorithm can be directly used to encrypt the binary file obtained by compressing the initial version file to obtain the encrypted version file.
  • the size of the encrypted version file does not increase, so that the storage space of the embedded system can be saved.
  • the step of decrypting the data pointed to by the read-related instruction is performed only when the read-related instruction carrying the verification data is received. If the received read related instruction does not carry the verification data, the related data will not be decrypted, thus ensuring the data security in the version file.
  • FIG. 1 is a flowchart of an implementation manner of a preprocessing method provided by an embodiment of the present disclosure
  • FIG. 2 is a flowchart of an implementation manner of a method for generating an encrypted version file of an embedded system provided by an embodiment of the present disclosure
  • FIG. 3 is a flowchart of another implementation manner of a method for generating an encrypted version file of an embedded system provided by an embodiment of the present disclosure
  • FIG. 4 is a flowchart of an implementation manner of a method for decrypting data in an encrypted version file of an embedded system provided by an embodiment of the present disclosure
  • FIG. 5 is a flowchart of another implementation manner of a method for decrypting data in an encrypted version file of an embedded system provided by an embodiment of the present disclosure
  • FIG. 6 is a flowchart of a method for reading data in an encrypted version file of an embedded system provided by an embodiment of the present disclosure.
  • FIG. 7 is a block diagram of an embodiment of an embedded system.
  • Embodiments described herein may be described with reference to plan and/or cross-sectional views with the aid of idealized schematic representations of the present disclosure. Accordingly, example illustrations may be modified according to manufacturing techniques and/or tolerances. Therefore, the embodiments are not limited to the embodiments shown in the drawings, but include modifications of configurations formed based on manufacturing processes. Thus, the regions illustrated in the figures have schematic properties and the shapes of regions illustrated in the figures are illustrative of the specific shapes of regions of elements and are not intended to be limiting.
  • the version file is encrypted by an enterprise-level encrypted file system (eCryptfs, Enterprise Cryptographic File system) file system.
  • eCryptfs is an encrypted file system of Linux, and is another virtual file system superimposed on the virtual file system (VFS, virtual File System), which can encapsulate the read and write functions for encryption and decryption into VFS. , and finally presents the decrypted data to the user.
  • VFS virtual File System
  • these processing methods include a preprocessing method for a basic system, a processing method for a version file of an embedded system, a method for decrypting data in a version file of an embedded system, and a version file of an embedded system How to read the data in .
  • the basic system of the embedded system needs to be processed by the preprocessing method provided by the embodiment of the present disclosure, and then based on the preprocessed basic system, the version file is processed by the processing method provided by the embodiment of the present disclosure.
  • encryption When the subsequent application program runs, the decryption method provided by the embodiment of the present disclosure is used to decrypt the data required by the application program, and then the data reading method provided by the embodiment of the present disclosure is implemented.
  • a preprocessing method for a basic system of an embedded system is provided. As shown in FIG. 1 , the preprocessing method includes:
  • step S110 a modification instruction is received
  • step S120 the source code of the predetermined read-related instruction in the source code file of the basic system is processed according to the modification instruction, so as to obtain the read-related instruction carrying the verification data.
  • the basic system is an embedded system operating environment, and the version file of the embedded system runs in the basic system.
  • step S120 the source code file of the basic system is modified, so that the source code file for reading the relevant instruction carries the check code.
  • the embedded system installed with the basic system preprocessed by the above method receives the read-related command, it needs to verify the received read-related command, and confirm whether the received read-related command carries the read-related command. code verification.
  • the related data is not decrypted. For example, encrypted data may be returned directly to the application that sent the read-related instructions. In this way, the real content is invisible to the application sending the read-related commands.
  • the step of decrypting the encrypted data is performed at the driver layer of the embedded system.
  • the decrypted data is returned, so that the decrypted data (ie, the real content) is visible to the application that sends the read-related instruction.
  • the source of the modification instruction is not particularly limited.
  • the modification instructions may be input into the embedded system through an input device.
  • the basic system is not particularly limited, and as an optional implementation manner, the basic system may be a Linux system.
  • the predetermined read-related instructions are not particularly limited.
  • the predetermined read-related commands include cat commands and/or ls commands.
  • the cat command is a Linux command, short for concatenate, used to display or connect multiple text files, similar to the type command under dos.
  • the ls command is a Linux command that writes to standard output each directory specified by the Directory parameter or each name specified by the File parameter, and other information required by the client along with flags . If you do not specify the File or Directory parameter, the ls command displays the contents of the current directory.
  • cat-hd the cat instruction carrying the check code
  • ls instruction carrying the check code the ls instruction carrying the check code
  • a method for generating an encrypted version file of an embedded system includes:
  • step S210 the initial version file is compressed to obtain a binary file
  • step S220 using a predetermined encryption algorithm to encrypt the binary file to obtain an encrypted version file
  • step S230 the encrypted version file is stored on a storage device, wherein the storage device is installed with the basic system processed by the preprocessing method provided by the first aspect of the present disclosure.
  • a predetermined algorithm is used to encrypt the binary file of the initial version file to obtain the encrypted version file, and the file size does not change before and after encryption, that is, when the size of the initial version file and the size of the encrypted version file are identical.
  • the processing method provided by the embodiment of the present disclosure encrypts each file in the initial version file and obtains an encrypted version The file takes up less space.
  • the storage device is flash, and the flash storage space is small. If eCryptfs is used to encrypt the initial version file of the embedded system of the home gateway or other smart home products, the final encrypted version file will be large, which will affect the normal operation and use of the home gateway or smart home products. As described above, when the initial version file of the embedded system is encrypted by using the processing method provided by the embodiment of the present disclosure, the obtained smaller encrypted version file is more suitable for home gateways, or smart home products with smaller flash storage space. device of.
  • the encrypted version file is stored on the storage medium device on which the preprocessed base system is installed.
  • the predetermined source code file for reading the relevant instruction carries the check code.
  • the encrypted data is returned instead of the decrypted data. Therefore, even if someone maliciously logs in to the corresponding electronic device or board, the decrypted key information (for example, factory configuration information, device root user name, password, etc.) cannot be obtained.
  • the corresponding data in the encrypted version file can be decrypted by using a predetermined decryption algorithm corresponding to the predetermined encryption algorithm and a corresponding key , the decrypted data can be obtained, and the decryption method is relatively simple.
  • the decrypted data can be read by using the cat-hd command or the ls-hd command, but only the undecrypted data can be read by using the cat command or the ls command and other commands that do not carry the verification data.
  • the key indicator is throughput.
  • using eCryptfs to encrypt each file in the initial version file of the embedded system will generate redundant data such as file headers.
  • the file header generated by encryption also needs to be processed, thereby reducing the throughput of the embedded system.
  • the embedded system is configured with the encrypted version file generated by the generating method provided by the embodiment of the present disclosure.
  • the encrypted version file generated by the generating method provided by the embodiment of the present disclosure has no influence on the performance such as throughput of the home gateway.
  • the generating method may further include step 200 performed before step S210:
  • step S200 the initial version file is compiled and produced.
  • the content of the initial version file is not particularly limited.
  • the initial version file includes multiple system files, and the multiple system files include any of the kernel, application program, library file, and database file. a few.
  • the permissions of the applications may also be limited, for example, some applications have the permission to read and decrypt data, while some applications do not have the permission to read and decrypt data. data permissions.
  • the initial version file includes multiple application programs, some of the multiple application programs are configured with the permission to read decrypted data, and the rest of the multiple application programs are configured with the permission to read the decrypted data.
  • the program is not configured with permission to read decrypted data.
  • step S210 there is no special limitation on how to perform step S210.
  • a compression method is used to obtain a compression tool, and the compression tool (eg, jffs2, squashfs) is used to compress the initial version file to generate all the described binary file.
  • the initial version file is compressed using standard compression tools.
  • tools for cracking binary files compressed by standard compression tools also exist.
  • binwalk can be used to extract the contents of compressed binaries.
  • the binary file of the initial version is encrypted, even if the encrypted version file generated by using the generation method provided in the second aspect of the present disclosure is obtained, the binary file of the original version cannot be decrypted by a cracking tool such as binwalk.
  • the encrypted version file is cracked, so that the binary file content of the version file cannot be extracted.
  • step S220 there is no special limitation on how to perform step S220. For example, you can select a certain encryption algorithm and configure the corresponding key to make an encryption tool, and then use the encryption tool to encrypt with a certain fixed size (for example, 512 or 2048) as a unit to generate an encrypted version A binary file (ie, the encrypted version file).
  • a certain fixed size for example, 512 or 2048
  • the predetermined encryption algorithm is not particularly limited.
  • the predetermined encryption algorithm may be an Advanced Encryption Standard (AES, Advanced Encryption Standard) algorithm.
  • AES Advanced Encryption Standard
  • the key of the AES algorithm is longer, and the encryption using the AES algorithm is more secure.
  • a method for decrypting data in an encrypted version file of an embedded system wherein the encrypted version file is generated by the generation method provided in the second aspect of the present disclosure, as shown in FIG. 4 .
  • the decryption method includes:
  • step S310 determine whether the received read-related instruction carries the verification data
  • step S320 when the received read-related instruction carries the verification data, decrypt the data pointed to by the received read-related instruction according to a predetermined decryption algorithm corresponding to the predetermined encryption algorithm .
  • the system driver reads the read-related instruction issued by the upper-layer application from the hardware, and judges the read-related instruction through step S310.
  • the read-related instruction is valid only when the verification data is carried in the read-related instruction, in which case the data can be decrypted.
  • step S310 When it is determined in step S310 that the received read-related instruction does not carry the verification data, the data pointed to by the read-related instruction will not be decrypted.
  • the driver layer of the embedded system when it is determined that the data needs to be decrypted, the driver layer of the embedded system performs decryption on a page-by-page basis according to the predetermined decryption algorithm and key, without going through relevant Encryption systems such as the eCryptfs system involved in the technology are equivalent to operating the data in the embedded system naked, which not only simplifies the algorithm, but also improves the operation speed.
  • step S320 is performed at the driving layer.
  • the decryption method further includes steps performed before step S310:
  • step S300 it is determined whether the received read-related instruction has the authority to obtain decrypted data.
  • step S310 The step of judging whether the received read-related command carries the verification data is only executed when the received read-related command has the authority to obtain decrypted data (ie, step S310 is executed).
  • step S310 may not be executed, so that unnecessary operations can be avoided, and the embeddedness can be improved. operating speed of the system.
  • version files are encrypted using eCryptfs.
  • eCryptfs the version file must be decrypted at runtime.
  • the decryption method for determining whether to perform decryption according to the authority of the application sending the read instruction provided by the embodiments of the present disclosure is more flexible.
  • the step of decrypting data may be performed in the driver layer.
  • the decryption method may further include steps performed before step S300:
  • the encrypted data pointed to by the read-related instruction is read from the storage device.
  • step S300 When the judgment result of step S300 is NO, or the judgment result of step S310 is NO, the read encrypted data is directly returned to the upper-layer application.
  • a method for reading an encrypted version file of an embedded system wherein the encrypted version file is generated by the generating method provided in the second aspect of the present disclosure, as shown in FIG. 6 .
  • the reading method includes:
  • step S410 after receiving and reading the relevant instruction, execute the above-mentioned decryption method provided by the present disclosure
  • step S420 when there is decrypted data, the decrypted data is returned to the upper-layer application that sends the read-related instruction.
  • the received read-related instruction meets the corresponding conditions, including the following two cases:
  • the received read-related instruction carries the verification data
  • the received read-related command has the authority to read data, and the received read-related command carries the verification data.
  • step S430 there is no special limitation on what steps are performed after decrypting data does not exist. For example, when there is no decrypted data, alarm information or other prompt information can be directly generated. Alternatively, when there is no decrypted data, the encrypted data may be directly returned (step S430).
  • whether to decrypt the data may be determined according to the received read-related instruction. Specifically, when the received read-related instruction does not have the authority to read the decrypted data, the data is not decrypted; when the received read-related instruction has the authority to read the decrypted data but does not carry the verification data, The data is also not decrypted.
  • the read-related instruction has the authority to read decrypted data according to the application program that issues the read-related instruction.
  • the read instruction issued by the application also has the right to read the decrypted data; when the application does not have the right to read the decrypted data, the read instruction issued by the application Also does not have permission to read decrypted data.
  • the preprocessing method of the basic system, the method for generating an encrypted version, the method for decrypting data in the encrypted version file, and the method for reading data in the encrypted version file are briefly described below with reference to a specific embedded system. introduce.
  • the embedded system includes an instruction receiving module 510, an encapsulation module 520, a compilation module 530, a compression module 540, an encryption module 550, a storage device 560, an authority confirmation module 570, a verification module 580, and a data return module 590.
  • the encapsulation module 520 processes the source code file of the basic system, so that the predetermined read-related instruction carries the verification data, and finally obtains a preprocessed basic system, and the The preprocessed base system is installed on storage medium 560 .
  • the encrypted version file of the embedded system runs in the context of the preprocessed base system.
  • the compilation module 530 compiles and produces the initial version file, and generates various system files such as kernel, application program, library file, database file, etc.;
  • the compression module 540 uses a compression tool to compress the initial version file to obtain a binary file
  • the encryption module 550 performs encryption processing on the binary file by using an encryption tool corresponding to a predetermined encryption algorithm and configured with a corresponding key to obtain the encrypted version file;
  • the encrypted version of the file is stored on storage device 560 .
  • the driver of the embedded system reads data from the storage device 560 according to the read-related instruction issued by the upper-layer application, including the following operations:
  • the authority confirmation module 570 judges whether the received read-related instruction has the authority to obtain decrypted data
  • the verification module 580 determines whether the received read-related instruction carries verification data
  • the specific type of the embedded system is not particularly limited.
  • the embedded system may be at least one of a home gateway, a router, and a smart home device.
  • an electronic device comprising:
  • a storage device having stored thereon at least one of the first executable program, the second executable program, the third executable program, and the fourth executable program;
  • At least one processor when the at least one processor calls the first executable program, implements the preprocessing method provided by the first aspect of the present disclosure, and when the at least one processor calls the second executable program when the generation method provided by the second aspect of the present disclosure is implemented, when the at least one processor calls the third executable program, the decryption method provided by the fourth aspect of the present disclosure is implemented, and the at least one processing When the fourth executable program is called by the browser, the reading method provided by the fifth aspect of the present disclosure is implemented.
  • the electronic device is an embedded system.
  • the basic system eg, Linux system
  • predetermined read and write related instructions carry check data.
  • the binary file obtained by compressing the initial version file can be encrypted directly by using an encryption algorithm to obtain the encrypted version file.
  • the size of the encrypted version file does not increase, so that the storage space of the embedded system can be saved.
  • the step of decrypting the data pointed to by the read-related instruction is performed only when the read-related instruction carrying the verification data is received. If the received read related instruction does not carry the verification data, the related data will not be decrypted, thereby ensuring the data security in the version file.
  • the electronic device may further include at least one I/O interface, where the I/O interface is connected between the processor and the memory, and is configured to implement information interaction between the processor and the memory.
  • the processor is a device with data processing capability, including but not limited to a central processing unit (CPU), etc.
  • the storage device is a device with data storage capability, including but not limited to random access memory (RAM, more Specifically, such as SDRAM, DDR, etc.), read-only memory (ROM), electrified erasable programmable read-only memory (EEPROM), flash memory (FLASH); I/O interface (read and write interface) is connected between the processor and the memory, which can Implement the information interaction between the processor and the memory, which includes but is not limited to a data bus (Bus) and the like.
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrified erasable programmable read-only memory
  • FLASH flash memory
  • I/O interface read and write interface
  • processors, storage devices, and I/O interfaces are interconnected by a bus, which in turn is connected to other components of the computing device.
  • a computer-readable storage medium on which an executable program is stored, and when the executable program is invoked, any one of the following methods can be implemented:
  • Computer storage media includes both volatile and nonvolatile implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules or other data flexible, removable and non-removable media.
  • Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, magnetic tape, magnetic disk storage or other magnetic storage devices, or may Any other medium used to store desired information and which can be accessed by a computer.
  • communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and can include any information delivery media, as is well known to those of ordinary skill in the art .

Abstract

一种嵌入式系统的基础系统的预处理方法,包括:接收修改指令;根据修改指令对基础系统的源码文件中,预定的读取相关指令的源码进行处理,以获得携带有校验数据的读取相关指令。还提供一种嵌入式系统的加密版本文件的生成方法、一种嵌入式系统的加密版本文件中数据的解密方法、一种嵌入式系统的加密版本文件中数据的读取方法、一种电子设备和一种计算机可读存储介质。利用所提供的预处理方法对嵌入式系统的基础系统进行预处理后,可以利用预定加密算法生成加密版本文件,该加密版本文件占用存储空间较小,并且对数据进行解密时也更加安全。

Description

预处理方法、处理方法、解密及读取方法、设备、介质
相关申请的交叉引用
本公开要求在2020年9月30日提交国家知识产权局、申请号为202011066189.6、发明名称为“预处理方法、处理方法、解密及读取方法、设备、介质”的中国专利申请的优先权,该申请的全部内容通过引用结合在本公开中。
技术领域
本公开的实施例涉及但不限于嵌入式系统领域,具体地,涉及一种嵌入式系统的基础系统的预处理方法、一种嵌入式系统的版本文件的处理方法、一种嵌入式系统的版本文件中数据的解密方法、一种嵌入式系统中的版本文件中数据的读取方法、一种电子设备和一种计算机可读存储介质。
背景技术
目前,嵌入式系统的版本文件的安全问题越来越受到运营商以及用户的重视。如何保证版本文件在发布过程、以及使用过程中的安全而不被其他人恶意破解或破坏,成为一个重要的课题。
发明内容
本公开的实施例提供一种嵌入式系统的基础系统的预处理方法、一种嵌入式系统的版本文件的处理方法、一种嵌入式系统的版本文件中数据的解密方法、一种嵌入式系统中的版本文件中数据的读取方法、一种电子设备和一种计算机可读存储介质。
作为本公开的一个方面,提供一种嵌入式系统的基础系统的预处理方法,包括:接收修改指令;以及根据所述修改指令对所述基础系统的源码 文件中,预定的读取相关指令的源码进行处理,以获得携带有校验数据的读取相关指令。
可选地,所述根据所述修改指令对所述基础系统的源码文件中预定的读取相关指令的源码进行处理,以获得携带有校验数据的读取相关指令的步骤包括:对所述基础系统的源码文件进行修改,使得所述读取相关指令的源码文件携带有校验码。
可选地,所述基础系统为Linux系统,并且所述预定的读取相关指令包括cat指令和/或ls指令。
作为本公开的第二个方面,提供一种嵌入式系统的加密版本文件的生成方法,包括:对初始版本文件进行压缩,获得二进制文件;利用预定加密算法对所述二进制文件进行加密处理,以获得加密版本文件;将所述加密版本文件存储在存储装置上,其中,所述存储装置上安装有经过所述预处理方法所预处理后的基础系统。
可选地,所述生成方法还包括在对初始版本文件进行压缩的步骤之前进行的:编译制作所述初始版本文件。
可选地,所述初始版本文件包括多个应用程序,在所述编译制作所述初始版本文件的步骤中,所述多个应用程序中的一部分应用程序配置有读取解密数据的权限,所述多个应用程序中的其余应用程序未配置有读取解密数据的权限。
作为本公开的第三个方面,提供一种嵌入式系统的加密版本文件中数据的解密方法,其中,所述加密版本文件由所述生成方法所生成,所述解密方法包括:判断接收到的读取相关指令是否携带有所述校验数据;当接收到的读取相关指令携带有所述校验数据时,根据与所述预定加密算法对应的预定解密算法对所述接收到的读取相关指令所指向的数据进行解密。
可选地,所述解密方法还包括在判断接收到的读取相关指令是否携带有所述校验数据的步骤之前进行的:判断接收到的读取相关指令是否具有获取解密数据的权限;当接收到的读取相关指令具有获取解密数据的权限时,执行所述判断接收到的读取相关指令是否携带有所述校验数据的步 骤。
可选地,所述解密方法还包括在判断接收到的读取相关指令是否具有获取解密数据的权限的步骤之前进行的:从存储装置上所述读取相关指令所指向的加密数据。
作为本公开的第四个方面,提供一种嵌入式系统的加密版本文件中数据的读取方法,其中,所述加密版本文件由所述生成方法所生成,所述读取方法包括:接收读取相关指令后,执行所述解密方法;当存在解密后的数据时,将解密后的数据返回给发送读取相关指令的上层应用。
可选地,当接收到的读取相关指令未携带所述校验数据时,将所述读取相关指令指向的加密数据返回给发送读取相关指令的上层应用。
作为本公开的第五个方面,提供一种电子设备,所述电子设备包括:存储装置,其上存储有第一可执行程序、第二可执行程序、第三可执行程序和第四可执行程序中的至少一者;至少一个处理器,当所述至少一个处理器调用所述第一可执行程序时,实现所述预处理方法,当所述至少一个处理器调用所述第二可执行程序时,实现权利要求所述生成方法,当所述至少一个处理器调用所述第三可执行程序时,实现所述解密方法,所述至少一个处理器调用所述第四可执行程序时,实现所述读取方法。
作为本公开的第六个方面,提供一种计算机可读存储介质,其上存储有可执行程序,当所述可执行程序被调用时,能够实现以下方法中的任意一者:所述预处理方法;所述生成方法;所述解密方法;或所述读取方法。
在本公开中,首先对电子设备的基础系统(例如,Linux系统)进行预处理,使得处理后的基础系统中,预定的读写相关指令携带有校验数据。
在对嵌入式系统的初始版本文件进行加密时,可以直接利用加密算法对压缩初始版本文件获得的二进制文件进行加密,以获得加密版本文件。所述加密版本文件的大小并未增加,从而可以节约嵌入式系统的存储空间。在加密版本文件运行时,只有接收到携带有校验数据的读取相关指令时,才执行对所述读取相关指令指向的数据进行解密的步骤。若接收到的读取相关指令未携带校验数据,则不对相关数据进行解密,从而可以确保 版本文件中的数据安全。
附图说明
图1是本公开实施例所提供的预处理方法的一种实施方式的流程图;
图2是本公开实施例所提供的嵌入式系统的加密版本文件的生成方法的一种实施方式的流程图;
图3是本公开实施例所提供的嵌入式系统的加密版本文件的生成方法的另一种实施方式的流程图;
图4是本公开实施例所提供的嵌入式系统的加密版本文件中数据的解密方法的一种实施方式的流程图;
图5是本公开实施例所提供的嵌入式系统的加密版本文件中数据的解密方法的另一种实施方式的流程图;
图6是本公开实施例所提供的嵌入式系统的加密版本文件中数据的读取方法的流程图;以及
图7是嵌入式系统的一种实施方式的模块示意图。
具体实施方式
在下文中将参考附图更充分地描述示例实施例,但是所述示例实施例可以以不同形式来体现且不应当被解释为限于本文阐述的实施例。反之,提供这些实施例的目的在于使本公开透彻和完整,并将使本领域技术人员充分理解本公开的范围。
如本文所使用的,术语“和/或”包括一个或多个相关列举条目的任何和所有组合。
本文所使用的术语仅用于描述特定实施例,且不意欲限制本公开。如本文所使用的,单数形式“一个”和“该”也意欲包括复数形式,除非上下文另外清楚指出。还将理解的是,当本说明书中使用术语“包括”和/或“由……制成”时,指定存在所述特征、整体、步骤、操作、元件和/或组件,但不 排除存在或添加一个或多个其他特征、整体、步骤、操作、元件、组件和/或其群组。
本文所述实施例可借助本公开的理想示意图而参考平面图和/或截面图进行描述。因此,可根据制造技术和/或容限来修改示例图示。因此,实施例不限于附图中所示的实施例,而是包括基于制造工艺而形成的配置的修改。因此,附图中例示的区具有示意性属性,并且图中所示区的形状例示了元件的区的具体形状,但并不旨在是限制性的。
除非另外限定,否则本文所用的所有术语(包括技术和科学术语)的含义与本领域普通技术人员通常理解的含义相同。还将理解,诸如那些在常用字典中限定的那些术语应当被解释为具有与其在相关技术以及本公开的背景下的含义一致的含义,且将不解释为具有理想化或过度形式上的含义,除非本文明确如此限定。
以下结合附图对本发明的具体实施方式进行详细说明。应当理解的是,此处所描述的具体实施方式仅用于说明和解释本发明,并不用于限制本发明。
在相关技术中,通过企业级加密文件系统(eCryptfs,Enterprise Cryptographic File system)文件系统对版本文件进行加密。具体地,eCryptfs是Linux的一种加密文件系统,并且是叠加在虚拟文件系统(VFS,virtual File System)之上的另一个虚拟文件系统,可以将进行加密、解密的读写函数封装至VFS中,并最终对用户呈现出解密后的数据。
但是,在利用eCryptfs对嵌入式系统的版本文件中的每个文件进行加密时,每个文件都会加上8k的加密扩展头,版本文件的大小随着被加密文件的数量的增加会增加很多,占用存储空间。并且,使用eCryptfs时,用户读写文件时都需要通过eCryptfs进行解密、加密,因此,对读写性能都会产生较大影响。具体地,读性能会降低29%左右,而写性能会下降几倍的数量级。
有鉴于此,本公开实施例提出一系列针对嵌入式系统的处理方法。具体地,这些处理方法包括一种基础系统的预处理方法、一种嵌入式系统的 版本文件的处理方法、一种嵌入式系统的版本文件中数据的解密方法、一种嵌入式系统的版本文件中数据的读取方法。
首先,需要利用本公开实施例所提供的预处理方法对嵌入式系统的基础系统进行处理,然后在经过预处理的基础系统的基础上,利用本公开实施例所提供的处理方法对版本文件进行加密。在后续应用程序运行时,利用本公开实施例所提供的解密方法对应用程序所需数据进行解密,然后实现本公开实施例所提供的数据读取方法。
下面结合附图对本公开的各个方面进行详细的介绍。
作为本公开的第一个方面,提供一种嵌入式系统的基础系统的预处理方法,如图1所示,所述预处理方法包括:
在步骤S110中,接收修改指令;
在步骤S120中,根据所述修改指令对所述基础系统的源码文件中,预定的读取相关指令的源码进行处理,以获得携带有校验数据的读取相关指令。
所述基础系统是嵌入式系统运行环境,嵌入式系统的版本文件在所述基础系统中运行。
在步骤S120中,对基础系统的源码文件进行修改,使得读取相关指令的源码文件中携带了校验码。在安装有经过上述方法预处理后的基础系统的嵌入式系统接收到读取相关指令时,需要对接收到的读取相关指令进行校验,并确认接收到的读取相关指令是否携带有校验码。当接收到的读取相关指令中未携带所述校验码时,则不对相关数据进行解密。例如,可以直接将加密的数据返回给发送所述读取相关指令的应用程序。这样,真实内容对该发送读取相关指令的应用程序是不可见的。
可选地,在嵌入式系统的驱动层执行对加密数据进行解密的步骤。
当读取相关指令携带有所述校验码时,则返回解密后的数据,从而使得解密后的数据(即,真实内容)对发送该读取相关指令的应用程序可见。
在本公开中,对修改指令的来源不做特殊的限定。例如,可以通过输 入设备将所述修改指令输入至嵌入式系统。
在本公开中,对所述基础系统不做特殊的限定,作为一种可选实施方式,所述基础系统可以为Linux系统。
在本公开中,对所述预定的读取相关指令也不做特殊的限定。例如,当所述基础系统为Linux系统是,所述预定的读取相关指令包括cat指令和/或ls指令。
具体地,cat指令是一种Linux命令,是concatenate的简写,用于显示或把多个文本文件连接起来,类似于dos下的type命令。
ls指令是一种Linux命令,用于将每个由目录(Directory)参数指定的目录或者每个由文件(File)参数指定的名称写到标准输出,以及客户所要求的和标志一起的其它信息。如果不指定File或Directory参数,ls命令显示当前目录的内容。
为了便于描述,将携带有校验码的cat指令记作cat-hd,将携带有校验码的ls指令记作ls-hd。
作为本公开的第二个方面,提供一种嵌入式系统的加密版本文件的生成方法,如图2所示,所述生成方法包括:
在步骤S210中,对初始版本文件进行压缩,获得二进制文件;
在步骤S220中,利用预定加密算法对所述二进制文件进行加密处理,以获得加密版本文件;
在步骤S230中,将所述加密版本文件存储在存储装置上,其中,所述存储装置上安装有经过本公开第一个方面所提供的预处理方法所处理后的基础系统。
在本公开所提供的处理方法中,利用预定算法对初始版本文件的二进制文件进行加密,获得加密版本文件,加密前后文件大小不发生改变,即,初始版本文件的大小与加密版本文件的大小时相同的。与相关技术中使用eCryptfs对嵌入式系统的初始版本文件中的每个文件进行加密相比,本公开实施例所提供的处理方法对初始版本文件中的每个文件进行加密后的 获得的加密版本文件所占空间更小。
对于家庭网关或者其他智能家居产品而言,其存储装置为flash,且flash存储空间较小。如果利用eCryptfs对家庭网关或者其他智能家居产品的嵌入式系统的初始版本文件进行加密,最终生成的加密版本文件较大,会影响家庭网关或者智能家居产品的正常运行使用。如上所述,在利用本公开实施例所提供的处理方法对嵌入式系统的初始版本文件进行加密,获得的较小的加密版本文件,更加适合家庭网关、或者智能家居产品等flash存储空间较小的设备。
需要指出的是,在本公开中,加密版本文件存储在安装有预处理后的基础系统的存储介质装置上。如上文中所述,在所述基础系统中,预定的读取相关指令的源码文件携带有校验码。当接收到的读取相关指令中未携带校验码时,则返回加密数据,而非返回解密数据。因此,即便有人恶意登录相应的电子设备或单板,也无法获取到解密后的关键信息(例如,厂配置信息、设备root用户名、密码等)。
由于所述加密版本文件由预定加密算法和相应的密钥加密获得,可以利用与所述预定加密算法相对应的预定解密算法、以及相应的密钥对所述加密版本文件中的相应数据进行解密,即可获得解密后的数据,解密方法也相对简单。
如上文中所述,可以利用cat-hd指令或者ls-hd读取到解密后的数据,但是,利用cat指令或者ls指令等未携带校验数据的指令只能读取到未经解密的数据。
对于家庭网关类产品而言,其关键指标为吞吐量。在相关技术中,利用eCryptfs对嵌入式系统的初始版本文件中的每个文件进行加密会产生文件头等冗余数据。在嵌入式系统处理数据时,也需要对因加密而产生的文件头进行处理,从而降低了嵌入式系统的吞吐量。而在本公开中,嵌入式系统配置了本公开实施例所提供的生成方法所生成的加密版本文件,处理数据时,只需要对协议数据进行处理,不需要处理冗余数据,从而提高了嵌入式系统的吞吐量。换言之,本公开实施例所提供的生成方法所生成的加密版本文件对家庭网关的吞吐量等性能没有影响。
可选地,如图3所示,所述生成方法还可以包括在步骤S210之前进行的步骤200:
在步骤S200中,编译制作所述初始版本文件。
在本公开中,对所述初始版本文件的内容不做特殊限定,例如,所述初始版本文件包括多个系统文件,该多个系统文件包括内核、应用程序、库文件、数据库文件中的任意几者。
作为一种可选实施方式,在编译制作所述初始版本文件时,还可以对应用程序的权限进行限定,例如,部分应用程序具有读取解密数据的权限,而部分应用程序不具有读取解密数据的权限。
也就是说,在步骤S200中,所述初始版本文件包括多个应用程序,所述多个应用程序中的一部分应用程序配置有读取解密数据的权限,所述多个应用程序中的其余应用程序未配置有读取解密数据的权限。
在读取加密版本文件中的加密数据时,先判断发送所述读取相关指令的应用程序是否具有读取解密数据的权限。如果具有该读取解密数据的权限,再判断所述读取相关指令是否具有校验数据。当具有校验数据时,对所述读取相关指令所指向的数据进行解密。当所述读取相关指令不具有读取解密数据的权限时,不再执行后续的解密步骤。
在本公开中,对如何执行步骤S210不做特殊的限定,可选地,采用压缩方法获得压缩工具,并用该压缩工具(例如,jffs2、squashfs)对所述初始版本文件进行压缩,以生成所述二进制文件。
在相关技术中,使用标准的压缩工具对初始版本文件进行压缩。而相关技术中也存在对标准压缩工具压缩过的二进制文件进行破解的工具。例如,可以利用binwalk可以对压缩过的二进制文件进行内容提取。
但是,在本公开中,由于对初始版本的二进制文件加了密,因此,即便获取到了利用本公开第二个方面所提供的生成方法所生成的加密版本文件,利用binwalk等破解工具无法对所述加密版本文件进行破解,从而无法对版本文件的二进制文件内容进行提取。
在本公开中,对如何执行步骤S220也不做特殊的限定。例如,可以 选择某种加密算法、并配置相应的密钥,制作成加密工具,然后利用所述加密工具,以某个固定大小(如,512或2048)为单位进行加密,生成一个加密的版本二进制文件(即,所述加密版本文件)。
在本公开中,对所述预定加密算法不做特殊的限定。作为一种可选算法,所述预定加密算法可以为高级加密标准(AES,Advanced Encryption Standard)算法。AES算法的密钥较长,使用AES算法加密的安全性更高。
作为本公开的第三个方面,提供一种嵌入式系统的加密版本文件中数据的解密方法,其中,所述加密版本文件由本公开第二个方面所提供的生成方法所生成,如图4所示,所述解密方法包括:
在步骤S310中,判断接收到的读取相关指令是否携带有所述校验数据;
在步骤S320中,当接收到的读取相关指令携带有所述校验数据时,根据与所述预定加密算法对应的预定解密算法对所述接收到的读取相关指令所指向的数据进行解密。
当嵌入式系统的加密版文件运行时,系统驱动从硬件上读取上层应用所发出的读取相关指令,并通过步骤S310对所述读取相关指令进行判断。只有所述读取相关指令中携带有所述校验数据时,该读取相关指令才是合法的,这种情况下可以对数据进行解密。
当步骤S310中判定接收到的读取相关指令未携带所述校验数据,则不会所述读取相关指令所指向的数据进行解密。
当有人通过串口恶意登录单板(即,嵌入式系统)、或者通过Telnet等远程控制协议控制单板时,他/她所发出的读取相关指令并不携带所述校验数据,因此,并不能获得解密后的数据。
作为一种可选实施方式,在本公开中,当判定需要对数据进行解密时,则在嵌入式系统的驱动层以页为单位按照所述预定解密算法和密钥进行解密,不需要经过相关技术中涉及的诸如eCryptfs系统等加密系统,相当于裸操作嵌入式系统中的数据,不仅简化了算法,还可以提高运算速度。
由此可知,与设置了eCryptfs系统的嵌入式系统相比,利用本公开所 提供的解密方法对嵌入式系统的读写速率影响较小。
在本公开中,步骤S320是在驱动层进行的。
如上文中所述,在制作加密版本文件对应的初始版本文件时,有的应用程序配置了读取解密数据的权限、有的应用程序未配置读取解密数据的权限。这就导致在所述嵌入式系统运行时,有些进程需要用到数据解密,但有些进程并不需要用到数据解密。为了提高嵌入式系统的运行速度。可选地,如图5所示,所述解密方法还包括在步骤S310之前进行的:
在步骤S300中,判断接收到的读取相关指令是否具有获取解密数据的权限。
当接收到的读取相关指令具有获取解密数据的权限时,才继续执行判断接收到的读取相关指令是否携带有所述校验数据的步骤(即,执行步骤S310)。当接收到的读取相关指令不具有获取解密数据的权限时(例如,非root用户发出的指令不具有获取解密数据的权限),可以不执行步骤S310,从而可以避免不必要的运算,提高嵌入式系统的运行速度。
在相关技术中,使用eCryptfs对版本文件进行加密。这种情况中,只要配置了eCryptfs,在版本文件运行时就必须进行解密。与之相比,本公开实施例所提供的根据发送读取指令的应用程序的权限确定是否进行解密的解密方法更加灵活。
在本公开中,对数据进行解密的步骤可以在驱动层中进行。相应地,所述解密方法还可以包括在步骤S300之前进行的:
从存储装置上所述读取相关指令所指向的加密数据。
当步骤S300的判断结果为否,或者步骤S310的判断结果为否时,直接将读取到的加密数据返回给上层应用。
作为本公开的第四个方面,提供一种嵌入式系统的加密版本文件中的读取方法,其中,所述加密版本文件由本公开第二个方面所提供的生成方法所生成,如图6所示,所述读取方法包括:
在步骤S410中,接收读取相关指令后,执行本公开所提供的上述解 密方法;
在步骤S420中,当存在解密后的数据时,将解密后的数据返回给发送读取相关指令的上层应用。
在读取数据时,首先对读取相关指令进行判断,当读取相关指令符合相应的条件时,才对该读取相关指令所指向的数据进行解密,并将解密数据返回至发送所述读取相关指令的上层应用。当接收到的读取相关指令携带有所述校验数据,则表明该“读取相关指令”是由嵌入式系统所生成的,并非他人恶意登录所述嵌入式系统所生成的。因此,利用本公开实施例所提供的读取方法,可以避免嵌入式系统的加密版本文件中的数据被恶意窃取。
可选地,接收到的读取相关指令符合相应的条件包括以下两种情况:
第一种情况,接收到的读取相关指令携带有所述校验数据;
第二种情况,接收到的读取相关指令具有读取数据的权限,且接收到的读取相关指令携带有所述校验数据。
上文中描述了“在存在解密后的数据时”的所述读取方法所执行的具体步骤。
相应地,当接收到的读取相关指令不符合相应的条件时,不存在解密后的数据。
在本公开中,对不存在解密数据后执行何种步骤不做特殊的限定。例如,在不存在解密后的数据时,可以直接生成告警信息或者其他提示信息。或者,在不存在解密数据时,可以直接返回加密数据(步骤S430)。
在本公开中,可以根据接收到的读取相关指令的情况判断是否对数据进行解密。具体地,当接收到的读取相关指令不具有读取解密数据的权限时,不对数据进行解密;当接收到的读取相关指令具有读取解密数据的权限、但未携带校验数据时,也不对数据进行解密。
在本公开中,根据发出所述读取相关指令的应用程序来判断该读取相关指令是否具有读取解密数据的权限。当应用程序具有读取解密数据的权 限时,该应用程序发出的读取指令也具有读取解密数据的权限;当应用程序不具有读取解密数据的权限时,该应用程序发出的读取指令也不具有读取解密数据的权限。
下面结合一种具体的嵌入式系统对本公开实施例所提供的基础系统的预处理方法、加密版本的生成方法、加密版本文件中数据的解密方法、以及加密版本文件中数据的读取方法进行简单介绍。
如图7所示,所述嵌入式系统包括指令接收模块510、封装模块520、编译模块530、压缩模块540、加密模块550、存储装置560、权限确认模块570、校验模块580、数据返回模块590。
指令接收模块510接收到修改指令后,由封装模块520对基础系统的源码文件进行处理,以使得预定的读取相关指令携带有校验数据,并最终获得一个经过预处理的基础系统,并将该预处理后的基础系统安装在存储介质560上。
嵌入式系统的加密版本文件在所述经过预处理的基础系统的环境中运行。
下面介绍如何生成版本文件:
编译模块530编译制作初始版本文件,生成内核、应用程序、库文件、数据库文件、等各种系统文件;
压缩模块540利用压缩工具对初始版本文件进行压缩,获得二进制文件;
加密模块550利用对应预定加密算法、且配置有相应密钥的加密工具对所述二进制文件进行加密处理,以获得所述加密版本文件;
将加密版本文件存储在存储装置560上。
在所述加密版本文件运行时,嵌入式系统的驱动程序根据上层应用发出的读取相关指令从存储装置560上读取数据,包括以下操作:
权限确认模块570判断接收到的读取相关指令是否具有获取解密数据的权限;
当权限确认模块570的判断结果为是时,校验模块580判断接收到的读取相关指令是否携带有校验数据;
当校验模块580的判断结果为是时,对接收到的读取相关指令所指向的数据进行解密,并将解密后的数据返回给上层应用;
当权限确认模块570的判断结果为否时,直接返回未解密的数据;
当校验模块580的判断结果为否时,直接返回未解密的数据。
在本公开中,对所述嵌入式系统的具体类型不做特殊的限定,可选地,所述嵌入式系统可以为家庭网关、路由器、智能家居设备等中的至少一者。
作为本公开的第六个方面,提供一种电子设备,所述电子设备包括:
存储装置,其上存储有第一可执行程序、第二可执行程序、第三可执行程序和第四可执行程序中的至少一者;
至少一个处理器,当所述至少一个处理器调用所述第一可执行程序时,实现本公开第一个方面提供的预处理方法,当所述至少一个处理器调用所述第二可执行程序时,实现本公开第二个方面所提供的生成方法,当所述至少一个处理器调用所述第三可执行程序时,实现本公开第四个方面所提供的解密方法,所述至少一个处理器调用所述第四可执行程序时,实现本公开第五个方面所提供的读取方法。
所述电子设备为一种嵌入式系统。在本公开中,首先对电子设备的基础系统(例如,Linux系统)进行预处理,使得处理后的基础系统中,预定的读写相关指令携带有校验数据。
在对嵌入式系统的初始版本文件进行加密时,可以直接利用加密算法对压缩初始版本文件获得的二进制文件进行加密,以获得加密版本文件。所述加密版本文件的大小并未增加,从而可以节约嵌入式系统的存储空间。在加密版本文件运行时,只有接收到携带有校验数据的读取相关指令时,才执行对所述读取相关指令指向的数据进行解密的步骤。若接收到的读取相关指令未携带校验数据,则不对相关数据进行解密,从而可以确保版本文件中的数据安全。
可选地,所述电子设备还可以包括至少一个I/O接口,所述I/O接口连接在处理器与存储器之间,配置为实现处理器与存储器的信息交互。
其中,所述处理器为具有数据处理能力的器件,其包括但不限于中央处理器(CPU)等;存储装置为具有数据存储能力的器件,其包括但不限于随机存取存储器(RAM,更具体如SDRAM、DDR等)、只读存储器(ROM)、带电可擦可编程只读存储器(EEPROM)、闪存(FLASH);I/O接口(读写接口)连接在处理器与存储器间,能实现处理器与存储器的信息交互,其包括但不限于数据总线(Bus)等。
在一些实施例中,处理器、存储装置和I/O接口通过总线相互连接,进而与计算设备的其它组件连接。
作为本公开的第七个方面,提供一种计算机可读存储介质,其上存储有可执行程序,当所述可执行程序被调用时,能够实现以下方法中的任意一者:
本公开第一方面所提供的预处理方法;
本公开第二个方面所提供的生成方法;
本公开第三个方面所提供的解密方法;
本公开第四个方面所提供的读取方法。
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或 技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。
本文已经公开了示例实施例,并且虽然采用了具体术语,但它们仅用于并仅应当被解释为一般说明性含义,并且不用于限制的目的。在一些实例中,对本领域技术人员显而易见的是,除非另外明确指出,否则可单独使用与特定实施例相结合描述的特征、特性和/或元素,或可与其他实施例相结合描述的特征、特性和/或元件组合使用。因此,本领域技术人员将理解,在不脱离由所附的权利要求阐明的本发明的范围的情况下,可进行各种形式和细节上的改变。

Claims (13)

  1. 一种嵌入式系统的基础系统的预处理方法,包括:
    接收修改指令;以及
    根据所述修改指令对所述基础系统的源码文件中预定的读取相关指令的源码进行处理,以获得携带有校验数据的读取相关指令。
  2. 根据权利要求1所述的预处理方法,其中,所述根据所述修改指令对所述基础系统的源码文件中预定的读取相关指令的源码进行处理,以获得携带有校验数据的读取相关指令的步骤包括:对所述基础系统的源码文件进行修改,使得所述读取相关指令的源码文件携带有校验码。
  3. 根据权利要求1所述的预处理方法,其中,
    所述基础系统为Linux系统,并且其中,所述预定的读取相关指令包括cat指令和/或ls指令。
  4. 一种嵌入式系统的加密版本文件的生成方法,包括:
    对初始版本文件进行压缩,获得二进制文件;
    利用预定加密算法对所述二进制文件进行加密处理,以获得加密版本文件;以及
    将所述加密版本文件存储在存储装置上,其中,所述存储装置上安装有经过权利要求1至3中任意一项所述的预处理方法所预处理后的基础系统。
  5. 根据权利要求4所述的生成方法,其中,所述生成方法还包括在对初始版本文件进行压缩的步骤之前进行的:
    编译制作所述初始版本文件。
  6. 根据权利要求5所述的生成方法,其中,所述初始版本文件包括多个应用程序,在所述编译制作所述初始版本文件的步骤中,所述多个应用程序中的一部分应用程序配置有读取解密数据的权限,所述多个应用程序中的其余应用程序未配置有读取解密数据的权限。
  7. 一种嵌入式系统的加密版本文件中数据的解密方法,其中,所述加密版本文件由权利要求4至6中任意一项所提供的生成方法所生成,所述解密方法包括:
    判断接收到的读取相关指令是否携带有所述校验数据;
    当接收到的读取相关指令携带有所述校验数据时,根据与所述预定加密算法对应的预定解密算法对所述接收到的读取相关指令所指向的数据进行解密。
  8. 根据权利7所述的解密方法,其中,所述加密版本文件由权利要求6所述的生成方法所生成,所述解密方法还包括在判断接收到的读取相关指令是否携带有所述校验数据的步骤之前进行的:
    判断接收到的读取相关指令是否具有获取解密数据的权限;
    当接收到的读取相关指令具有获取解密数据的权限时,执行所述判断接收到的读取相关指令是否携带有所述校验数据的步骤。
  9. 根据权利要求8所述的解密方法,其中,所述解密方法还包括在判断接收到的读取相关指令是否具有获取解密数据的权限的步骤之前进行的:
    从存储装置上所述读取相关指令所指向的加密数据。
  10. 一种嵌入式系统的加密版本文件中数据的读取方法,其中,所述 加密版本文件由权利要求4至6中任意一项所提供的生成方法所生成,所述读取方法包括:
    接收读取相关指令后,执行权利要求7至9中任意一项所述的解密方法;
    当存在解密后的数据时,将解密后的数据返回给发送读取相关指令的上层应用。
  11. 根据权利要求10所述的读取方法,其中,当接收到的读取相关指令未携带所述校验数据时,将所述读取相关指令指向的加密数据返回给发送读取相关指令的上层应用。
  12. 一种电子设备,所述电子设备包括:
    存储装置,其上存储有第一可执行程序、第二可执行程序、第三可执行程序和第四可执行程序中的至少一者;
    至少一个处理器,当所述至少一个处理器调用所述第一可执行程序时,实现权利要求1至3中任意一项所述的预处理方法,当所述至少一个处理器调用所述第二可执行程序时,实现权利要求4至6中任意一项所述的生成方法,当所述至少一个处理器调用所述第三可执行程序时,实现权利要求7至9中任意一项所述的解密方法,所述至少一个处理器调用所述第四可执行程序时,实现权利要求10或11所述的读取方法。
  13. 一种计算机可读存储介质,其上存储有可执行程序,当所述可执行程序被调用时,能够实现以下方法中的任意一者:
    权利要求1至3中任意一项所述的预处理方法;
    权利要求4至6中任意一项所述的生成方法;
    权利要求7至9中任意一项所述的解密方法;
    权利要求10或11所述的读取方法。
PCT/CN2021/120296 2020-09-30 2021-09-24 预处理方法、处理方法、解密及读取方法、设备、介质 WO2022068693A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011066189.6 2020-09-30
CN202011066189.6A CN114329353A (zh) 2020-09-30 2020-09-30 预处理方法、处理方法、解密及读取方法、设备、介质

Publications (1)

Publication Number Publication Date
WO2022068693A1 true WO2022068693A1 (zh) 2022-04-07

Family

ID=80951118

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/120296 WO2022068693A1 (zh) 2020-09-30 2021-09-24 预处理方法、处理方法、解密及读取方法、设备、介质

Country Status (2)

Country Link
CN (1) CN114329353A (zh)
WO (1) WO2022068693A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104268483A (zh) * 2014-09-19 2015-01-07 福州瑞芯微电子有限公司 一种数据保护系统、装置及其方法
US9258122B1 (en) * 2014-01-13 2016-02-09 Symantec Corporation Systems and methods for securing data at third-party storage services
CN106375466A (zh) * 2016-09-14 2017-02-01 金蝶软件(中国)有限公司 一种数据文件传输方法及装置
CN106506493A (zh) * 2016-10-27 2017-03-15 摩登大道时尚电子商务有限公司 基于区块链平台的数据处理方法
CN111538995A (zh) * 2020-04-26 2020-08-14 支付宝(杭州)信息技术有限公司 一种数据存储方法、装置及电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9258122B1 (en) * 2014-01-13 2016-02-09 Symantec Corporation Systems and methods for securing data at third-party storage services
CN104268483A (zh) * 2014-09-19 2015-01-07 福州瑞芯微电子有限公司 一种数据保护系统、装置及其方法
CN106375466A (zh) * 2016-09-14 2017-02-01 金蝶软件(中国)有限公司 一种数据文件传输方法及装置
CN106506493A (zh) * 2016-10-27 2017-03-15 摩登大道时尚电子商务有限公司 基于区块链平台的数据处理方法
CN111538995A (zh) * 2020-04-26 2020-08-14 支付宝(杭州)信息技术有限公司 一种数据存储方法、装置及电子设备

Also Published As

Publication number Publication date
CN114329353A (zh) 2022-04-12

Similar Documents

Publication Publication Date Title
US7313828B2 (en) Method and apparatus for protecting software against unauthorized use
US9881348B2 (en) Activation system architecture
US7725614B2 (en) Portable mass storage device with virtual machine activation
JP6286034B2 (ja) プロセス認証とリソースパーミッション
JP6851970B2 (ja) 期待値を有するデータセキュリティ処理
US8844049B2 (en) Method for generating a cryptographic key for a protected digital data object on the basis of current components of a computer
US10650168B2 (en) Data processing device
US20070074038A1 (en) Method, apparatus and program storage device for providing a secure password manager
WO2020161662A1 (en) Authentication, authorization and audit of digital assets using the blockchain
JPH1185622A (ja) コア・データ機密事項の保護記憶
US20080126705A1 (en) Methods Used In A Portable Mass Storage Device With Virtual Machine Activation
US20120096280A1 (en) Secured storage device with two-stage symmetric-key algorithm
US11423154B2 (en) Endpoint authentication based on boot-time binding of multiple components
TW201530344A (zh) 應用程式存取保護方法及應用程式存取保護裝置
CN109445705A (zh) 固件认证方法及固态硬盘
CN111259364B (zh) 一种使用国密加密卡的方法、装置、设备及存储介质
US8499357B1 (en) Signing a library file to verify a callback function
JP2005293109A (ja) ソフトウェア実行管理装置、ソフトウェア実行管理方法、及び制御プログラム
WO2022068693A1 (zh) 预处理方法、处理方法、解密及读取方法、设备、介质
CN109150813B (zh) 一种设备的验证方法及装置
CN116821923A (zh) 一种用于保护计算机存储器数据安全的保护方法和装置
CN115391844A (zh) 安全密钥存储装置
CN114491682A (zh) 虚拟订户识别模块和虚拟智能卡
US10318766B2 (en) Method for the secured recording of data, corresponding device and program
CN117113437B (zh) 一种文件篡改检测方法、装置、计算机设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21874353

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 09.08.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21874353

Country of ref document: EP

Kind code of ref document: A1