WO2016101559A1 - 一种数据安全存取方法、装置和计算机存储介质 - Google Patents

一种数据安全存取方法、装置和计算机存储介质 Download PDF

Info

Publication number
WO2016101559A1
WO2016101559A1 PCT/CN2015/081962 CN2015081962W WO2016101559A1 WO 2016101559 A1 WO2016101559 A1 WO 2016101559A1 CN 2015081962 W CN2015081962 W CN 2015081962W WO 2016101559 A1 WO2016101559 A1 WO 2016101559A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
secure
data security
access request
operating system
Prior art date
Application number
PCT/CN2015/081962
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 WO2016101559A1 publication Critical patent/WO2016101559A1/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/60Protecting data

Definitions

  • the present invention relates to the field of secure storage of intelligent terminals, and more particularly to a data security access method, apparatus and computer storage medium.
  • terminals especially smart terminals, such as mobile phones, tablet computers, and smart watches
  • smart terminals are becoming more and more important to people's learning, work, and life.
  • some important data such as personal data, address books, private photos, confidential documents, etc., are usually also stored in the smart terminal. It is important to ensure the security of these data.
  • embodiments of the present invention are expected to provide a data security. Access methods, devices, and computer storage media.
  • An embodiment of the present invention provides a data security access method, where the method includes:
  • the non-secure operating system receives the first data security access request
  • the secure operating system performs legality authentication on the second data security access request, and when the legality authentication succeeds, performs a data security access operation according to the second data security access request.
  • the first data security access request when the first data security access request is a data secure storage request, the first data security access request includes the following data access information: a file name of the data to be stored, and a storage path thereof;
  • the first data security access request When the first data security access request is a data security extraction request, the first data security access request includes the following data access information: a file name of the data to be extracted and an extraction path thereof.
  • the method further includes: the non-secure access task reads the data to be stored from the non-secure memory into the non-secure memory. .
  • the non-secure operating system generates a second data security access request according to the first data security access request, including:
  • the non-secure access task in the non-secure operating system carries the following parameters 1 and 2 in the first data security access request to generate a second data security access request:
  • the parameter 1 includes a task identifier, an operation identifier, and data access information
  • the parameter 2 includes a verification code MAGIC_NS.
  • the legality certification includes: a first legality certification and a second legality authentication
  • the first legality authentication includes: determining, by the security monitoring task in the security operating system, whether the second data security access request carries the verification code MAGIC_NS, and if so, Determining that the first data security access request is successfully authenticated for the first time; if not, determining that the second data security access request fails for the first time;
  • the second legality authentication includes: the main control task in the security operating system determines whether each parameter in the parameter 1 is legal, and when each parameter in the parameter 1 is legal, the second legal Sexual authentication succeeded. Otherwise, the second legality certification failed.
  • the security operating system performs a data security access operation according to the second data security access request, including:
  • the secure access task When the second data security access request is a data secure storage request, the secure access task performs the following operations: copying the to-be-stored data that has been stored in the non-secure memory to the secure memory, and performing the stored data in the secure memory. Encryption operation, writing the encrypted data to be stored into the secure memory;
  • the secure access task performs the following operations: reading the data to be extracted from the secure memory to the secure memory; decrypting the data to be extracted in the secure memory; decrypting After the data to be extracted is copied to the non-secure memory.
  • the method further includes:
  • the secure access task in the secure operating system generates a data security access result and sends it to the security monitoring task in the secure operating system.
  • the data security access result includes: parameter three and parameter four; wherein parameter three includes data
  • the indication message that the security access is successful, the fourth parameter is the verification code MAGIC_SECURE;
  • the security monitoring task determines whether the value of the parameter 4 in the data security access result is MAGIC_SECURE, and if so, the security monitoring task successfully verifies the validity of the data security access result sent by the security access task, and the data security is successful.
  • the access process ends; if not, the security monitoring task fails to verify the validity of the data security access result sent by the secure access task, and the security monitoring task returns the result of the processing failure to the non-secure operating system, and the data security access process End.
  • An embodiment of the present invention provides a data security access device, where the device includes: a non-secure operating system and a security operating system;
  • the non-secure operating system is configured to receive a first data security access request, and send the second data security access request after generating the second data security access request according to the first data security access request Give a secure operating system;
  • the security operating system is configured to perform legality authentication on the second data security access request, and when the legality authentication is successful, perform a data security access operation according to the second data security access request.
  • the first data security access request when the first data security access request is a data secure storage request, the first data security access request includes the following data access information: a file name of the data to be stored, and a storage path thereof;
  • the first data security access request When the first data security access request is a data security extraction request, the first data security access request includes the following data access information: a file name of the data to be extracted and an extraction path thereof.
  • the non-secure operating system includes a non-secure access task module configured to read data to be stored from the non-secure memory into the non-secure memory.
  • the non-secure access task module is further configured to: carry the following parameter one and parameter two in the first data security access request to generate a second data security access request:
  • the parameter 1 includes a task identifier, an operation identifier, and data access information
  • the parameter 2 includes a verification code MAGIC_NS.
  • the legality certification includes: a first legality certification and a second legality authentication
  • the security operating system includes a security monitoring task module and a main control task module; wherein
  • the security monitoring task module is configured to receive a second data security access request sent by the non-secure operating system, and perform the first legality authentication on the data security access request in the following manner: the security monitoring task module determines the location Whether the second data security access request carries a test The certificate MAGIC_NS, if yes, determining that the first data security access request is successfully authenticated for the first time; if not, determining that the second data security access request fails for the first time;
  • the master task module is configured to perform a second legality authentication on the second data security access request by: the master task module determining each parameter in the parameter one of the second data security access request It is legal. When the parameters in the parameter one are valid, the second legality authentication succeeds. Otherwise, the second legality authentication fails.
  • the security operating system further includes a secure access task module configured to perform data security access operations in the following manner:
  • the secure access task module When the second data security access request is a data secure storage request, the secure access task module performs the following operations: copying the to-be-stored data that has been stored in the non-secure memory to the secure memory, and storing the data in the secure memory. Performing an encryption operation to write the encrypted data to be stored into the secure memory;
  • the secure access task module When the second data security access request is a data security extraction request, the secure access task module performs the following operations: reading the data to be extracted from the secure memory to the secure memory; and decrypting the data to be extracted in the secure memory; The decrypted data to be extracted is copied to non-secure memory.
  • the security access task module is further configured to generate a data security access result and send the data to the security monitoring task module, where the data security access result includes: parameter three and parameter four; wherein parameter three Including the indication message that the data security access is successful, the fourth parameter is the verification code MAGIC_SECURE;
  • the security monitoring task module is further configured to verify the validity of the data security access result by:
  • the security monitoring task module determines whether the value of the parameter 4 in the data security access result is MAGIC_SECURE, and if so, the security monitoring task module verifies the validity of the data security access result sent by the secure access task module; No, the security monitoring task module pair The validity verification of the data security access result sent by the secure access task module is unsuccessful.
  • the embodiment of the present invention further provides a computer storage medium, the storage medium comprising a set of computer executable instructions for performing the data security access method according to the embodiment of the present invention.
  • the non-secure operating system receives a first data security access request; and the non-secure operating system generates a first data security request according to the first data security request
  • the second data security access request is sent to the security operating system; the security operating system performs legality authentication on the second data security access request, and when the legality authentication is successful, according to The second data secure access request performs a data secure access operation.
  • users can quickly and easily store important security data while ensuring that user security data is not leaked or destroyed.
  • FIG. 1 is a flowchart of a data security access method according to an embodiment of the present invention
  • FIG. 2 is a basic structural diagram of a data security access device according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of a data security storage method according to an embodiment of the present invention.
  • FIG. 4 is a flowchart of a data security extraction method according to an embodiment of the present invention.
  • the non-secure operating system receives the first data security access request; after the non-secure operating system generates the second data security access request according to the first data security access request, the second data security is performed.
  • the access request is sent to the secure operating system; the secure operating system performs legality authentication on the second data security access request, and when the legality authentication is successful, performs a data security access operation according to the second data security access request. .
  • a first embodiment of the present invention provides a data security access method. As shown in FIG. 1, the method includes the following steps:
  • Step 101 The non-secure operating system receives the first data security access request.
  • Non-secure operating systems typically run in a non-secure state of the processor (for example, an Advanced RISCMachine processor that supports the Trust Zone security method) includes two states: a secure state and a non-secure state. ), non-secure operating systems can only access non-secure hardware (ie, non-secure memory, non-secure memory).
  • Non-secure memory refers to a memory that can be accessed only in the non-secure state of the processor, and is controlled by the memory controller; non-secure memory refers to memory that can be accessed in a safe state or a non-secure state of the processor. Implemented by the memory controller control.
  • the first data security access request sent by the user is received by the non-secure access task of the non-secure operating system.
  • the first data security access request sent by the user may generally include: a data secure storage request or a data security extraction request.
  • the non-secure access task needs to read the data to be stored from the non-secure memory into the non-secure memory for subsequent use by the secure operating system.
  • the first data security access request When the first data security access request is a data secure storage request, the first data security access request includes the following data access information: a file name of the data to be stored, and a storage path thereof;
  • the first data security access request When the first data security access request is a data security extraction request, the first data security access request includes the following data access information: a file name of the data to be extracted and an extraction path thereof (that is, the data to be extracted) Storage path).
  • Step 102 After the non-secure operating system generates the second data security access request according to the first data security access request, send the second data security access request to the secure operating system.
  • the second data security access request is generated by the non-secure access task in the non-secure operating system according to the first data security access request
  • the second data is A full access request is sent to the security monitoring task of the secure operating system.
  • the non-secure access task in the non-secure operating system generates the second data security access request according to the first data security access request, including:
  • the non-secure access task carries the following parameter one and parameter two in the first data security access request to generate a second data security access request:
  • the parameter 1 includes a task identifier, an operation identifier, and data access information, and is used when the security operating system performs a data security access operation in a subsequent operation;
  • the parameter one is generated according to the first data security access request, and the value of the task identifier is SECURE_SOURCE or UNSECURE_SOURCE, which is used to indicate the resource type, that is, the security type resource (SECURE_SOURCE) or the non-security type resource (UNSECURE_SOURCE).
  • SECURE_SOURCE security type resource
  • UNSECURE_SOURCE non-security type resource
  • the value of the task identifier in the generated parameter one is SECURE_SOURCE;
  • the value of the operation identifier is a secure storage (SECURE_SAVE), Or security extraction (SECURE_LOAD), used to indicate the operation performed on the data of the resource type identified by the task identifier;
  • the data access information in the parameter one is the data access in the first data security access request information;
  • the parameter 2 includes a verification code MAGIC_NS, which is used in the subsequent step to authenticate the legality of the second data security access request by the security operating system;
  • the verification code MAGIC_NS is a verification code agreed in advance by the non-secure operating system and the security operating system. .
  • Step 103 The security operating system performs legality authentication on the second data security access request, and when the legality authentication succeeds, performs a data security access operation according to the second data security access request.
  • the secure operating system runs in the secure state of the processor, accesses secure hardware (ie, secure memory, secure memory), and non-secure memory in non-secure hardware.
  • secure operating system is designed to handle high-security tasks. Such as storage and extraction of secure data, encryption and decryption of secure data, digital rights management, virtual private network (VPN, Virtual Private Network) Management, etc. It is a streamlined and stable operating system.
  • the security tasks running in the secure operating system are serially executed.
  • the scheduling policy is non-preemptive, which improves the security and stability of the system.
  • the secure memory refers to a memory that can be accessed only in the safe state of the processor, and is controlled by the memory controller.
  • the secure memory refers to a memory that can be accessed only in the safe state of the processor, and is controlled by the memory controller.
  • the legality authentication includes: a first legality authentication and a second legality authentication; wherein the first legality authentication is performed in a security monitoring task in the security operating system, and the second legality is performed.
  • Sex authentication is performed in the main control task of the security operating system.
  • the main control task In the security operating system, the main control task is in the ready or executed state.
  • the task creates the corresponding security task through the parameters transmitted by the security monitoring task, and completes the security required by the user. operating.
  • the security monitoring task is also responsible for communication and switching between the secure operating system and the non-secure operating system.
  • the non-secure operating system and the secure operating system can execute a special instruction, such as ARM Secure Monitoring Call (SMC).
  • SMC ARM Secure Monitoring Call
  • the security monitoring task that carries the second data security access request of parameter one and parameter two, performing the first legality authentication on the second data security access request, the first legality Certification, including:
  • the security monitoring task determines whether the second data security access request carries the verification code MAGIC_NS (ie, parameter 2), and if yes, determines that the second data security access request is successfully authenticated for the first time; And determining that the second data security access request fails for the first time.
  • MAGIC_NS verification code
  • the security monitoring task in the security operating system sends the parameter one in the second data security access request to the main control task in the security operating system;
  • Secondary legality authentication the second legality certification, including: The main control task authenticates the validity of each parameter in the parameter one (that is, determines whether each parameter in the parameter 1 includes the task identifier and the value of the operation identifier is a legal value, and determines the data access information. If the file name and the storage or extraction path are correct, the second legality authentication succeeds when the parameters in the parameter one are valid. Otherwise, the second legality authentication fails.
  • the main control task returns an error message to the non-secure operating system, and no further operations are performed;
  • the master task instructs the secure access task in the secure operating system to perform a data secure access operation according to the second data secure access request.
  • the secure access task performs a data secure access operation according to the second data security access request, including:
  • the secure access task When the second data security access request is a data secure storage request, the secure access task performs the following operations: copying the to-be-stored data that has been stored in the non-secure memory to the secure memory, and performing the stored data in the secure memory. Encryption operation, writing the encrypted data to be stored into the secure memory;
  • the secure access task performs the following operations: reading the data to be extracted from the secure memory to the secure memory; decrypting the data to be extracted in the secure memory; decrypting After the data to be extracted is copied to the non-secure memory.
  • the algorithm for encrypting the stored data and the algorithm for decrypting the extracted data can be selected according to actual needs, and are not limited herein.
  • the security access task generates a data security access result and sends the result to the security monitoring task, where the data security access result includes: parameter three and parameter four; wherein parameter three includes an indication message that the data security access is successful,
  • the fourth is the verification code MAGIC_SECURE, which is a verification code for the security access task and the security monitoring task to be used for security authentication tasks to perform security authentication for the security monitoring task.
  • the security monitoring task After receiving the data security access result, the security monitoring task determines whether the value of parameter four in the data security access result is MAGIC_SECURE, and if so, the security monitoring task securely accesses the data sent by the secure access task. The validity of the legality verification is successful. At this time, the security operating system context is saved, the non-secure system context is restored, and the data security access process ends; if not, the security monitoring task verifies the validity of the data security access result sent by the secure access task. Unsuccessful, at this time, the security monitoring task locally saves the error information, and returns the result of the processing failure to the non-secure operating system, and the data security access process ends.
  • the second embodiment of the present invention provides a data security access device, which is located on the terminal. As shown in FIG. 2, the device includes: a non-secure operating system 21 and a security operating system 22;
  • the non-secure operating system 21 is configured to receive a first data security access request; and after the second data security access request is generated according to the first data security access request, the second data security access request Sent to the secure operating system 22;
  • the security operating system 22 is configured to perform legality authentication on the second data security access request, and when the legality authentication is successful, perform a data security access operation according to the second data security access request.
  • the non-secure operating system 21 is running in a non-secure state of the processor (for example, an ARM processor supporting the TrustZone security method includes two states: a secure state and a non-secure state), and can only access non-secure hardware (ie, non-secure). Memory, non-secure memory).
  • a non-secure state of the processor for example, an ARM processor supporting the TrustZone security method includes two states: a secure state and a non-secure state
  • non-secure hardware ie, non-secure
  • Memory non-secure memory
  • the mainstream operating system Android running on the current smart terminal is used to meet the diverse application requirements of the user on the smart terminal. Since the system is open source and free, the user can browse the webpage and install various applications, so the system The security is not high and may be attacked by viruses or Trojans, resulting in the leakage or destruction of security data.
  • the secure operating system 22 operates in a secure state of the processor, can access secure hardware (ie, secure memory 26, secure memory 25), and can also access non-secure memory 23 in non-secure hardware. It is designed to handle high-security tasks such as storing and extracting secure data, encrypting and decrypting secure data, digital rights management, and VPN management. It is a streamlined and stable operating system.
  • the security tasks running in the secure operating system are serially executed.
  • the scheduling policy is non-preemptive, which improves the security and stability of the system.
  • the security operating system 22 includes a secure access task module 2201, a security monitoring task module 2202, and a master task module 2203;
  • the master task running in the master task module 2203 is in a ready or executed state.
  • the task creates a corresponding security task through the parameters transmitted by the security monitoring task in the security monitoring task module 2202, and completes the security operations required by the user.
  • Security applications require security certification to be installed into the system, ensuring external security for the secure operating system.
  • the secure access task module 2201 runs a secure side access task.
  • the security monitoring task module 2202 is also responsible for communication and switching between the secure operating system 22 and the non-secure operating system 21, and both the non-secure operating system 21 and the secure operating system 22 can execute by executing a special instruction, such as the ARM SMC instruction. Go to the security monitoring task. Parameters 1 and 2 of the SMC command are used to save the parameters passed by the non-secure operating system to the secure operating system.
  • the first data security access request When the first data security access request is a data secure storage request, the first data security access request includes the following data access information: a file name of the data to be stored, and a storage path thereof;
  • the first data security access request When the first data security access request is a data security extraction request, the first data security access request includes the following data access information: a file name of the data to be extracted and an extraction path thereof.
  • the apparatus may further include: a non-secure memory 23, a non-secure memory 24, a secure memory 25, and a secure memory 26 for storing data, including secure data and non-secure data, respectively; wherein the secure memory 26 and the non-secure memory 24 are both It is implemented by the memory controller; both the secure memory 25 and the non-secure memory 23 are controlled by the memory controller.
  • the non-secure operating system 21 includes a non-secure access task module 2101 configured to read data to be stored from the non-secure memory 24 into the non-secure memory 23.
  • the non-secure access task module 2101 is further configured to carry the following parameters one and two Generating a second data secure access request in the first data secure access request:
  • the parameter 1 includes a task identifier, an operation identifier, and data access information
  • the parameter 2 includes a verification code MAGIC_NS.
  • the legality certification includes: a first legality certification and a second legality certification.
  • the security monitoring task module 2202 in the security operating system 22 is configured to receive the second data security access request sent by the non-secure operating system 21, and perform the second data security access request for the first time in the following manner.
  • the legality authentication the security monitoring task module 2202 determines whether the second data security access request carries the verification code MAGIC_NS, and if yes, determines that the second data security access request is successfully authenticated for the first time; Determining that the first data security access request fails for the first time;
  • the master task module 2203 in the security operating system 22 is configured to perform the second legality authentication on the second data security access request by: the master task module 2203 determines the second data security access request. If the parameters of the parameter one are valid, the second legality authentication succeeds when the parameters of the parameter one are valid. Otherwise, the second legality authentication fails.
  • the secure access task module 2201 in the secure operating system 22 is configured to perform data secure access operations in the following manner:
  • the secure access task module 2201 performs the following operations: copying the data to be stored that has been stored in the non-secure memory 23 to the secure memory 25, in the secure memory 25
  • the storage data is encrypted, and the encrypted data to be stored is written into the secure memory 26;
  • the secure access task module 2201 performs the following operations: reading the data to be extracted from the secure memory 26 to the secure memory 25; and performing the extracted data in the secure memory 25 Decryption operation; copying the decrypted data to be extracted to the non-secure memory 23.
  • the non-secure operating system 21 also includes a non-secure side file system 2102 and a non-secure side Layer driver 2103 configured to implement data access operations in the non-secure operating system 21;
  • the secure operating system 22 also includes a secure side file system 2204 and a secure side underlay driver 2205 configured to implement data access operations in the secure operating system 22.
  • the secure access task module 2201 is further configured to generate a data security access result and send the result to the security monitoring task module 2202, where the data security access result includes: parameter three and parameter four; wherein the parameter three includes data The indication message that the security access is successful, the fourth parameter is the verification code MAGIC_SECURE;
  • the security monitoring task module 2202 is further configured to verify the validity of the data security access result by:
  • the security monitoring task module 2202 determines whether the value of the parameter 4 in the data security access result is MAGIC_SECURE, and if so, the security monitoring task module 2202 verifies the validity of the data security access result sent by the secure access task module 2201. If not, the security monitoring task module 2202 fails to verify the validity of the data security access result sent by the secure access task module 2201.
  • the data security storage method provided by the embodiment of the present invention in actual implementation, as a whole, as shown in FIG. 3, mainly includes the following steps:
  • Step 301 The non-secure side data storage task is started.
  • Step 302 Select data to be stored
  • Step 303 Read data to be stored from non-secure memory to non-secure memory
  • Step 304 Prepare storage task related parameters and switch to a secure operating system.
  • Step 305 The security side determines whether the storage task related parameter is legal. If it is legal, go to step 307 to continue execution; if it is not legal, go to step 306 to continue execution;
  • Step 306 Return an error message to the non-secure side, and jump out of the current process
  • Step 307 The security side storage task is started.
  • Step 308 Instruct the user to input a password, and receive a password sent by the user;
  • Step 309 Determine whether the password is legal; when it is not legal, go to step 310; when it is legal, go to step 311;
  • Step 310 Return an error message to the non-secure side, and jump out of the current process
  • Step 311 Perform a data security storage process.
  • the process includes copying files in non-secure memory to secure memory, encrypting files in secure memory, writing files to secure storage, storing successfully, and returning to an unsecure system.
  • the data security extraction method provided by the embodiment of the present invention in actual implementation, as a whole, as shown in FIG. 4, mainly includes the following steps:
  • Step 401 The non-secure side data extraction task is started.
  • Step 402 Prepare data extraction task related parameters and switch to a secure operating system
  • Step 403 Determine whether the data extraction task related parameter is legal; if it is not legal, go to step 404 to continue execution; if it is legal, go to step 405 to continue execution;
  • Step 404 Return an error message to the non-secure side, and jump out of the current process
  • Step 405 The security side security data extraction task is started.
  • Step 406 Instruct the user to input a password; and receive a password sent by the user;
  • Step 407 Determine whether the password is legal; when it is not legal, go to step 408; when it is legal, go to step 409;
  • Step 408 Return an error message to the non-secure side, and jump out of the current process
  • Step 409 Perform a data security extraction process.
  • the data security extraction process includes: reading files from secure storage to secure memory, decrypting files in secure memory, copying files in secure memory to non-secure memory, preparing parameters and returning to non-secure operating system, non-secure Side storage tasks start, select storage paths, write files from non-secure memory to non-secure memory;
  • the data security storage process is taken as an example to securely access the data provided by the embodiment of the present invention.
  • the method is described in detail below;
  • This example includes the following steps:
  • Step 501 The processor starts a secure operating system and a non-secure operating system.
  • the processor When the terminal is powered on, the processor is in a safe state, firstly starts the security operating system; the security operating system is initialized, the main control task is created and executed; the non-secure operating system context is initialized, and the security monitoring task is switched; the security monitoring saves the security operating system context. , restore the non-secure operating system context, start the non-secure operating system; after the non-secure operating system is initialized, the system runs normally;
  • Step 502 The user initiates a secure storage request.
  • the user opens the secure storage application in the terminal, selects the file to be stored, and selects the storage path, and clicks the corresponding button for initiating the storage request;
  • Step 503 The non-secure access task in the non-secure memory responds to the user's storage request
  • the non-secure access task obtains the storage information from the storage request initiated by the user: the file name and storage path of the file to be stored;
  • Step 504 If the non-secure access task is a storage request, the file to be stored in the non-secure memory is read into the non-secure memory, and then, the non-secure access task prepares the SMC command parameter, and switches to the security monitoring;
  • the address of the command (including the task identifier: SECURE_SOURCE, operation identifier: SECURE_SAVE, file parameter) is stored in parameter 1 of the SMC instruction, and is used in the subsequent steps, when the security access task in the secure operating system performs the data access operation;
  • the verification code MAGIC_NS is stored in parameter 2 of the SMC instruction for security monitoring to verify the validity of the SMC instruction; after that, switching to the security monitoring task;
  • Step 505 The security monitoring task verifies the legality of the parameters in the SMC instruction.
  • the security monitoring task first checks whether the value of parameter 2 in the SMC command is MAGIC_NS. If not, the SMC parameter verification fails, the error information is saved to the CMD, and the result of the non-secure operating system processing failure is returned. This step ends; if yes, SMC The parameter verification is successful. The value of parameter 1 of the SMC instruction is saved to the specified global variable para_cmd and sent to the security operating system. The master task, save the non-security context, restore the security context, this step ends;
  • Step 506 The main control task obtains the para_cmd parameter transmitted by the security monitoring task, and verifies the legality of the parameter.
  • the validity of the para_cmd parameter is verified by the master task.
  • the value of the parameter is determined by the validity of the task identifier, the operation identifier, and the file parameter. That is, whether the para_cmd parameter is legal. If the parameters are legal, according to the CMD.
  • the task identifier SECURE_SOURCE creates a secure access task. This step ends; otherwise, the para_cmd parameter verification fails, the error information is saved to the CMD, the security monitoring is switched, and the result of the non-secure operating system processing failure is returned. This step ends;
  • Step 507 The security access task runs
  • Step 508 Perform identity authentication on the user.
  • the security access task encrypts the initial password set by the user and saves it locally, which is used to authenticate the user when the user initiates data storage or extraction request next time.
  • Step 509 The user selects a storage path of the file to be stored, and clicks to confirm;
  • Step 510 The secure access task stores the encrypted file to be stored in the secure memory from the non-secure memory.
  • the secure access task copies the files to be stored in the non-secure memory to the secure memory, encrypts the file to be stored in the secure memory, and writes the encrypted file to the secure memory;
  • Step 511 The secure access task saves the data security storage result to the SMC instruction, sets the SMC parameter, and switches to the security monitoring.
  • the data security storage result includes parameter 3 and parameter 4:
  • parameter 3 includes information indicating whether the data security storage task is successful, and parameter 4 includes a verification code MAGIC_SECURE;
  • Step 512 The security monitoring verifies the validity of the parameters in the SMC instruction.
  • Step 513 The non-secure access task processes the returned parameters, and the security storage process for the file to be stored is completed;
  • the non-secure access task can also switch to other applications to perform other processing.
  • the non-secure operating system 21 and the secure operating system 22 may be processed by a central processing unit (CPU, Central Processing Unit), a microprocessor (MPU, Micro Processing Unit) in the terminal, and digital signal processing. (DSP, Digital Signal Processor) or Programmable Array (FPGA).
  • CPU Central Processing Unit
  • MPU Micro Processing Unit
  • DSP Digital Signal Processor
  • FPGA Programmable Array
  • the embodiment of the present invention further provides a computer storage medium, the storage medium comprising a set of computer executable instructions for performing the data security access method according to the embodiment of the present invention.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention may be employed in one or more of its A computer program product embodied on a computer usable storage medium (including but not limited to disk storage and optical storage, etc.) containing computer usable program code.
  • a computer usable storage medium including but not limited to disk storage and optical storage, etc.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Abstract

