This is the first application for this invention.
The present invention relates generally to cryptography. More particularly, the present invention relates to a method and system for protecting cryptographic assets, such as private keys and other secret parameters.
The Digital Signature Algorithm (DSA) and the Elliptic Curve Digital Signature Algorithm (ECDSA) are described in the standards FIPS PUB 186-3 (U.S. Department of Commerce) and ANS X9.62-2005 (American National Standard for Financial Services), both of which are herein incorporated by reference in their entirety. These signature algorithms use public-key cryptography to enable the creation and verification of digital signatures on digital messages. Signatories in DSA and ECDSA possess a private key and a public key; the private key is used to generate a digital signature (i.e., to sign a message) and the public key is used by third parties to validate that signature.
DSA and ECDSA are widely deployed (e.g., in ssh, SSL/TLS, Canada Post digital postmarks, DTCP, AACS, MS-DRM) and can be used to provide data origin authentication, data integrity, and non-repudiation. However, any assurances that DSA and ECDSA signatures might provide are always subject to the assumption that a signatory's private key remains private (i.e., the private key does not leak to an attacker).
The following references provide additional background information, and are each incorporated by reference in their entirety:
The signature generation operation of ECDSA and DSA is typically implemented in computer software, which is then run on a particular computing device (e.g., a cell phone, set-top box, smart card). In many applications, this operation takes place in an environment outside the signatory's control—possibly in the presence of adversaries (i.e., an adversary might observe the device as a signature is being computed).
An adversary who analyzes only the inputs and outputs of signature generation effectively treats that implementation like a black box. DSA and ECDSA were designed to resist such black box attackers. However, there is often more information available than just inputs and outputs. Additional information such as device power consumption, execution time, electromagnetic emanations, and response to data faults can give clues to an attacker about the execution of the software; it has been shown that this can leak bits of the private key and completely compromise the signature scheme.
A much more robust security model considers resistance against white box attackers. White box attackers have full visibility into the execution of the software that computes the signature. Resistance against white box attackers is a highly desired goal, but no white box implementations of DSA or ECDSA have yet been proposed.
As a concrete example of this problem, consider the DTCP protocol used to protect audio/video content. The following quotation comes from the DTCP specification, as defined in reference [6] above:
The sentence emphasized above states that DTCP compliant devices must take steps to protect their ECDSA private key. However, such devices must utilize their private key during the Full Authentication protocol to create an ECDSA signature. While it may seem as though the private key can be simply be protected by storing it in an encrypted state, the fact is that, to carry out the signature operation, the private key would first have to be decrypted in order to be used, at which point it could be extracted by a white box attacker. To alleviate this problem what is needed is a protection process that keeps the private key confidential and permits a digital signature operation to be carried out without leaking the private key to the attacker.
It is an object of the present invention to obviate or mitigate at least one disadvantage of previous digital signature processes. In particular, one aspect of the invention is directed to a process which more securely protects the key of the signer from being deduced by an adversary who is able to observe the digital signature process in operation.
Accordingly, aspects of the invention are directed to methods and systems for implementing a digital signature generation (DSG) process which provide resistance against white box attackers. This is done by applying specially selected data transformations to the inputs, outputs and internal parameters of the algorithm. In particular, the signatory's private key does not appear in the clear in our protected implementation. Our new white box implementation produces signatures that are compatible with signatures created by conventional implementations; thus our solution facilitates interoperability and can be used as a drop-in replacement for conventional implementations. In particular, we describe transformations to the key (d) and the generator domain parameter (usually denoted G or g) of the digital signature generation processes, such that embodiments of the invention can produce signed messages which appear to a verifier as if the key (d) was used, without actually ever using the key (d). This makes it impossible for an adversary to ever observe the key (d), as it is not actually used. Further embodiments include additional protections to make it even harder for an adversary to deduce the key (d) by observing the process which generates the digital signature.
One aspect of the invention provides a method and system for producing a transformed key ({circumflex over (d)}), by transforming d based on a random integer f, which can be used along with a transformed generator (e.g., Ĝ or ĝ), and f itself, to produce a compatible signed messaged. According to such an aspect, the transformed generator is produced based on the generator, and the inverse of f modulo n. Then the DSG is slightly modified to use said transformed generator (e.g., Ĝ or ĝ) and {circumflex over (d)}, in place of said generator (G or g) and d, along with incorporating f, in said DSG process to produce a digital signature which can be verified by said verification process using the public key Q as if d and said generator were actually used in said DSG process.
In an aspect, the present invention provides a computer implemented method of protecting a cryptographic secret key (d), which has a corresponding cryptographic public key Q, wherein both Q and d relate to a generator of order n, wherein d is stored and used on a computing apparatus A, from an adversary B able to observe A during execution of a cryptographic digital signature generation (DSG) process which utilizes d, said DSG process having a known signature verification process which utilizes Q, said method comprising:
a) choosing a random integer f in the interval between 1 and n−1;
b) producing a transformed generator based on said generator and the inverse of f modulo n;
c) producing a transformed key ({circumflex over (d)}) by transforming d based on f; and
d) utilizing said transformed generator and {circumflex over (d)}, in place of said generator and d, along with incorporating f, in said DSG process to produce a digital signature which can be verified by said verification process using Q as if d and said generator were actually used in said DSG process.
In a further aspect, there is provided a computer implemented method of protecting a cryptographic secret key (d), which has a corresponding cryptographic public key Q, wherein both Q and d relate to a generator of order n, wherein d is stored and used on a computing apparatus A, from an adversary B able to observe A during execution of a cryptographic digital signature generation (DSG) process which utilizes d, said cryptographic process having a known signature verification process which utilizes Q, said method comprising:
a) choosing a random integer f in the interval between 1 and n−1;
b) producing a transformed generator based on said generator and the inverse of f modulo n;
c) producing a transformed key ({circumflex over (d)}) by transforming d based on f; and
d) producing a computer program product embodied in a machine readable medium which stores machine executable instructions, which when executed by A, cause A to utilize said transformed generator and d, in place of said generator and d, along with adding f, in said DSG process to produce a digital signature which can be verified by said verification process using Q as if d and said generator were actually used in said DSG process.
In a further aspect, the present invention provides a computer program product comprising a tangible computer readable medium storing computer readable instructions, which when executed by a processor, cause said processor to implement a method of protecting a cryptographic secret parameter (d) which has a corresponding cryptographic public parameter Q, wherein both Q and d relate to a generator of order n, wherein d is stored and used on a computing apparatus A, from an adversary B able to observe A during execution of a cryptographic process which utilizes d, said cryptographic process having a known complimentary process which utilizes Q, said computer readable instructions comprising:
a) instructions for choosing a random integer f in the interval between 1 and n−1;
b) instructions for calculating a transformed generator value of said generator based on an inverse of f mod n
c) instructions for calculating a transformed value {circumflex over (d)} of d based on f; and
d) storing said values of f, said transformed generator and {circumflex over (d)} in a secure manner for subsequent use in a transformed cryptographic process which uses f, said transformed generator and {circumflex over (d)} to produce a digital signature which can be verified by said complimentary process using Q as if d and said generator were actually used in said cryptographic process.
In further aspect, the present invention provides a computer program product comprising a tangible computer readable medium storing computer readable instructions, which when executed by a computing apparatus (A), cause said computing apparatus to produce a digital signature (r, s) on a message M which can be verified by a standard ECDSA digital signature verification process for verifying a signature (r, s) on a message M purported to have originated with the holder of a private key d, in which said private key d has a corresponding cryptographic public key Q, wherein both Q and d relate to a generator G of order n, said signature producible while protecting d from an adversary able to observe A during execution of said computer readable instructions, said computer readable instructions comprising:
i) instructions for choosing a random integer {circumflex over (k)} in the interval [1, n−1];
ii) instructions for assigning the result of EC_Multiply({circumflex over (k)},Ĝ) to a point R, wherein EC_Multiply({circumflex over (k)},Ĝ) means add the elliptic curve point Ĝ to itself {circumflex over (k)} times, said elliptic curve point Ĝ having been previously generated based on a transformation of said generator Ĝ using a previously chosen random integer f in the interval between 1 and n−1;
iii) instructions for assigning the result of Rx mod n to r, where Rx is the x co-ordinate of R;
iv) instructions for branching again to i) if r=0, otherwise;
v) instructions for assigning the value of a hash operation on the message M to e;
vi) instructions for computing the value of {circumflex over (k)}−1(ef+{circumflex over (d)}r) mod n and assign this value to s, wherein {circumflex over (d)} is a previously determined transformed value of d based on f;
vii) instructions for branching again to i) if s=0, otherwise;
v) instructions for transmitting the digitally signed message M, along with the signature (r, s) to a 3rd party for verification; and
wherein said signature (r, s) on the message M is equivalent to that which would have been generated by a standard ECDSA process using the private key d, except that the actual private key d is not used and is therefore never loaded into memory during execution. Further, as described herein, according to another aspect, such a computer program product can be adapted to DSA.
In further aspect, the present invention provides a computer product comprising a tangible computer readable medium storing computer readable instructions, which when executed by a computing apparatus (A), cause said computing apparatus to produce a digital signature (r, s) on a message M using offline transformed values to do the signing, as disclosed herein.
Other aspects and features of the present invention will become apparent to those ordinarily skilled in the art upon review of the following description of specific embodiments of the invention in conjunction with the accompanying figures.
Embodiments of the present invention will now be described, by way of example only, with reference to the attached Figures, wherein:
Generally, the present invention provides a method and system for protecting cryptographic assets, which include private keys, secret parameters, and the like, in Digital Signature Generation Processes.
A generic Digital Signature Generation Process is illustrated in
A generic Digital Signature Verification Process is illustrated in
One aspect of the invention provides methods and systems which can produce a signature (S), while protecting d which is compatible with existing verification processes. In other words, embodiments of the invention will produce S on a computing apparatus A, which may be in the presence of an adversary B who is actively trying to obtain d by observing the signature generation process, which can be verified by 206, using Q, without requiring the verifier change the process 206.
We describe exemplary processes for converting an implementation of DSA or ECDSA signature generation into a one that resists white box attackers, according to embodiments of the invention, in the following sections.
Note that we use the term smooth to refer to a conventional, unprotected implementation of signature generation (i.e., an implementation that is vulnerable to white box attackers), and we use the term robust to refer to a protected implementation, according to embodiments of the invention.
Notation
Below we define some terms and notation related to elliptic curve cryptography (ECC) using similar notation described in reference [2]:
G
Smooth ECDSA
Here we summarize the unprotected ECDSA Signature Generation operation, which follows the description in ANSX9.62[1].
Before using ECDSA, a choice must be made on a particular elliptic curve, a cryptographic hash function (H) and a generator point G; this information (sometimes referred to as domain parameters) is generally considered to be non-secret.
The following represents the conventional (i.e., smooth) process for signing a message using ECDSA:
Elliptic curve arithmetic is used only in Step 2 to compute the point R; the operations in Steps 3 and 5 are ordinary arithmetic modulo n. Note that the private key, d, is used only at Step 5.
This process is illustrated in
During the above signature generation process, there are actually two highly sensitive values that must be protected:
That d must be protected is clear. However, if the value of k is leaked, then an adversary can derive d from k. As the hash function H is known, e can be determined from the message M. Accordingly, if an adversary obtains k, an adversary can obtain the private key from the resulting signature (r, s) on M by solving the following equation modulo n:
s=k−1(e+dr)
Here we have a single equation with d being the only unknown. Thus, d can be solved for. This is a potential security problem.
Accordingly, an adversary B who observes a computing apparatus A which executes a conventional DSG process, can derive the private key d simply by watching for a call to a random number generator and noting the selection of the value k. Alternatively, an adversary B might observe the instructions executed on apparatus A to compute kG and thereby derive k.
Robust ECDSA
We now discuss an exemplary process for creating a robust implementation of ECDSA signature generation, according to an embodiment of the invention.
In some manner not observable by an adversary B, for example during an off-line setup phase, we perform a preliminary process, according to an embodiment. This preliminary process involves selecting a secret number f in the interval [1, n−1]. f will be used to protect the private key, d. According to an embodiment, two transformation processes are invoked (both of which are related to f) to produce a transformed (or obfuscated) key and transformed (or obfuscated) generator having the values:
Both Ĝ and {circumflex over (d)} can be computed off-line, immediately following the selection of f.
This preliminary process, according to an embodiment, is illustrated in
Here are the basic steps of a robust signing process, according to an embodiment of the invention:
As can be seen above, such an embodiment which incorporates a Robust ECDSA Signature Generation process, utilizes the transformed generator Ĝ and {circumflex over (d)}, in place of the generator G and d, along with incorporating f (see Step 5), in said ECDSA Signature Generation process to produce a digital signature S=(r,s) which can be verified by a conventional ECDSA verification process using Q as if d and said generator G were actually used in a ECDSA Signature Generation process. In brief, f is incorporated into the process by replacing e with ef in step 5. By utilizing f in Step 5 in this manner—and recall that f was used in the transformations made offline to produce Ĝ and {circumflex over (d)}—the resulting signature is fully compatible with one made by a conventional process.
A flowchart that illustrates the above process, according to an embodiment of the invention is shown in
This version of signature generation produces signatures that are fully compatible with ordinary ECDSA (i.e., any signature (r,s) created by our robust implementation could have also been created by a smooth implementation).
Analysis
Embodiments of the invention are intended to address the following two goals:
To meet the goals above, it does not seem necessary to use additional resources to attempt to add further protection to the computation of R in Step 2. We rationalize this statement as follows.
Consider the three values used in Step 2: R, {circumflex over (k)}, Ĝ. Suppose these values are all known to an adversary. Assume further that the attacker knows the value of G since it often appears in publicly available standards. Since Ĝ=f−1G, the adversary might try to compute f−1, and hence f, from this equation, which would contradict goal 2 above. However, this computation amounts to solving an ECDLP, which is assumed to be infeasible. Thus we are confident that an adversary cannot compute f from G and Ĝ.
Further, regarding goal 1 as set out above, knowledge of {circumflex over (k)} does not reveal the secret key d in the same way that knowledge of k does in a conventional ECDSA. This is because the task of computing d from {circumflex over (k)} and the signature (r, s) amounts to solving the following equation modulo n:
s={circumflex over (k)}−1(e+dr)f
However, unlike for conventional DSGs, the above equation includes two unknown values: d and f (i.e., we have one equation and two unknowns). Therefore the adversary is not able to extract d from this one equation, even if they learn {circumflex over (k)}, as both d and f are unknown.
While the embodiments discussed above modify DSGs in such a manner as to make such a process more robust than conventional DSGs, such an improved system can be made even more robust by making it harder for an attacker to learn f. Accordingly, embodiments of the invention, perform the preliminary steps of choosing f, and producing the transformed values Ĝ and {circumflex over (d)} in some manner not observable by B. One way of performing these steps in a manner not observable by B is to perform these steps offline. By offline, we mean in a time or place such that either A is not observable by B, or on a different computing apparatus altogether. For example, in the case of A being a smart card or set top box, offline includes prior to shipping said device. In the case of A being a personal computer, these steps can be executed on another computer, and provided to A by some secure media. Alternatively, these steps can be executed in a manner not observable B by utilizing secure hardware.
Further, in a preferred embodiment, additional obfuscation techniques are utilized to make it harder for an adversary to deduce the values of f and {circumflex over (d)} from observing the computations in Step 5 (i.e., s←{circumflex over (k)}−1(ef+dr) mod n). According to one embodiment, step 5 is calculated by executing the following process. First, we create two multiplication functions (which can take the form of software routines obfuscated using a series of look-up tables):
mult_by—f( . . . ),mult_by—dhat( . . . )
These functions, which according to one embodiment incorporate word-wise recode-tables constructed during the off-line phase, will take a multi-precision integer x as input (i.e., an array of 32-bit words) and return, respectively, xf mod n and x{circumflex over (d)} mod n. These two functions will be utilized as follows to carry out the computations of Step 5, according to one embodiment:
e—f←mult_by—f(e) 5.1:
dhat—r←mult_by—dhat(r) 5.2:
tmp←e—f+dhat—r mod n 5.3:
s←{circumflex over (k)}−1*tmp mod n 5.4:
DSA
Note that for illustrative purposes, we focused above primarily on ECDSA. However ECDSA and DSA are closely related. We submit that one skilled in the art should be able to easily apply the detailed explanation and the examples we have presented above with respect to ECDSA, to DSA signature generation. However, we now set out a brief summary of the process, according to an embodiment of the invention.
Here we summarize the unprotected DSA Signature Generation operation, which follows the description in FIPS PUB 186-3 [3].
Before using DSA, a choice must be made for certain domain parameters: a prime p, a prime q (which divides p−1), a generator g of order q modulo p. The domain parameters are generally considered to be non-secret.
Here is how you sign a message using DSA:
Note that the arithmetic operations above are all modular arithmetic (i.e., arithmetic modulo p or arithmetic modulo q)
During signature generation, there are actually two highly sensitive values that must be protected:
1. the private key, d.
2. the per-message secret, k.
That d must be protected is clear. If the value of k is leaked, then an adversary can derive d from k and the resulting signature (r, s) on M by solving the following equation modulo q:
s=k−1(e+dr)
Robust Signature Generation
One embodiment for creating a robust implementation of a DSA signature generation is as follows.
Similar to above, in some manner not observable by an adversary B, for example during an off-line setup phase, we select a secret number f in the interval [1, q−1]. f will be used to protect the private key, d. According to an embodiment, two transformation processes are invoked (both of which are related to f) to produce a transformed key and transformed generator having the values: f:
Both ĝ and {circumflex over (d)} can be computed off-line, immediately following the selection of f. Here are the basic steps of a robust DSA signing process, according to an embodiment of the invention:
This version of signature generation produces signatures that are fully compatible with ordinary DSA (i.e., any signature (r, s) created by our robust implementation could have also been created by a smooth implementation).
Further Protections
Regardless of which of the above embodiments is implemented, control flow transformations and data transformations can be applied to the source code that implements the signature generation operation, in order to make it harder for an adversary to deduce sensitive parameters, for example {circumflex over (d)} or f, by observing the operation of the computing device which executes the DSG process.
The control flow transformations 702 map the control-flow of a given program into a new control-flow form, using a number of functions to control the flow, and include the exemplary control-flow transformations as described in U.S. Pat. No. 6,779,114, issued Aug. 17, 2004, which is incorporated herein by reference in its entirety). The data transformations 704 involve the use of mathematical mapping functions which transform both data operations and locations to alternate mathematical spaces, examples of which are described in U.S. Pat. No. 6,594,761, issued Jul. 15, 2003, U.S. Pat. No. 6,842,862 issued Jan. 11, 2005, and US Patent Publication No. US-2005-0166191A1, published Jul. 28, 2005, the contents of which are incorporated herein by reference in their entirety.
In another embodiment, to offer another level of protection for f we compute ef mod n (which is used in Step 5) in another manner. Since the value e is equal to the hash of the input message, M, an embodiment of the invention incorporates the multiply by f modulo n operation into the hash computation. As will be appreciated, this depends on the nature of the hash function used, but assuming a suitable hash function, in such an embodiment the hash function H is replaced with a function Hf which produces as a result the value ê=Hf(M) mod n=e*f mod n. Further, in step 5, the term ef is replaced with ê, such that {circumflex over (k)}−1(ef+{circumflex over (d)}r) mod n is replaced with {circumflex over (k)}−1(ê+{circumflex over (d)}r) mod n.
It should be understood that the present invention may be practiced upon any given computer system. A simplified example of a computer system upon which an embodiment of the invention may be performed is presented as a block diagram in
The computer 116 may contain one or more processors or microprocessors, such as a central processing unit (CPU) 120. The CPU 120 performs arithmetic calculations and control functions to execute software stored in an internal memory 122, preferably random access memory (RAM) and/or read only memory (ROM), and possibly additional memory 124. The additional memory 124 may include, for example, mass memory storage, hard disk drives, floppy disk drives, magnetic tape drives, compact disk drives, program cartridges and cartridge interfaces such as those found in video game devices, removable memory chips such as EPROM or PROM, or similar storage media as known in the art. This additional memory 124 may be physically internal to the computer 116, or external as in
The computer system 110 may also include other similar means for allowing computer programs or other instructions to be loaded. Such means can include, for example, a communications interface 126 which allows software and data to be transferred between the computer system 110 and external systems. Examples of communications interface 126 can include a modem, a network interface such as an Ethernet card, a serial or parallel communications port. Software and data transferred via communications interface 126 are in the form of signals which can be electronic, electromagnetic, and optical or other signals capable of being received by communications interface 126. Multiple interfaces, of course, can be provided on a single computer system 110.
Input and output to and from the computer 116 is administered by the input/output (I/O) interface 128. This I/O interface 128 administers control of the display 112, keyboard 114, external devices 118 and other such components of the computer system 110.
The invention is described in these terms for convenience purposes only. It would be clear to one skilled in the art that the invention may be applied to other computing apparatus or control systems 110. Thus the term computer apparatus is intended to include a variety of systems including all manner of appliances having computer or processor control including telephones, cellular telephones, televisions, television set top units, point of sale computers, automatic banking machines, lap top computers, servers, personal digital assistants and automobiles. Such computer apparatus may include additional components, or omit some of the components discussed above with reference to
Further it should be appreciate that the “offline” portions could be executed on a different computing apparatus than the computing apparatus which performs the signing operation. Further, the computing apparatus which executes the verification process will usually be different than the computing apparatus which executes the digital signing process, and the signed message is often transmitted via some medium. So an aspect of the invention is directed to a system comprising a signing computer apparatus for generating and transmitting a digital signature, and a verifying computer apparatus for verifying the signature. Further, an embodiment could include an additional computer apparatus for executing the preliminary steps of choosing f and producing the transformed key and transformed generator based on f.
In the preceding description, for purposes of explanation, numerous details are set forth in order to provide a thorough understanding of the embodiments of the invention. However, it will be apparent to one skilled in the art that these specific details are not required in order to practice the invention. In other instances, well-known electrical structures and circuits are shown in block diagram form in order not to obscure the invention. For example, specific details are not provided as to whether the embodiments of the invention described herein are implemented as a software routine, hardware circuit, firmware, or a combination thereof.
Embodiments of the invention can be represented as a software product stored in a machine-readable medium (also referred to as a computer-readable medium, a processor-readable medium, or a computer usable medium having a computer-readable program code embodied therein). The machine-readable medium can be any suitable tangible medium, including magnetic, optical, or electrical storage medium including a diskette, compact disk read only memory (CD-ROM), memory device (volatile or non-volatile), or similar storage mechanism. The machine-readable medium can contain various sets of instructions, code sequences, configuration information, or other data, which, when executed, cause a processor to perform steps in a method according to an embodiment of the invention. Those of ordinary skill in the art will appreciate that other instructions and operations necessary to implement the described invention can also be stored on the machine-readable medium. Software running from the machine-readable medium can interface with circuitry to perform the described tasks.
The above-described embodiments of the invention are intended to be examples only. Alterations, modifications and variations can be effected to the particular embodiments by those of skill in the art without departing from the scope of the invention, which is defined solely by the claims appended hereto.
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/CA2010/000486 | 3/31/2010 | WO | 00 | 9/27/2012 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2011/120125 | 10/6/2011 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
6668325 | Collberg et al. | Dec 2003 | B1 |
20050002532 | Zhou et al. | Jan 2005 | A1 |
20060020811 | Tan | Jan 2006 | A1 |
20060140401 | Johnson et al. | Jun 2006 | A1 |
20080201398 | Meyer | Aug 2008 | A1 |
20090094464 | Futa et al. | Apr 2009 | A1 |
20090252327 | Ciet et al. | Oct 2009 | A1 |
20100023771 | Struik | Jan 2010 | A1 |
Number | Date | Country |
---|---|---|
2003098962 | Apr 2003 | JP |
2003124928 | Apr 2003 | JP |
2004253950 | Sep 2004 | JP |
2006340347 | Dec 2006 | JP |
2011075720 | Apr 2011 | JP |
0124439 | May 2001 | WO |
0154346 | Jul 2001 | WO |
Number | Date | Country | |
---|---|---|---|
20130024699 A1 | Jan 2013 | US |