The present invention relates to a method and a device for automatic validation of a computer program.
The present invention is directed more particularly to a method for automatic validation of a computer program able to access secure memory and non-secure memory and using at least one encryption function and at least one decryption function.
The invention finds an advantageous but non-limiting use in the customization of microcircuit cards.
The customization of microcircuit cards includes steps of processing sensitive data, i.e. secret data that is to be protected from fraudulent manipulation. This is known in the art.
For example, this kind of processing may consist in the following successive operations:
In the field of customization of microcircuit cards, various solutions are known in the art for carrying out such processing and for preserving the sensitive data obtained during processing from fraudulent manipulation.
A first solution known in the art consists in fabricating a dedicated microcircuit card known as the “root card” and implementing the various operations cited above.
The use of a root card of the above kind achieves total security, the data being temporarily archived, for its manipulation, in an internal secure memory of the microcircuit card.
Unfortunately, a root card is able to perform only the process for which it was developed.
It follows that to implement a new process, it is necessary to develop a dedicated card mask adapted to that process, necessitating non-negligible costs and development time.
In order to alleviate this problem, the person skilled in the art of customizing microcircuit cards sometimes makes use, in a manner that is known in the art, of secure platforms adapted to perform different types of processing on sensitive data.
These platforms may comprise secure computer systems or dedicated electronic cards.
In the present context, the execution of a particular process comprises a first phase of specifying and developing software implementing the various operations of the process taking account of the specific characteristics of the secure platforms.
During a second phase, the software developed in this way is verified manually by specialists in the platforms concerned to verify that no sensitive data can be accessed by third parties having fraudulent intent during the process.
Although more flexible than using a root card, this second solution also necessitates relatively long development times, in particular because of the phase of manual verification of the program by a specialist company.
The present invention solves the problems cited above.
The present invention consists more particularly in a method of automatic validation of a computer program able to access secure memory and non-secure memory and using at least one encryption function and at least one decryption function; this validation method comprises a verification step which verifies that:
In the remainder of this document, a distinction is made between “secure memory”, i.e. memory accessible only by a verifier program implementing the above validation method, and “non-secure memory” accessible in particular by a user of the verifier program or by other computer programs.
In a first embodiment, the secure and non-secure memories are distinct physical memories corresponding to different physical components.
In a preferred embodiment, the secure and non-secure memories are separate register areas of the same physical component, management and access control functions in respect of these memories being provided by software in a manner known to the person skilled in the art, for example by low-level memory management functions provided by a secure operating system.
The validation method is particularly advantageous since it may be used to validate any computer program using cryptographic functions, unlike the root card or the secure platform used in the prior art.
It verifies in particular that any function adapted to read data from secure memory and to produce data in non-secure memory is an encryption function, which ensures that only encrypted data is accessible to the user of the verifier program or to other computer programs.
The validation method of the invention also verifies that any data produced by the decryption function, in particular any sensitive data, is stored in secure memory.
According to a first feature, the computer program also uses at least one non-cryptographic function chosen from a logic function, a random number generation function, and an integrity check function.
The validation method may therefore validate any type of program using encryption functions, decryption functions and non-cryptographic functions.
According to one preferred feature of the invention, the computer program being in source code, the method comprises, before the verification step, a step of compilation of the source code into binary script, the verification step being effected on the binary script generated in this way.
This preferred embodiment achieves a higher level of security since it prevents fraudulent modification of the source code after the verification step.
The computer program is a sensitive data generation program, for example.
In a preferred embodiment, the computer program is a sensitive data transformation program. For example, it receives at its input first sensitive data, for example secure keys, effects decryption operations and logic operations on the first sensitive data and, following encryption, supplies other sensitive data, for example a secret code.
According to another and particularly advantageous feature, each function used by the computer program is associated with at least one operating mode that defines at least one rule governing access to secure and non-secure memory, the operating mode being stored in a verification table used during the verification step.
The above operating modes are used by programmers during the step of specifying and developing a particular process.
According to the invention, these rules in particular require any decryption function to store the data produced in secure memory.
A preferred embodiment of the validation method further comprises:
The above steps are executed by a main program which therefore defines the memory environment used by the verifier program for the verification of the binary script.
The invention therefore finds a use in the field of customizing microcircuit cards, but also in varied fields such as electronic transactions in telecommunication servers, for example.
The invention is also directed to a compiler implementing a validation method as briefly described hereinabove.
This kind of compiler may advantageously be used in a software microcircuit card personalization system.
The invention is also directed to a method of executing a computer program adapted to access secure memory and non-secure memory, the program using at least one encryption function and at least one decryption function.
Before executing each function, the execution method of the invention executes a verification step as briefly described hereinabove.
According to this execution method, before executing each function of the program, the verification step briefly described hereinabove is executed to verify that the function preserves the security of the sensitive data.
An execution method of this kind is particularly reliable since it prevents manipulation of the binary script between the verification of a function and its execution.
It may obviously be used to customize microcircuit cards.
More generally, it may be used to transform or generate sensitive data, for example, in the field of telecommunications, to generate keys in a telecommunication server.
Another aspect of the invention relates to an electronic integrated circuit adapted to implement a validation method or an execution method as briefly described hereinabove.
An integrated circuit of the above kind may be modeled in the language VHDL known to the person skilled in the art, for example.
It may also be implemented in the form of a programmable electronic component.
The invention is further directed to a microcircuit card and a computer system including an integrated electronic circuit as briefly described hereinabove.
Another aspect of the invention is directed to a secure operating system implementing a validation method as briefly described hereinabove.
An operating system of the above kind may be used with great advantage in the microcircuit card industry, as it enables security functions to be implemented at the lowest software level of the microcircuit cards, which prevents virtually all types of fraudulent operation.
In the field of microcircuit cards, an operating system of the above kind also secures the execution of loaded applications, including subsequent to the issuing of the cards (post-issuance).
The invention is also directed to a microcircuit card and a computer system including an operating system of the above kind.
The invention is further directed to a device for validating a computer program adapted to access secure memory and non-secure memory and using at least one encryption function and at least one decryption function.
The validation device comprises a verifier program adapted to verify that:
The invention is further directed to a secure computer operating system comprising:
The particular advantages and characteristics specific to the compiler, the execution method, the secure operating system, the microcircuit card, the validation device and the computer system being the same as those explained hereinabove in connection with the validation method of the invention, they will not be set out again here.
Other aspects and advantages of the present invention will become more clearly apparent on reading the following description of particular embodiments of the invention, the description being given by way of non-limiting example only and with reference to the appended drawings, in which:
Additionally, the description is accompanied by the following appendices:
An example of a source code computer program P adapted to be validated by an automatic validation method of the present invention and to be executed by an execution method of the present invention is given in Appendix A.
This computer program P comprises a sequence of operations each implementing a decryption function, an encryption function or a non-cryptographic function.
When developing this kind of computer program, the developer must, for each operation, conform to a syntax stored in a syntax table TS, one example of which is shown in
To be more precise, each operation comprises:
Accordingly, the first operation declared in line a1 is a decryption operation using a decryption function DES-1 identified by the identifier DES-1 and using three arguments:
In the embodiment described above, the programmer advantageously does not know the cryptographic key, only its reference KEY in the form of a character string. This embodiment prevents fraud by the programmer.
Similarly, the second operation declared in line a2 is an integrity check operation using an integrity check function CHECKSUM_XOR identified by the identifier CHECKSUM_XOR and using two arguments:
Finally, the third operation declared in line a3 is an encryption operation using an encryption function DES identified by the identifier DES and using three arguments:
Each function is further associated with an operating mode defining at least one memory access rule, the operating modes being stored in a verification table shown in
For each encryption, decryption and logic function, the verification table TV comprises as many rows as there are operating modes for that function, each operating mode defining rules for access to secure memory MS and non-secure memory MNS.
For example, the encryption function DES comprises four operating modes because, in the embodiment described here, any encryption function is authorized to read and write secure and non-secure memory with no particular constraints.
On the other hand, the last two rows of the verification table TV show that the decryption function DES-1 has only two operating modes, the present invention authorizing a decryption function to produce data only in secure memory MS.
A main program implementing an automatic validation method and a method of executing a computer program P conforming to the present invention is described next with reference to
The validation method comprises a preliminary step E300 of compiling the Appendix A computer program P, this compilation step generating a binary script EXE.
The binary script EXE resulting from this compilation step is described next with reference to Appendix B.
To simplify the description, the bytes of the binary script EXE are grouped into rows b1 to b20.
The first two bytes of the script EXE (row b1) correspond to the size of the binary script, which is 6C in hexadecimal notation.
The next byte (row b2) corresponds to the number of operations in the computer program P, that is to say three operations.
The bytes grouped in rows b3 to b8 are generated by the compilation of the first operation (row a1, Appendix A).
Similarly, the bytes grouped in rows b9 to b13 are generated by the compilation of the second operation (row a2, Appendix A).
Finally, the bytes grouped in rows b14 to b19 are generated by the compilation of the third and final operation (row a3, Appendix A).
In each of the above groups:
In the embodiment described here, the compilation of an argument first generates a first byte representative of the memory area in which the read or write operation effected on that argument must be done.
Four memory areas are used in the example described here:
The compilation of an argument then generates a second byte representative of the size of the argument. In the present example, this size is either 8 bytes when the argument is an address or 12 bytes (0C in hexadecimal notation) when the argument is the key KEY constituted of the 12 characters “CIPHER.TEST1”.
The compilation of an argument finally generates a group of bytes representative of the value of the argument concerned.
In the present embodiment, an address range is represented in the program P using the notation ZONE/SHIFT/LENGTH, where:
Using the above notation, the second argument (OUTPUT=[PRIVATE/08/01]) of the logic operation CHECKSUM_XOR (row a2, Appendix A), signifies that the result of the logic operation must be stored in the secure calculation zone PRIVATE, in a range extending over one byte, starting from the eighth byte of that zone.
In the present embodiment, the binary script ends with a series of bytes (row b20) corresponding to a cryptographic signature obtained from at least some of the bytes constituting the script.
The compilation step E300 is followed by a step E305 during which the main program receives:
In the present embodiment, the secure keys are stored in the secure key storage area.
The reception step E305 is followed by a step E310 during which the main program dynamically allocates secure memory MS and non-secure memory MNS.
This allocation step is known to the person skilled in the art and may be carried out using the system function malloc ( ), for example.
Be this as it may, the allocation step E310 produces a first address pointer BUFF_MNS pointing to the non-secure memory and a second address pointer BUFF_MS pointing to the secure memory.
In the embodiment described here, the non-secure memory MNS allocated in this way is divided into two areas:
The secure memory MS is also divided into two areas:
In a preferred embodiment, during the same step E310 a working memory MT marked by the pointer BUFF_EXE and comprising the binary script EXE received during the step E305 is also allocated.
The memory allocation step E310 is followed by a step E315 of verifying the integrity of the binary script.
The step E315 may be effected by verifying the cryptographic signature of the binary script EXE, for example, as described above with reference to row b20 of Appendix B.
This optional step E315 of verifying the integrity of the script makes the validation method more secure.
The optional step E315 of verifying the integrity of the script is followed by a step E320 during which the number N of operations of the computer program P is obtained and stored in a register of the working memory MT with the same name.
In the present embodiment, the number N of operations is the third byte (row b2) of the binary script EXE.
If the optional step E315 of verifying the integrity of the script is not implemented, the step E320 of obtaining the number of operations follows on from the step E310 of allocating memories described above.
The step E320 of obtaining the number N of operations is followed by a test E325 which verifies if the content of the register N of the working memory MT is equal to 0.
If not, the result of the test E325 is negative.
This test is then followed by a step E330 during which the function identifier used by the first operation of the computer program P is obtained in the binary script.
In the Appendix B example, the identifier obtained in this way is the identifier 22, representing the function DES-1 (row b4).
This step E330 is followed by a step E335 during which the arguments of this function are obtained in the binary script.
In practice, the step E335 of obtaining the arguments comprises:
The step E335 of obtaining the arguments of the function is followed by a step E340 of invoking a procedure for verifying the function identified during the steps E330 and E335.
The main steps E400 to E440 of the verification procedure are described next with reference to
During the first step E400 of the verification procedure, the rules governing access to secure and non-secure memory are obtained from the
The step E400 of obtaining the rules is followed by a test E410 which verifies if these access rules are complied with.
In practice, this verification step verifies that:
For example, scanning rows b14 to b19 of appendix B identifies that the function DES (row b15) effects:
If all the memory access rules are complied with, the result of the test E410 is positive.
This test is then followed by the step E420 during which the operation being processed is executed.
On the other hand, if one or more access rules are not complied with, the result of the test E410 is negative.
The test is then followed by a step E430 during which the content of the non-secure output area OUT_BUF is deleted.
The step E430 of deleting the output memory is followed by a step E440 of notifying an error to the programmer of the computer program P.
Be this as it may, the steps E420 and E440 terminate the verification procedure of the invention.
These steps are followed by a validation test E345 described next with reference to
The validation test E345 verifies if the verification procedure described above with reference to
If the verification procedure terminates normally, i.e. with the operation execution step E420, the result of the test E345 is positive.
The test is then followed by a step E350 during which the content of the register N is decremented by one unit.
The step E350 is followed by the test E325 described above, which verifies if the register N contains the value 0.
If the result of this test is negative, the step E330 described above is executed during which the identifier of the function constituting the second operation of the computer program P is read in the binary script EXE.
Thus the steps E325 to E350 constitute a loop during which all operations of the program are validated and executed if the computer program P complies with all the memory access rules.
On the other hand, if the verification procedure terminates in an error notification, the result of the test E345 is negative.
The test is then followed by the step E355 described hereinafter.
If all the operations of the computer program P have been validated by the loop comprising the steps E325 to E350, the result of the test E325 is positive.
In this case, the test E325 is followed by a step E355 during which the content of the output area OUT_BUF is transmitted either to the user of the main program or to another output data processing computer program.
The step E355 is followed by a step E360 of releasing and erasing the memories allocated in the step E310.
This step E310 terminates the main program conforming to the present invention.
This computer system comprises a compiler for generating a binary script EXE as described above from a source code computer program P.
The computer system further comprises a secure operating system which comprises means for allocating secure memory MS and non-secure memory MNS.
In a preferred embodiment, these allocation means are in practice software functions known to the person skilled in the art, for example the function malloc ( ). This allocation function returns an address pointer delimiting the beginning of the address ranges of the secure memory MS and the non-secure memory MNS. This is known in the art.
In the
In a preferred embodiment, the binary script EXE is contained in a working memory MT allocated by the allocation means cited above and marked by the address pointer BUFF_EXE.
In the present embodiment, the binary script EXE is in practice loaded into the working memory by loading means of the computer system, for example a PCI bus.
In a different embodiment, the binary script EXE is stored in non-volatile memory and loaded at the time it is validated.
Thus the computer system comprises a validation device comprising a verifier program adapted to verify the validity of the binary script EXE.
The verifier program of the computer system is generally adapted to implement the validation method and the execution method described above with reference to
To be more precise, the verifier program is adapted to verify that any function adapted to read data from secure memory MS and to produce data in non-secure memory MNS is an encryption function.
It is also adapted to verify that any data produced by a decryption function is stored in secure memory MS.
The verifier program is in particular adapted to scan the binary script EXE stored in the working memory MT, to mark the instructions corresponding to the identifiers and to the arguments of the encryption, decryption and logic functions after compilation.
This marking step is effected by comparing the hexadecimal data of the binary script EXE with the information contained in the syntax table TS described above with reference to
The verifier program of the computer system is adapted, when these function arguments and identifiers have been marked, to verify compliance with the access rules stored in the verification table TV described above with reference to
To this end, and for each memory read or write operation, it marks in the binary script EXE the memory address at which the operation must be carried out.
It then determines if the operation should take place in secure memory MS or in non-secure memory MNS by comparing the address for the operation with the values of the address pointers BUFF_MS and BUFF_MNS.
Once the memories type has been identified, the verifier program of the computer system verifies that the write or read operation conforms to the access rules for the type of function being processed.
In a different embodiment, the validation method is implemented at the level of the secure operating system. A secure operating system may advantageously be used in a microcircuit card.
Number | Date | Country | Kind |
---|---|---|---|
02 03743 | Mar 2002 | FR | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/FR03/00858 | 3/18/2003 | WO | 00 | 5/18/2005 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO03/081546 | 10/2/2003 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
5224166 | Hartman | Jun 1993 | A |
5892826 | Brown | Apr 1999 | A |
6385727 | Cassagnol et al. | May 2002 | B1 |
6438666 | Cassagnol et al. | Aug 2002 | B2 |
6901385 | Okamoto et al. | May 2005 | B2 |
7082615 | Ellison et al. | Jul 2006 | B1 |
7124302 | Ginter et al. | Oct 2006 | B2 |
7380278 | Ellison et al. | May 2008 | B2 |
7430585 | Sibert | Sep 2008 | B2 |
7437574 | Ronkka et al. | Oct 2008 | B2 |
20020129245 | Cassagnol et al. | Sep 2002 | A1 |
20050125681 | Bressy et al. | Jun 2005 | A1 |
20050259813 | Wasilewski et al. | Nov 2005 | A1 |
20050262342 | Field | Nov 2005 | A1 |
20060015748 | Goto et al. | Jan 2006 | A1 |
20060080553 | Hall | Apr 2006 | A1 |
20070006294 | Hunter | Jan 2007 | A1 |
20070061581 | Holtzman et al. | Mar 2007 | A1 |
20070288765 | Kean | Dec 2007 | A1 |
20080295180 | Yoneda | Nov 2008 | A1 |
20080298581 | Murase et al. | Dec 2008 | A1 |
20080301440 | Plouffe et al. | Dec 2008 | A1 |
20080301468 | Murase et al. | Dec 2008 | A1 |
20080301469 | Plouffe et al. | Dec 2008 | A1 |
Number | Date | Country |
---|---|---|
0 308 219 | Mar 1989 | EP |
2 796 175 | Jan 2001 | FR |
0154083 | Jul 2001 | WO |
WO 03058409 | Jul 2003 | WO |
Number | Date | Country | |
---|---|---|---|
20050207572 A1 | Sep 2005 | US |