一种数据安全存取方法、数据安全存取装置和计算机存储介质。其中,该方法包括:非安全操作系统接收第一数据安全存取请求(101);非安全操作系统根据所述第一数据安全存取请求生成第二数据安全存取请求之后,将所述第二数据安全存取请求发送给安全操作系统(102);安全操作系统对所述第二数据安全存取请求进行合法性认证,当合法性认证成功时,根据所述第二数据安全存取请求执行数据安全存取操作(103)。

Description

一种数据安全存取方法、装置和计算机存储介质 技术领域
本发明涉及智能终端安全存储领域,更具体的说,是一种数据安全存取方法、装置和计算机存储介质。
背景技术
随着现代通信技术的飞速发展,终端,尤其是智能终端,如手机、平板电脑、智能手表等越来越深入到人们的学习、工作和生活中并发挥着至关重要的作用。随着用户对智能终端的依赖,一些重要的数据,例如,个人资料、通讯录、私密照片、机密文件等通常也被存储在智能终端中。确保这些数据的安全十分重要。
市场上主流的智能终端操作系统有三种:安卓(Android)操作系统、苹果操作系统(iOS,iPhone Operating System)、Windows操作系统。但是,每一种操作系统都不能完全保证终端的安全性,尤其是Android操作系统终端,由于Android操作系统自身的开放性,使得Android操作系统终端很有可能感染病毒或者木马,从而导致重要信息的泄露或者破坏。再者,由于智能终端的便捷性,用户很有可能丢失智能终端,有价值的数据也会随之丢失,比如个人隐私信息或者商业机密信息等。若被他人得到,这些信息可能被泄漏,这样会带来严重的损失。
然而,针对智能终端的本地数据安全存取,特别是用户能够快速、便捷的存储、提取重要的安全数据,同时保证用户安全数据不会被泄露或破坏,目前还没有可靠的方案来实现。
发明内容
为了解决现有存在的技术问题,本发明实施例期望提供一种数据安全 存取方法、装置和计算机存储介质。
本发明实施例提供了一种数据安全存取方法,所述方法包括:
非安全操作系统接收第一数据安全存取请求;
非安全操作系统根据所述第一数据安全存取请求生成第二数据安全存取请求之后,将所述第二数据安全存取请求发送给安全操作系统;
安全操作系统对所述第二数据安全存取请求进行合法性认证,当合法性认证成功时,根据所述第二数据安全存取请求执行数据安全存取操作。
上述方案中,当所述第一数据安全存取请求为数据安全存储请求时,所述第一数据安全存取请求中包括以下数据存取信息:待存储数据的文件名、及其存储路径;
当所述第一数据安全存取请求为数据安全提取请求时,所述第一数据安全存取请求中包括以下数据存取信息:待提取数据的文件名及其提取路径。
上述方案中,当所述第一数据安全存取请求为数据安全存储请求时,所述方法还包括:所述非安全存取任务将待存储的数据从非安全存储器中读到非安全内存中。
上述方案中,所述非安全操作系统根据所述第一数据安全存取请求生成第二数据安全存取请求,包括:
非安全操作系统中的非安全存取任务将以下参数一和参数二携带在所述第一数据安全存取请求中,生成第二数据安全存取请求:
其中,参数一包括任务标识、操作标识、数据存取信息,参数二包括验证码MAGIC_NS。
上述方案中,所述合法性认证包括:第一次合法性认证和第二次合法性认证;
其中,所述第一次合法性认证,包括:安全操作系统中的安全监控任务判断所述第二数据安全存取请求中是否携带验证码MAGIC_NS,如果是, 则确定所述第二数据安全存取请求第一次合法性认证成功;如果否,则确定所述第二数据安全存取请求第一次合法性失败;
所述第二次合法性认证包括:所述安全操作系统中的主控任务判断所述参数一中的各个参数是否合法,当所述参数一中各个参数均合法时,第二次合法性认证成功,否则,第二次合法性认证失败。
上述方案中,所述安全操作系统根据所述第二数据安全存取请求执行数据安全存取操作,包括:
当所述第二数据安全存取请求为数据安全存储请求时,安全存取任务执行以下操作:将已经存储在非安全内存中的待存储数据复制到安全内存,在安全内存中对待存储数据进行加密操作,将加密后的待存储数据写入安全存储器;
当所述第二数据安全存取请求为数据安全提取请求时,安全存取任务执行以下操作:将待提取数据从安全存储器读到安全内存;在安全内存中对待提取数据进行解密操作;将解密后的待提取数据复制到非安全内存。
上述方案中,所述安全操作系统根据所述第二数据安全存取请求执行数据安全存取操作之后,所述方法还包括:
安全操作系统中的安全存取任务生成数据安全存取结果并发送给安全操作系统中的安全监控任务,所述数据安全存取结果包括:参数三和参数四;其中参数三包括数据安全存取是否成功的指示消息,参数四为验证码MAGIC_SECURE;
所述安全监控任务判断数据安全存取结果中的参数四的值是否是MAGIC_SECURE,如果是,则安全监控任务对安全存取任务所发送的数据安全存取结果的合法性验证成功,数据安全存取流程结束;如果否,安全监控任务对安全存取任务所发送的数据安全存取结果的合法性验证不成功,安全监控任务向非安全操作系统返回处理失败的结果,数据安全存取流程结束。
本发明实施例提供了一种数据安全存取装置,所述装置包括:非安全操作系统和安全操作系统;其中,
所述非安全操作系统,配置为接收第一数据安全存取请求;并根据所述第一数据安全存取请求生成第二数据安全存取请求之后,将所述第二数据安全存取请求发送给安全操作系统;
所述安全操作系统,配置为对所述第二数据安全存取请求进行合法性认证,当合法性认证成功时,根据所述第二数据安全存取请求执行数据安全存取操作。
上述方案中,当所述第一数据安全存取请求为数据安全存储请求时,所述第一数据安全存取请求中包括以下数据存取信息:待存储数据的文件名、及其存储路径;
当所述第一数据安全存取请求为数据安全提取请求时,所述第一数据安全存取请求中包括以下数据存取信息:待提取数据的文件名及其提取路径。
上述方案中,所述非安全操作系统包括非安全存取任务模块,配置为将待存储的数据从非安全存储器中读到非安全内存中。
上述方案中,所述非安全存取任务模块,还配置为将以下参数一和参数二携带在所述第一数据安全存取请求中,生成第二数据安全存取请求:
其中,参数一包括任务标识、操作标识、数据存取信息,参数二包括验证码MAGIC_NS。
上述方案中,所述合法性认证包括:第一次合法性认证和第二次合法性认证;
所述安全操作系统,包括安全监控任务模块和主控任务模块;其中,
所述安全监控任务模块,配置为接收非安全操作系统发送的第二数据安全存取请求,并通过以下方式对所述数据安全存取请求进行第一次合法性认证:安全监控任务模块判断所述第二数据安全存取请求中是否携带验 证码MAGIC_NS,如果是,则确定所述第二数据安全存取请求第一次合法性认证成功;如果否,则确定所述第二数据安全存取请求第一次合法性失败;
所述主控任务模块,配置为通过以下方式对所述第二数据安全存取请求进行第二次合法性认证:主控任务模块判断第二数据安全存取请求中参数一中的各个参数是否合法,当所述参数一中各个参数均合法时,第二次合法性认证成功,否则,第二次合法性认证失败。
上述方案中,安全操作系统还包括安全存取任务模块,配置为通过以下方式执行数据安全存取操作:
当所述第二数据安全存取请求为数据安全存储请求时,安全存取任务模块执行以下操作:将已经存储在非安全内存中的待存储数据复制到安全内存,在安全内存中对待存储数据进行加密操作,将加密后的待存储数据写入安全存储器;
当所述第二数据安全存取请求为数据安全提取请求时,安全存取任务模块执行以下操作:将待提取数据从安全存储器读到安全内存;在安全内存中对待提取数据进行解密操作;将解密后的待提取数据复制到非安全内存。
上述方案中,所述安全存取任务模块,还配置为生成数据安全存取结果并发送给安全监控任务模块,所述数据安全存取结果包括:参数三和参数四;其中参数三包括数据安全存取是否成功的指示消息,参数四为验证码MAGIC_SECURE;
所述安全监控任务模块,还配置为通过以下方式对数据安全存取结果的合法性进行验证:
安全监控任务模块判断数据安全存取结果中的参数四的值是否是MAGIC_SECURE,如果是,则安全监控任务模块对安全存取任务模块所发送的数据安全存取结果的合法性验证成功;如果否,安全监控任务模块对 安全存取任务模块所发送的数据安全存取结果的合法性验证不成功。
本发明实施例还提供了一种计算机存储介质,所述存储介质包括一组计算机可执行指令,所述指令用于执行本发明实施例所述的数据安全存取方法。
本发明实施例所提供的一种数据安全存取方法、装置和计算机存储介质,非安全操作系统接收第一数据安全存取请求;非安全操作系统根据所述第一数据安全存取请求生成第二数据安全存取请求之后,将所述第二数据安全存取请求发送给安全操作系统;安全操作系统对所述第二数据安全存取请求进行合法性认证,当合法性认证成功时,根据所述第二数据安全存取请求执行数据安全存取操作。如此,用户能够快速、便捷的存储活提取重要的安全数据,同时保证用户安全数据不会被泄露或破坏。
附图说明
图1为本发明实施例提供的数据安全存取方法流程图;
图2为本发明实施例提供的数据安全存取装置的基本结构图;
图3为本发明实施例提供的数据安全存储方法流程图;
图4为本发明实施例提供的数据安全提取方法流程图。
具体实施方式
本发明实施例中,非安全操作系统接收第一数据安全存取请求;非安全操作系统根据所述第一数据安全存取请求生成第二数据安全存取请求之后,将所述第二数据安全存取请求发送给安全操作系统;安全操作系统对所述第二数据安全存取请求进行合法性认证,当合法性认证成功时,根据所述第二数据安全存取请求执行数据安全存取操作。
下面通过附图及具体实施例对本发明做进一步的详细说明。
实施例一
本发明实施例一提供了一种数据安全存取方法,如图1所示,该方法包括以下步骤:
步骤101:非安全操作系统接收第一数据安全存取请求。
非安全操作系统通常运行在处理器的非安全状态(例如,支持信任区域(Trust Zone)安全方法的进阶精简指令集(ARM,Advanced RISCMachine)处理器包括两种状态:安全状态和非安全状态),非安全操作系统只能访问非安全硬件(即,非安全存储器、非安全内存)。非安全存储器是指,只在处理器的非安全状态下才能访问的存储器,由存储器控制器控制实现;非安全内存是指,在处理器的安全状态或非安全状态下都能访问的内存,由内存控制器控制实现。
在该步骤中,由非安全操作系统的非安全存取任务接收用户发送的第一数据安全存取请求。
用户发送的第一数据安全存取请求通常可以包括:数据安全存储请求或数据安全提取请求。
当所述第一数据安全存取请求为数据安全存储请求时,所述非安全存取任务需要将待存储的数据从非安全存储器中读到非安全内存中,用于后续安全操作系统使用。
当第一数据安全存取请求为数据安全存储请求时,所述第一数据安全存取请求中包括以下数据存取信息:待存储数据的文件名、及其存储路径;
当第一数据安全存取请求为数据安全提取请求时,所述第一数据安全存取请求中包括以下数据存取信息:待提取数据的文件名及其提取路径(也即,待提取数据的存储路径)。
步骤102:非安全操作系统根据所述第一数据安全存取请求生成第二数据安全存取请求之后,将所述第二数据安全存取请求发送给安全操作系统。
在这一步骤中,是由非安全操作系统中的非安全存取任务根据所述第一数据安全存取请求生成第二数据安全存取请求之后,将所述第二数据安 全存取请求发送给安全操作系统的安全监控任务。
非安全操作系统中的非安全存取任务根据所述第一数据安全存取请求生成第二数据安全存取请求,包括:
非安全存取任务将以下参数一和参数二携带在所述第一数据安全存取请求中,生成第二数据安全存取请求:
其中,参数一包括任务标识、操作标识及数据存取信息,用于后续操作中安全操作系统执行数据安全存取操作时使用;
这里的参数一是根据第一数据安全存取请求生成的,所述任务标识的取值为SECURE_SOURCE或UNSECURE_SOURCE,用于指示资源类型,即安全类型资源(SECURE_SOURCE)、或非安全类型资源(UNSECURE_SOURCE);由于本发明实施例涉及的是一种数据安全存取方法,因此,所生成的参数一中任务标识的取值均为SECURE_SOURCE;所述操作标识的取值为安全存储(SECURE_SAVE)、或安全提取(SECURE_LOAD),用于指示对任务标识所标识的资源类型的数据所进行的操作;所述参数一中的数据存取信息即为第一数据安全存取请求中的数据存取信息;
参数二包括验证码MAGIC_NS,用于后续步骤中安全操作系统对第二数据安全存取请求的合法性进行认证;所述验证码MAGIC_NS是由非安全操作系统与安全操作系统事先约定的验证码。
步骤103:安全操作系统对所述第二数据安全存取请求进行合法性认证,当合法性认证成功时,根据所述第二数据安全存取请求执行数据安全存取操作。
安全操作系统运行在处理器的安全状态,可以访问安全硬件(即,安全存储器、安全内存),也可以访问非安全硬件中的非安全内存,安全操作系统专门用来处理安全级别高的任务,如存储与提取安全数据、安全数据的加解密、数字版权管理、虚拟专用网络(VPN,Virtual Private Network) 管理等。它是精简、稳定的操作系统,安全操作系统中运行的安全任务是串行执行的,调度策略是非抢占式的,提高了系统内部的安全性和稳定性。安全存储器是指,只在处理器的安全状态下才能访问的存储器,由存储器控制器控制实现;安全内存是指,只在处理器的安全状态下才能访问的内存,由内存控制器控制实现。
这一步骤中,所述合法性认证包括:第一次合法性认证和第二次合法性认证;其中,第一次合法性认证在安全操作系统中的安全监控任务中执行,第二次合法性认证在安全操作系统中的主控任务中执行;其中,安全操作系统中主控任务处于就绪或执行状态,该任务通过安全监控任务传递的参数,创建相应的安全任务,完成用户需要的安全操作。安全监控任务还负责安全操作系统和非安全操作系统之间的通信和切换,非安全操作系统和安全操作系统都可以通过执行一条特殊的指令,如ARM的安全监控调用(SMC,Secure Monitor Call)指令跳转到安全监控任务,所述SMC指令的参数一和参数二用来保存非安全操作系统向安全操作系统传递的参数。
接收到所述携带了参数一和参数二的第二数据安全存取请求的安全监控任务对所述第二数据安全存取请求进行第一次合法性认证,所述第一次合法性认证,包括:
安全监控任务判断所述第二数据安全存取请求中是否携带验证码MAGIC_NS(即参数二),如果是,则确定所述第二数据安全存取请求第一次合法性认证成功;如果否,则确定所述第二数据安全存取请求第一次合法性失败。
当第一次合法性认证失败,向非安全操作系统返回错误信息,不再执行后续操作;
当第一次合法性认证成功时,所述安全操作系统中的安全监控任务将所述第二数据安全存取请求中的参数一发送给安全操作系统中的主控任务;之后,进行第二次合法性认证,所述第二次合法性认证,包括:所述 主控任务对所述参数一中的各个参数的合法性进行认证(也即,判断参数一中各个参数包括任务标识、操作标识的取值是否为合法取值,判断数据存取信息中的文件名及存储或提取路径是否正确),当所述参数一中各个参数均合法时,第二次合法性认证成功,否则,第二次合法性认证失败。
当第二次合法性认证失败时,主控任务向非安全操作系统返回错误信息,不再进行后续操作;
当第二次合法性认证成功时,主控任务指示安全操作系统中的安全存取任务根据所述第二数据安全存取请求执行数据安全存取操作。
安全存取任务根据所述第二数据安全存取请求执行数据安全存取操作,包括:
当所述第二数据安全存取请求为数据安全存储请求时,安全存取任务执行以下操作:将已经存储在非安全内存中的待存储数据复制到安全内存,在安全内存中对待存储数据进行加密操作,将加密后的待存储数据写入安全存储器;
当所述第二数据安全存取请求为数据安全提取请求时,安全存取任务执行以下操作:将待提取数据从安全存储器读到安全内存;在安全内存中对待提取数据进行解密操作;将解密后的待提取数据复制到非安全内存。
对待存储数据进行加密的算法以及对待提取数据进行解密的算法可以根据实际需要进行选择,这里不作限制。
当数据安全存储或数据安全提取操作执行完毕后,还需要进行以下操作,确保数据安全存取流程的安全性:
安全存取任务生成数据安全存取结果并发送给安全监控任务,所述数据安全存取结果包括:参数三和参数四;其中参数三包括数据安全存取是否成功的指示消息,参数四为验证码MAGIC_SECURE,该验证码是安全存取任务与安全监控任务事先约定的用于安全存取任务向安全监控任务进行合法性认证的验证码。
接收到数据安全存取结果之后,安全监控任务判断数据安全存取结果中的参数四的值是否是MAGIC_SECURE,如果是,则安全监控任务对安全存取任务所发送的数据安全存取结果的合法性验证成功,此时,保存安全操作系统上下文,恢复非安全系统上下文,数据安全存取流程结束;如果否,安全监控任务对安全存取任务所发送的数据安全存取结果的合法性验证不成功,此时,安全监控任务本地保存错误信息,并向非安全操作系统返回处理失败的结果,数据安全存取流程结束。
实施例二
本发明实施例二提供了一种数据安全存取装置,位于终端上,如图2所示,所述装置包括:非安全操作系统21和安全操作系统22;其中,
所述非安全操作系统21,配置为接收第一数据安全存取请求;并根据所述第一数据安全存取请求生成第二数据安全存取请求之后,将所述第二数据安全存取请求发送给安全操作系统22;
所述安全操作系统22,配置为对所述第二数据安全存取请求进行合法性认证,当合法性认证成功时,根据所述第二数据安全存取请求执行数据安全存取操作。
其中,非安全操作系统21运行在处理器的非安全状态(例如,支持TrustZone安全方法的ARM处理器包括两种状态:安全状态和非安全状态),只能访问非安全硬件(即,非安全存储器、非安全内存)。例如:运行在当前智能终端上的主流操作系统Android,它用来满足用户在智能终端上多样的应用需求,由于该系统是开源、免费的,用户可以浏览网页、安装各种应用程序,所以系统的安全性不高,可能受到病毒或木马的攻击,导致安全数据的泄露或破坏。
安全操作系统22运行在处理器的安全状态,可以访问安全硬件(即,安全存储器26、安全内存25),也可以访问非安全硬件中的非安全内存23, 专门用来处理安全级别高的任务,如存储与提取安全数据、安全数据的加解密、数字版权管理、VPN管理等。它是精简、稳定的操作系统,安全操作系统中运行的安全任务是串行执行的,调度策略是非抢占式的,提高了系统内部的安全性和稳定性。
安全操作系统22包括安全存取任务模块2201、安全监控任务模块2202和主控任务模块2203;其中,
主控任务模块2203中运行的主控任务处于就绪或执行状态,该任务通过安全监控任务模块2202中安全监控任务传递的参数,创建相应的安全任务,完成用户需要的安全操作。安全应用需经过安全认证才能安装到该系统中,保证了安全操作系统的外部安全性。安全存取任务模块2201中运行着安全侧存取任务。安全监控任务模块2202,还负责安全操作系统22和非安全操作系统21之间的通信和切换,非安全操作系统21和安全操作系统22都可以通过执行一条特殊的指令,如ARM的SMC指令跳转到安全监控任务,SMC指令的参数一和参数二用来保存非安全操作系统向安全操作系统传递的参数。
当第一数据安全存取请求为数据安全存储请求时,所述第一数据安全存取请求中包括以下数据存取信息:待存储数据的文件名、及其存储路径;
当第一数据安全存取请求为数据安全提取请求时,所述第一数据安全存取请求中包括以下数据存取信息:待提取数据的文件名及其提取路径。
所述装置还可包括:非安全内存23、非安全存储器24、安全内存25及安全存储器26,分别用于存储数据,包括安全数据和非安全数据;其中,安全存储器26和非安全存储器24均由存储器控制器控制实现;安全内存25和非安全内存23均由内存控制器控制实现。
所述非安全操作系统21包括非安全存取任务模块2101,配置为将待存储的数据从非安全存储器24中读到非安全内存23中。
所述非安全存取任务模块2101,还配置为将以下参数一和参数二携带 在所述第一数据安全存取请求中,生成第二数据安全存取请求:
其中,参数一包括任务标识、操作标识、数据存取信息,参数二包括验证码MAGIC_NS。
所述合法性认证包括:第一次合法性认证和第二次合法性认证。
所述安全操作系统22中的安全监控任务模块2202,配置为接收非安全操作系统21发送的第二数据安全存取请求,并通过以下方式对所述第二数据安全存取请求进行第一次合法性认证:安全监控任务模块2202判断所述第二数据安全存取请求中是否携带验证码MAGIC_NS,如果是,则确定所述第二数据安全存取请求第一次合法性认证成功;如果否,则确定所述第二数据安全存取请求第一次合法性失败;
所述安全操作系统22中的主控任务模块2203,配置为通过以下方式对所述第二数据安全存取请求进行第二次合法性认证:主控任务模块2203判断第二数据安全存取请求中参数一的各个参数是否合法,当所述参数一中各个参数均合法时,第二次合法性认证成功,否则,第二次合法性认证失败。
安全操作系统22中的安全存取任务模块2201,配置为通过以下方式执行数据安全存取操作:
当所述第二数据安全存取请求为数据安全存储请求时,安全存取任务模块2201执行以下操作:将已经存储在非安全内存23中的待存储数据复制到安全内存25,在安全内存25中对待存储数据进行加密操作,将加密后的待存储数据写入安全存储器26;
当所述第二数据安全存取请求为数据安全提取请求时,安全存取任务模块2201执行以下操作:将待提取数据从安全存储器26读到安全内存25;在安全内存25中对待提取数据进行解密操作;将解密后的待提取数据复制到非安全内存23。
所述非安全操作系统21还包括非安全侧文件系统2102和非安全侧底 层驱动2103,配置为实现非安全操作系统21中的数据存取操作;
所述安全操作系统22还包括安全侧文件系统2204及安全侧底层驱动2205,配置为实现安全操作系统22中的数据存取操作。
所述安全存取任务模块2201还配置为生成数据安全存取结果并发送给安全监控任务模块2202,所述数据安全存取结果包括:参数三和参数四;其中,参数三包括数据安全存取是否成功的指示消息,参数四为验证码MAGIC_SECURE;
所述安全监控任务模块2202,还配置为通过以下方式对数据安全存取结果的合法性进行验证:
安全监控任务模块2202判断数据安全存取结果中的参数四的值是否是MAGIC_SECURE,如果是,则安全监控任务模块2202对安全存取任务模块2201所发送的数据安全存取结果的合法性验证成功;如果否,安全监控任务模块2202对安全存取任务模块2201所发送的数据安全存取结果的合法性验证不成功。
下面通过具体示例,对本发明实施例所述方法作以下详细介绍。
本发明实施例提供的数据安全存储方法,在实际实现中,从整体上看,如图3所示,主要包括以下几个步骤:
步骤301:非安全侧数据存储任务启动;
步骤302:选择需存储的数据;
步骤303:将需存储的数据从非安全存储器读到非安全内存;
步骤304:准备好存储任务相关参数并切换到安全操作系统;
步骤305:安全侧判断存储任务相关参数是否合法;合法时,转至步骤307继续执行;当不合法时,转至步骤306继续执行;
步骤306:向非安全侧返回错误信息,并跳出当前流程;
步骤307:安全侧存储任务启动;
步骤308:指示用户输入密码,并接收用户发送的密码;
步骤309:判断密码是否合法;当不合法时,转至步骤310;当合法时,转至步骤311;
步骤310:向非安全侧返回错误信息,并跳出当前流程;
步骤311:执行数据安全存储流程。
该流程是包括:将非安全内存中的文件复制到安全内存、将安全内存中的文件加密、将文件写到安全存储器、存储成功并返回非安全系统。
本发明实施例提供的数据安全提取方法,在实际实现中,从整体上看,如图4所示,主要包括以下几个步骤:
步骤401:非安全侧数据提取任务启动;
步骤402:准备好数据提取任务相关参数并切换到安全操作系统;
步骤403:判断所述数据提取任务相关参数是否合法;当不合法时,转至步骤404继续执行;合法时,转至步骤405继续执行;
步骤404:向非安全侧返回错误信息,并跳出当前流程;
步骤405:安全侧安全数据提取任务启动;
步骤406:指示用户输入密码;并接收用户发送的密码;
步骤407:判断密码是否合法;当不合法时,转至步骤408;当合法时,转至步骤409;
步骤408:向非安全侧返回错误信息,并跳出当前流程;
步骤409:执行数据安全提取流程。
所述数据安全提取流程是包括:将文件从安全存储器读到安全内存、将安全内存中的文件解密、将安全内存中的文件复制到非安全内存、准备参数并返回非安全操作系统、非安全侧存储任务启动、选择存储路径、将文件从非安全内存写入非安全存储器;
执行完以上流程后,数据安全提取流程成功。
下面以数据安全存储流程为例,对本发明实施例提供的数据安全存取 方法作以下详细介绍;
该示例包括以下步骤:
步骤501:处理器启动安全操作系统和非安全操作系统;
终端上电时,处理器处于安全状态,首先启动安全操作系统;安全操作系统初始化,创建主控任务并执行;初始化非安全操作系统上下文,并切换到安全监控任务;安全监控保存安全操作系统上下文,恢复非安全操作系统上下文,启动非安全操作系统;非安全操作系统初始化之后,系统正常运行;
步骤502:用户发起安全存储请求;
用户打开终端中的安全存储应用程序,选择待存储的文件,并选择存储路径,点击相应用于发起存储请求按钮;
步骤503:非安全存储器中的非安全存取任务响应用户的存储请求;
非安全存取任务从用户发起的存储请求中获取存储信息:待存储的文件的文件名及存储路径;
步骤504:非安全存取任务如果是存储请求,将非安全存储器中待存储的文件读到非安全内存中,然后,非安全存取任务准备好SMC指令参数,切换到安全监控;将安全存储命令(包含任务标识:SECURE_SOURCE、操作标识:SECURE_SAVE、文件参数)的地址存放到SMC指令的参数1中,用于后续步骤中,安全操作系统中安全存取任务执行数据存取操作时使用;将验证码MAGIC_NS存放到SMC指令的参数2中,用于安全监控验证SMC指令的合法性;之后,切换到安全监控任务;
步骤505:安全监控任务验证SMC指令中参数的合法性;
安全监控任务首先检查SMC指令中参数2的值是否是MAGIC_NS,若不是,SMC参数验证失败,将错误信息保存到CMD中,返回到非安全操作系统处理失败的结果,此步骤结束;若是,SMC参数验证成功,保存SMC指令的参数1的值到指定的全局变量para_cmd中,发送给安全操作系 统的主控任务,并保存非安全上下文,恢复安全上下文,此步骤结束;
步骤506:主控任务获取安全监控任务传递的para_cmd参数,验证参数的合法性;
主控任务验证para_cmd参数的合法性,具体为验证任务标识、操作标识和文件参数的取值是否符合要求,即,确定para_cmd参数是否为合法的取值,若各参数均合法,根据CMD中的任务标识SECURE_SOURCE创建安全存取任务,此步骤结束;否则,para_cmd参数验证失败,将错误信息保存到CMD中,切换到安全监控,返回非安全操作系统处理失败的结果,此步骤结束;
步骤507:安全存取任务运行;
步骤508:对用户进行身份认证;
指示用户需输入密码(初次使用数据安全存取功能时,需设置初始密码),验证密码合法性;用于安全文件的存储或提取;
即,确定用户输入的密码是否为本地保存的密码;如果是,则用户身份认证成功,如果否,则用户身份认证失败;
首次使用时,用户设置初始密码后,直接登录系统执行数据安全存取操作;安全存取任务加密用户设置的初始密码并保存于本地,用于用户下次发起数据存储或提取请求时,验证用户身份。
步骤509:用户选择待存储文件的存储路径,并点击确认;
步骤510:安全存取任务从非安全内存中将待存储文件的加密存储到安全存储器中;
安全存取任务将非安全内存中的待存储文件的复制到安全内存,在安全内存中对待存储文件的进行加密操作,并将加密后的文件写入安全存储器;
步骤511:安全存取任务将数据安全存储结果保存到SMC指令中,设置SMC参数,并切换到安全监控;
所述数据安全存储结果包括参数3和参数4:
其中,参数3包括指示数据安全存储任务是否成功的信息,参数4包括验证码MAGIC_SECURE;
步骤512:安全监控验证SMC指令中参数的合法性;
检查SMC指令的参数2的值是否是MAGIC_SECURE,若不是,SMC参数验证失败,将错误信息保存到CMD中,回到安全操作系统处理失败的结果,此步骤结束;若是,SMC参数验证成功,保存安全操作系统上下文,恢复非安全系统上下文,此步骤结束;
步骤513:非安全存取任务处理传回的参数,针对待存储文件的安全存储流程完成;
存储任务完成后,非安全存取任务还可以切换到其他应用执行其它处理。
在具体实施过程中,上述非安全操作系统21和安全操作系统22、非安全存取任务模块2101、安全监控任务模块2202、主控任务模块2203、安全存取任务模块2201、非安全侧文件系统2102、非安全侧底层驱动2103、安全侧文件系统2204及安全侧底层驱动2205可以由终端内的中央处理器(CPU,Central Processing Unit)、微处理器(MPU,Micro Processing Unit)、数字信号处理器(DSP,Digital Signal Processor)或可编程逻辑阵列(FPGA,Field-Programmable Gate Array)来实现。
本发明实施例还提供了一种计算机存储介质,所述存储介质包括一组计算机可执行指令,所述指令用于执行本发明实施例所述的数据安全存取方法。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其 中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。

Claims (15)

  1. 一种数据安全存取方法,所述方法包括:
    非安全操作系统接收第一数据安全存取请求;
    非安全操作系统根据所述第一数据安全存取请求生成第二数据安全存取请求之后,将所述第二数据安全存取请求发送给安全操作系统;
    安全操作系统对所述第二数据安全存取请求进行合法性认证,当合法性认证成功时,根据所述第二数据安全存取请求执行数据安全存取操作。
  2. 根据权利要求1所述的方法,其中,当所述第一数据安全存取请求为数据安全存储请求时,所述第一数据安全存取请求中包括以下数据存取信息:待存储数据的文件名、及其存储路径,
    当所述第一数据安全存取请求为数据安全提取请求时,所述第一数据安全存取请求中包括以下数据存取信息:待提取数据的文件名及其提取路径。
  3. 根据权利要求2所述的方法,其中,当所述第一数据安全存取请求为数据安全存储请求时,所述方法还包括:所述非安全操作系统中的非安全存取任务将待存储的数据从非安全存储器中读到非安全内存中。
  4. 根据权利要求3所述的方法,其中,所述非安全操作系统根据所述第一数据安全存取请求生成第二数据安全存取请求,包括:
    非安全操作系统中的非安全存取任务将以下参数一和参数二携带在所述第一数据安全存取请求中,生成第二数据安全存取请求:
    其中,参数一包括任务标识、操作标识、数据存取信息,参数二包括验证码MAGIC_NS。
  5. 根据权利要求4所述的方法,其中,所述合法性认证包括:第一次合法性认证和第二次合法性认证;
    其中,所述第一次合法性认证,包括:安全操作系统中的安全监控任务判断所述第二数据安全存取请求中是否携带验证码MAGIC_NS,如果是,则确定所述第二数据安全存取请求第一次合法性认证成功;如果否,则确定所述第二数据安全存取请求第一次合法性失败;
    所述第二次合法性认证包括:所述安全操作系统中的主控任务判断所述参数一中的各个参数是否合法,当所述参数一中各个参数均合法时,第二次合法性认证成功,否则,第二次合法性认证失败。
  6. 根据权利要求1至5中任一项所述的方法,其中,所述安全操作系统根据所述第二数据安全存取请求执行数据安全存取操作,包括:
    当所述第二数据安全存取请求为数据安全存储请求时,安全存取任务执行以下操作:将已经存储在非安全内存中的待存储数据复制到安全内存,在安全内存中对待存储数据进行加密操作,将加密后的待存储数据写入安全存储器;
    当所述第二数据安全存取请求为数据安全提取请求时,安全存取任务执行以下操作:将待提取数据从安全存储器读到安全内存;在安全内存中对待提取数据进行解密操作;将解密后的待提取数据复制到非安全内存。
  7. 根据权利要求6所述的方法,其中,所述安全操作系统根据所述第二数据安全存取请求执行数据安全存取操作之后,所述方法还包括:
    安全操作系统中的安全存取任务生成数据安全存取结果并发送给安全操作系统中的安全监控任务,所述数据安全存取结果包括:参数三和参数四;其中参数三包括数据安全存取是否成功的指示消息,参数四为验证码MAGIC_SECURE;
    所述安全监控任务判断数据安全存取结果中的参数四的值是否是MAGIC_SECURE,如果是,则安全监控任务对安全存取任务所发送的数据安全存取结果的合法性验证成功,数据安全存取流程结束;如果否, 安全监控任务对安全存取任务所发送的数据安全存取结果的合法性验证不成功,安全监控任务向非安全操作系统返回处理失败的结果,数据安全存取流程结束。
  8. 一种数据安全存取装置,所述装置包括:非安全操作系统和安全操作系统;其中,
    所述非安全操作系统,配置为接收第一数据安全存取请求;并根据所述第一数据安全存取请求生成第二数据安全存取请求之后,将所述第二数据安全存取请求发送给安全操作系统;
    所述安全操作系统,配置为对所述第二数据安全存取请求进行合法性认证,当合法性认证成功时,根据所述第二数据安全存取请求执行数据安全存取操作。
  9. 根据权利要求8所述的装置,其中,当所述第一数据安全存取请求为数据安全存储请求时,所述第一数据安全存取请求中包括以下数据存取信息:待存储数据的文件名、及其存储路径,
    当所述第一数据安全存取请求为数据安全提取请求时,所述第一数据安全存取请求中包括以下数据存取信息:待提取数据的文件名及其提取路径。
  10. 根据权利要求9所述的装置,其中,所述非安全操作系统包括非安全存取任务模块,配置为将待存储的数据从非安全存储器中读到非安全内存中。
  11. 根据权利要求10所述的装置,其中,所述非安全存取任务模块,还配置为将以下参数一和参数二携带在所述第一数据安全存取请求中,生成第二数据安全存取请求:
    其中,参数一包括任务标识、操作标识、数据存取信息,参数二包括验证码MAGIC_NS。
  12. 根据权利要求11所述的装置,其中,所述合法性认证包括:第 一次合法性认证和第二次合法性认证;
    所述安全操作系统包括安全监控任务模块和主控任务模块;其中,
    所述安全监控任务模块,配置为接收非安全操作系统发送的第二数据安全存取请求,并通过以下方式对所述数据安全存取请求进行第一次合法性认证:安全监控任务模块判断所述第二数据安全存取请求中是否携带验证码MAGIC_NS,如果是,则确定所述第二数据安全存取请求第一次合法性认证成功;如果否,则确定所述第二数据安全存取请求第一次合法性失败;
    所述主控任务模块,配置为通过以下方式对所述第二数据安全存取请求进行第二次合法性认证:主控任务模块判断第二数据安全存取请求中参数一中的各个参数是否合法,当所述参数一中各个参数均合法时,第二次合法性认证成功,否则,第二次合法性认证失败。
  13. 根据权利要求12所述的方法,其中,安全操作系统还包括安全存取任务模块,配置为通过以下方式执行数据安全存取操作:
    当所述第二数据安全存取请求为数据安全存储请求时,安全存取任务模块执行以下操作:将已经存储在非安全内存中的待存储数据复制到安全内存,在安全内存中对待存储数据进行加密操作,将加密后的待存储数据写入安全存储器;
    当所述第二数据安全存取请求为数据安全提取请求时,安全存取任务模块执行以下操作:将待提取数据从安全存储器读到安全内存;在安全内存中对待提取数据进行解密操作;将解密后的待提取数据复制到非安全内存。
  14. 根据权利要求13所述的装置,其中,所述安全存取任务模块,还配置为生成数据安全存取结果并发送给安全监控任务模块,所述数据安全存取结果包括:参数三和参数四;其中参数三包括数据安全存取是否成功的指示消息,参数四为验证码MAGIC_SECURE;
    所述安全监控任务模块,还配置为通过以下方式对数据安全存取结果的合法性进行验证:
    安全监控任务模块判断数据安全存取结果中的参数四的值是否是MAGIC_SECURE,如果是,则安全监控任务模块对安全存取任务模块所发送的数据安全存取结果的合法性验证成功;如果否,安全监控任务模块对安全存取任务模块所发送的数据安全存取结果的合法性验证不成功。
  15. 一种计算机存储介质,所述存储介质包括一组计算机可执行指令,所述指令用于执行权利要求1至7任一项所述的数据安全存取方法。
PCT/CN2015/081962 2014-12-26 2015-06-19 一种数据安全存取方法、装置和计算机存储介质 WO2016101559A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410834664.8 2014-12-26
CN201410834664.8A CN105787376A (zh) 2014-12-26 2014-12-26 一种数据安全存取方法和装置

Publications (1)

Publication Number Publication Date
WO2016101559A1 true WO2016101559A1 (zh) 2016-06-30

Family

ID=56149121

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/081962 WO2016101559A1 (zh) 2014-12-26 2015-06-19 一种数据安全存取方法、装置和计算机存储介质

Country Status (2)

Country Link
CN (1) CN105787376A (zh)
WO (1) WO2016101559A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941835A (zh) * 2018-09-25 2020-03-31 联想(上海)信息技术有限公司 数据处理方法及电子设备
CN111753270A (zh) * 2020-06-28 2020-10-09 支付宝(杭州)信息技术有限公司 应用程序登录验证方法、装置、设备和存储介质

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106897639B (zh) * 2017-01-06 2020-12-22 奇酷互联网络科技(深圳)有限公司 移动终端及其安全验证的方法和装置
CN107168747B (zh) * 2017-05-27 2020-12-29 努比亚技术有限公司 移动终端配置的区分方法、装置及计算机可读存储介质
CN110933057B (zh) * 2019-11-21 2021-11-23 深圳渊联技术有限公司 物联网安全终端及其安全控制方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101281506A (zh) * 2007-04-03 2008-10-08 Arm有限公司 数据处理系统内基于存储器域的安全控制
CN103621009A (zh) * 2012-06-21 2014-03-05 Sk普兰尼特有限公司 用于基于可信平台认证开放式标识的方法、装置和系统
CN103714459A (zh) * 2013-12-26 2014-04-09 电子科技大学 一种智能终端安全支付系统及方法
CN104102876A (zh) * 2014-07-17 2014-10-15 北京握奇智能科技有限公司 保障客户端运行安全的装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2364139B (en) * 1999-12-22 2004-05-26 Ibm A security mechanism providing access control for locally-held data
CN100533459C (zh) * 2007-10-24 2009-08-26 北京飞天诚信科技有限公司 数据安全读取方法及其安全存储装置
CN104077284A (zh) * 2013-03-26 2014-10-01 中国移动通信集团湖北有限公司 一种数据安全访问方法及系统
CN104091135A (zh) * 2014-02-24 2014-10-08 电子科技大学 一种智能终端安全系统及安全存储方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101281506A (zh) * 2007-04-03 2008-10-08 Arm有限公司 数据处理系统内基于存储器域的安全控制
CN103621009A (zh) * 2012-06-21 2014-03-05 Sk普兰尼特有限公司 用于基于可信平台认证开放式标识的方法、装置和系统
CN103714459A (zh) * 2013-12-26 2014-04-09 电子科技大学 一种智能终端安全支付系统及方法
CN104102876A (zh) * 2014-07-17 2014-10-15 北京握奇智能科技有限公司 保障客户端运行安全的装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941835A (zh) * 2018-09-25 2020-03-31 联想(上海)信息技术有限公司 数据处理方法及电子设备
CN110941835B (zh) * 2018-09-25 2024-03-26 联想(上海)信息技术有限公司 数据处理方法及电子设备
CN111753270A (zh) * 2020-06-28 2020-10-09 支付宝(杭州)信息技术有限公司 应用程序登录验证方法、装置、设备和存储介质

Also Published As

Publication number Publication date
CN105787376A (zh) 2016-07-20

Similar Documents

Publication Publication Date Title
US9805210B2 (en) Encryption-based data access management
EP2913956B1 (en) Management control method and device for virtual machines
US9235719B2 (en) Apparatus, system, and method for providing memory access control
KR102157560B1 (ko) 전자 디바이스의 무결성을 검증하기 위한 시스템 및 방법
KR100792287B1 (ko) 자체 생성한 암호화키를 이용한 보안방법 및 이를 적용한보안장치
US9507964B2 (en) Regulating access using information regarding a host machine of a portable storage drive
WO2020192406A1 (zh) 数据存储、验证方法及装置
KR102361884B1 (ko) 전자 장치의 불법 복제 및 불법 행위 방지에 하드웨어 기반 보안 격리 영역의 사용
US20140351587A1 (en) Protecting cryptographic secrets using file system attributes
WO2019104988A1 (zh) Plc的安全处理单元及其总线仲裁方法
JP6422059B2 (ja) 処理装置、車載端末装置、処理装置の起動方法、及び処理装置の起動プログラム
EP2759955A1 (en) Secure backup and restore of protected storage
WO2016101559A1 (zh) 一种数据安全存取方法、装置和计算机存储介质
KR101654778B1 (ko) 하드웨어 강제 액세스 보호
US9529733B1 (en) Systems and methods for securely accessing encrypted data stores
US11228421B1 (en) Secure secrets to mitigate against attacks on cryptographic systems
JP2014509808A (ja) 携帯端末暗号方式、ハードウェア暗号化デバイス及び携帯端末
TW201530344A (zh) 應用程式存取保護方法及應用程式存取保護裝置
TWI724684B (zh) 用於執行經過身分驗證的加密操作的方法、系統及裝置
WO2012174726A1 (zh) 芯片及芯片的安全保护方法
JP2012009938A (ja) 情報処理装置及びプログラム
CN109150811B (zh) 一种实现可信会话的方法及装置、计算设备
EP3338214B1 (en) Secure computation environment
US10771249B2 (en) Apparatus and method for providing secure execution environment for mobile cloud
US11954234B2 (en) System and method for protecting browser data

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: 15871634

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15871634

Country of ref document: EP

Kind code of ref document: A1