The present invention disclosed herein relates to a method for encryption authentication and decryption verification in an environment having restrictions in a memory use and an electronic apparatus including the same.
Due to development of hacking and various attack techniques, as necessity of a cryptographic module-based crypto operations is emerged, researches on a cryptographic method based on a crypto module become more important. A crypto module, which has secret information such as a secret key value, a temporary secret key, a secret nonce, or a password, and a cryptographic function therein, performs calculations within the module in order to be safe from an external attacker. Accordingly, the secret information may be protected and desired calculations may be safely performed by using the secret information.
It is necessary to design the crypto module to be safe from various attacks such as side-channel attacks or fault injection attacks, and since design and implementation costs increase as the area of the crypto module becomes larger, there is a limitation in available memory size in the crypto module.
While message hashing or authentication is typically implemented only with a small-sized memory, for encryption authentication and decryption verification that request message encryption and authentication, and verification at the same time, even a part of information on a plaintext that is desired to be protected, except for public information (e.g. additional data or public nonce), should not be exposed before an authentication code is not verified. Here, the encryption authentication refers to a process for generating a ciphertext and an authentication code from a given plaintext (at this point, public information such as additional data and a public nonce may be given therewith) by using secret information, and the decryption verification refers to a process for checking whether the authentication code is correct by using the given ciphertext and authentication code (at this point, the public information such as the additional data and public nonce may be given therewith) by using the secret information, and recovering a correct plaintext (or message) for the ciphertext only when the authentication code is correct.
For most of typical decryption verification methods, as the size of a ciphertext becomes larger, a requested memory size increases. Accordingly, for most of existing decryption verification methods, the decryption verification for big data is not realizable in a crypto module in which a memory use is limited.
Most of existing encryption authentication and decryption verification methods have been developed and used without any criterion for a request amount of memory use for determining whether the ciphertext is altered. Alternatively, since the encryption authentication and decryption verification are different, there are limitations in view of efficiency of implementation and an implementation cost. This is because it is burdensome to independently implement the encryption authentication and decryption verification. In addition, due to developments of various attack techniques such as hacking, as necessity for a crypto module emerges, a crypto module-based encryption authentication and decryption verification method becomes important. However, most of currently existing encryption authentication and decryption verification methods do not refer to a memory use at the time of verifying ciphertext alteration. Above all, in most of these encryption authentication and decryption verification methods, as the size of a target ciphertext becomes longer, a requested memory amount increases. Accordingly, it is necessary to develop a method for efficiently verifying ciphertext alteration with a small amount of memory use and safely outputting a plaintext. In addition, since the encryption authentication and decryption verification processes are most similarly designed, overlapping parts are minimized, efficiency of implementation is improved, and an implementation cost may be saved.
An embodiment of the present invention provides a method of encryption authentication and decryption verification of an electronic apparatus, which comprises a crypto module and a decryption module. The method includes: performing encryption authentication by performing a first crypto operation with a first function by using secret information, performing a second crypto operation with a second function by using a result value of the first crypto operation without the secret information, and performing a third crypto operation with a third function by using the result value of the first crypto operation or a result value of the second crypto operations and the secret information; and performing decryption verification by determining whether to output a value related to an entirety of or a part of the result value of the first crypto operation to the decryption module according to a result value of the third crypto operation.
In an embodiment, the secret information may be a secret key, temporary secret information, or a secret nonce.
In an embodiment, the secret information may be generated inside the crypto module.
In an embodiment, the first function may receive additional data from an outside of the crypto module.
In an embodiment, a result value of the first function may include at least one first output value or at least one second output value, wherein the at least one first output value is input to the second function.
In an embodiment, the second function may encrypt a plaintext into a ciphertext at a time of the encryption authentication.
In an embodiment, the third function may receive the at least one second output value of the first function or an output value of the second function, and generate an authentication code.
In an embodiment, the third function may compare the generated authentication code and an input authentication code at a time of the decryption verification to determine whether the authentication code is valid.
In an embodiment, a value associated to an entirety or a part of the at least one output value may not be output to the decryption module and the decryption operation may be terminated.
In an embodiment, when the authentication code is valid, the method may further include outputting a value associated with an entirety or a part of the at least one output value of the first function to the decryption module.
In an embodiment, the method may further include, in the decryption module, decrypting a plaintext by using the value associated with an entirety or a part of the at least one output value in the decryption module.
In an embodiment, the method may further include temporarily storing the at least one first output value or the at least one second output value in an internal memory of the crypto module.
In an embodiment of the present invention, an electronic apparatus includes: a crypt module configured to perform encryption authentication with a first function that uses secret information, a second function that does not use the secret information, and a third function that uses the secret information, or performing decryption verification with the first and third functions; and a decryption module configured to receive a result value of the first function according to a result value of the third function at the time of the decryption verification, and decrypt a plaintext by using a value associated with the result value of the first function.
In an embodiment, each of the first, second, and third functions may be based on a replacement function-based function.
In an embodiment, each of the first and third functions may perform the encryption authentication by using a shared secret key and a nonce.
In an embodiment, each of the first and third functions may perform the encryption authentication by using temporary secret information.
In an embodiment, each of the first, second, and third functions may be based on a block cipher-based function.
In an embodiment of the present invention, an method of encryption authentication and decryption verification of an electronic apparatus, which comprises a crypto module and a decryption module. The method includes: performing encryption authentication by a first crypto operation for generating a first output value by using an authentication code and secret information in a first function, performing a second crypt operation for outputting a ciphertext by using the first output value of the first crypto operation and a plaintext without the secret information in a second function, and generating the authentication code by using the secret information and the plaintext in a third function; and performing decryption verification by determining whether to output a value associated with an entirety or a part of a result value of the first crypto operation to the decryption module according to a result value of the third crypto operation.
In an embodiment, the first and third functions may perform the encryption authentication not by using a nonce value or a counter value, but by using a secret key shared between crypto modules.
In an embodiment, the first function may generate a cipher key to be used in the second function by using the shared secret key and the authentication code.
As described above, since the encryption authentication and decryption verification method may be safely implemented with a small sized memory by using logic operations according to the present invention, secret information may be safely protected.
A drawing showing a best mode of embodiments of the present invention is
Hereinafter, an exemplary embodiment of the present invention will be described in detail with reference to the accompanying drawings such that a person skilled in the art may easily carry out the embodiments of the present invention.
Most of typical encryption authentication and decryption verification methods have been designed only to highlight efficiency at the time of encryption authentication, and have been developed and used without any criterion for a requested amount of memory use for determining whether the ciphertext is altered. Due to developments of various attack techniques such as hacking, as necessity for a crypto module emerges, a crypto module-based encryption authentication and decryption verification method becomes important. However, most of currently existing encryption authentication method does not refer to a memory use at the time of verifying ciphertext alteration. Above all, in most of these encryption authentication methods, as the size of a target ciphertext becomes longer, a requested memory amount increases. Accordingly, it is necessary to develop a method for efficiently verifying ciphertext alteration with a small amount of memory use and safely outputting a plaintext. In addition, in order to improve an implementation efficiency and save an implementation cost, the encryption authentication and decryption verification are to be similarly designed.
Typically, in a decryption verification process, an authentication code value is checked for determining forgery or alteration of a ciphertext. Accordingly, for most of the methods, a crypto module has double burden to store a ciphertext or plaintext therein, or to encrypt the plaintext again and deliver it to the outside in order to hide the plaintext, until the authentication code value is checked.
A method for performing encryption again for decryption verification lowers an implementation efficiency, and also increases an implementation cost. Above all, it results an increase in communication amount between the crypto module and an external device. The present invention suggests a logic design through which decryption is verifiable by storing only internal state values having small sizes without storing a ciphertext or a message (or a plaintext) in a crypto module. In addition, since the encryption authentication process and the decryption verification process are based on a similar crypto operation, an implementation efficiency may be improved and an implementation cost may be lowered. In addition, the present invention is also advantageous in that it is not necessary to deliver any internal state information to the outside before only a specific internal state value is to be delivered to the outside. Accordingly, it may be maximized to reduce a communication load between an external device and a crypto module.
A method of encryption authentication and decryption verification according to an embodiment of the present invention is performed in an electronic apparatus, which includes a crypto module and a decryption module. The encryption authentication method includes: performing encryption authentication by performing a first crypto operation with a first function by using secret information, performing a second crypto operation with a second function by using a result value of the first crypto operation without the secret information, and performing a third crypto operation with a third function by using the result value of the first crypto operation or a result value of the second crypto operation, and the secret information. The decryption verification method includes determining whether to output a value related to an entirety of or a part of the result value of the first crypto operation to the decryption module according to a result value of the third crypto operation.
The crypto module 120 may include secret information such as a secret key, a temporary secret nonce, or a password, and a crypto function therein, and may perform a crypto operation to be safe from an external attacker. The crypto module 120 may be designed to be safe from various attacks such as side channel attacks or fault injection attacks, etc. Since design and implementation costs of the crypto module 120 increase as an area thereof becomes larger, there is a limitation in available memory size in the module. The configuration and operation principle of the crypto module 120 will be described below.
The crypto module 120 may implement a first function 121, a second function 122, and a third function 123 therein for encryption authentication.
The first function 121 receives additional data A from the outside, internally receives a nonce N and a secret key K, and generates at least one first output value OUT1 (or “a result value”), or at least one second output value OUT2 (or “a result value”). Here, the additional data A may be message head information. The first function may not use the additional data. In an embodiment, there may not be the second output value OUT2. When the nonce N is a public value, the value of nonce N may be input from the outside. The nonce value may be replaced with a public counter value. Instead of the secret key, temporary secret information such as a temporary secret nonce generated from the secret key may be received as an input.
The second function 122 receives a plaintext M from the outside and the first output value OUT1 from the first function 121, and generates a ciphertext C and at least one third output value OUT3 (or “result value”). In an embodiment, at the time of encryption operation, a plaintext M of a block unit is input and a ciphertext C of a block unit may be output. When there is a spare in memory size in the crypto module, the crypto operation may be performed in a unit of several blocks instead of a block unit. The second function may receive additional data, which is public information, public nonce value, or counter value, as an input besides the first output value and the plaintext.
The third function 123 receives the additional data A from the outside, the nonce N and secret key K from the inside, the second output value OUT2 from the first function 121, or the third output value OUT3 from the second function 122, and generates an authentication code T. At this point, the third output value OUT3 is necessarily received. At this point, the third function 123 may use only a part of the additional data A, the nonce N, the second output value OUT2, or the secret key value at the time of an actual operation. In addition, the third function 123 may determine whether the authentication code T, which is input from the outside, is valid at the time of a decryption verification operation. In the third function, the public information such as the additional data or the public nonce may not be used. Instead of the nonce or secret key, temporary secret information generated from the secret key may be used as an input value of the third function 123.
In an embodiment, at the time of encryption authentication operation in the crypto module 120, entire functions 121, 122, and 123 may be used, and at the time of decryption verification operation in the crypto module 120, some functions 121 and 123 and an inverse transform of the function 122 may be used.
The decryption module 140 positioned outside the crypto module may be realized with a decryption function 142 identical or similar to the second function 122 of the crypto module 120. The decryption function 142 receives the output value OUT1 of the first function 121 of the crypto module 120 or a modified value thereof OUT1′ and decrypts the ciphertext C into the plaintext M without information on the secret key K. At this point, the public additional data may be additionally used in the decryption function. Whether the value OUT1′ associated with (or related to) an entirety of or a part of the output value OUT1 of the first function 121 is transmitted to the decryption module 140 may be determined according to whether the input authentication code T is valid.
In an embodiment, the associated value is not an arbitrarily independent value, but refers to a case where one value influences another value. In another embodiment, the associated value may mean that a part of information on the other value is exposed through the one value. In another embodiment, the associated value means that the two value themselves have association. On the other hand, when there are two values of a and b, and the two values of a and b are defined to have a relation of a=b XOR r (where r is a random secret value), since the value of b may not be inferred from the value of a, a and b may be referred not to have association. In other words, if a and b are referred to have association, when a relation of a=f(b) is established by a certain function f that does not include secret information, a and b are referred to have association through the function f in the present invention.
Like this, a value delivered to the external decryption module 140 becomes OUT1′ associated with OUT1. At this point, a necessary condition is that the external decryption module may obtain, from T1′, minimum information for decrypting a ciphertext from OUT1′. Like this, it is the feature of the present invention that the crypto module delivers a value associated with an internal state value thereof to the external decryption module. The present invention is also designed to maximize an efficiency by delivering OUT1′ to the decryption module only once, not several times. When the authentication code T is valid, a value related to an entirety or a part of the output value OUT1 of the first function 121 is transmitted to the decryption module 140. In addition, since the first function 121, the second function 122, and the third function 123 are almost similarly used without a change, an implementation cost may be minimized.
In detail, encryption authentication and decryption verification processes using the crypto module 120 and decryption module 140 will be described in detail.
Firstly, the encryption authentication process will be described as follows. When the encryption authentication process is performed through the crypto module 120, additional data A and a plaintext M are received as an input from the outside. Here, the A may be a bin string or a value of A may not exist. In addition, the nonce value N may be a public value or a secret value. The nonce value may be received from the outside or not. The nonce value may be a random value or a counter value, or may be generated to have a certain pattern.
Then, the first function receives A, N, and K as an input inside the crypto module 120 (at this point, when N is temporary secret information, the secret key K may not be necessary), and outputs the first output value or the second output value (at this point, the second output value may not exist, while the first output value is essentially necessary). At this point, an entirety or a part of the first output value may be significantly used later in the decryption module 140. However, it is not necessary to store the first output value in the encryption authentication process.
Then, the second function receives the plaintext M in a block unit by using the first output information to generate ciphertext blocks and output the ciphertext blocks to the external device, and finally outputs the third output value. At this point, the crypto operation may be performed in a unit of several blocks summed without processing the plaintext or the ciphertext in a block unit. At this point, the public information such as the additional data or the public nonce may be used in the second function.
In the end, the third output value is received (at this point, there may not be the second output value nor be used) by using the third function to generate a final authentication code T and deliver the final authentication code T to the external device. The third function may use public information therewith besides the secret information.
The decryption verification process using the crypto module 120 and the external decryption module 140 will be described. In a case of performing the decryption verification, the crypto module receives, as an input, the addition information A, the ciphertext C, and the authentication code T from the outside. In some cases, when N is a public value, N may be received from the outside. In some cases, the additional data may not be present. In some cases, public information such as a counter may be received as an input.
Then, the first output value is generated by using the first function (at this point, second output value information may not be present nor be necessary), and at this point, a value associated with an entirety or a part of the first output value is stored in a memory inside the crypto module 120. Then an inverse operation process of the second function is performed. At this point, input values of the inverse operation process of the second function are the first output value and the ciphertext. (The ciphertext at this point may not be an entire ciphertext. For example, a remaining ciphertext except for C0 generated by using the secret information may be applied as the input value of the second function.) In addition, a value corresponding to the third output information is calculated in a state where the plaintext is not delivered to the external device. Here, the public information such as the additional data or the public nonce may be used therewith in order to perform the inverse operation process.
In the end, the third function inside the crypto module 120 generates an authentication code value T′ using the third output value (at this point, the second output may not be necessary). When T given from the external device and T′ are compared and T matches T′, the crypto module delivers a value OUT1′ related to the first output value OUT1, which is safely stored in a memory inside the crypto module, to the external decryption module 140 (at this point, OUT1 and OUT1′ may be the same or different. OUT1′ may be partial information of OUT1. However, an entirety or a part of information of OUT1, which is necessary for decryption, should be obtained by using OUT1′). Finally, an external device including the crypto module and the decryption module may decrypt the ciphertext into a final plaintext by using a second function′ 142 inside the decryption module 140. At this point, for decryption, the public information such as the additional data or the public nonce may be used.
In briefly, at the time of encryption authentication according to the
The first function 121 receives the secret key K, the nonce N, and the additional data A and outputs the first output value OUT1 and the second output value OUT2. At this point, only a part of the secret key, the nonce, and the additional data may be used. At this point, in some cases, there may not be the second output value OUT2. The second function 122 receives the first output value OUT1 and the plaintext M, and outputs the ciphertext C and the third output value OUT3. At this point, at the time of generating the ciphertext, the public information such as the additional data or the public nonce may be used together. The third function 123 receives the secret key K, the nonce N, the associate information A, the second output value OUT2, and the third output value OUT3, and outputs the authentication code T. Here, the secret key K is a secret key value, the nonce N is a random nonce value or a counter value, and the additional data A is public additional data. At this point, only a part of the secret key, the nonce, the additional data, and the second output value may be used in the third function.
Furthermore, an alteration verification and final plaintext output process according to the encryption authentication method illustrated in
In a first step, the crypto module 120 receives the additional data A, the ciphertext C, the authentication code T, and the nonce N from the electronic apparatus 100. Here, the nonce N may be received from the outside of the crypto module 120, or may be generated in the crypto module 120. Here, values received from the electronic apparatus 100 are not transmitted to the crypto module 120 at a time, but are transmitted block by block to a small memory inside the crypto module 120 (at this point, when there is a spare in the memory, several blocks may be transmitted at a time). The third function 123 of the crypto module 120 calculates the authentication code T.
In a second step, the first function 121 of the crypto module 120 calculates and stores the first output value OUT1 by using the input secret key K. In addition, the third function 123 verifies whether the final authentication code T is correct. When the calculated authentication code T does not match the input authentication code T, the input ciphertext C is treated as altered. Accordingly, any part of the plaintext is not output.
In a third step, when values of the calculated authentication code T and the input authentication code T match, the crypto module 120 outputs a value OUT1′ associated with an entirety or a part of the first output value OUT1 of the first function 121 to the decryption module 140 in the outside of the crypto module 120.
In a step 4, the decryption module 140 receives the OUT1′ having output to the outside of the crypto module 120 by using the decryption function 142, and decrypts the ciphertext C into a final plaintext M. At this point, in a process for decryption, the public information such as the additional data or the public nonce may be used together.
A first crypto operation is performed by the first function 121 (see
An encryption authentication method according to an embodiment of the present invention uses secret information, when the authentication code is verified in the crypto module 120, and performs the decryption operation for the ciphertext C without using the secret information in the external decryption module 140. Accordingly, the electronic apparatus of the present invention may minimize a memory use inside the crypto module 120 at the time of decryption operation, compared with that of a typical one.
The crypto module 120a illustrated in
The reason why the operation sequences of
In
Hereinafter, detailed embodiments of the encryption authentication and decryption verification according to an embodiment of the present invention will be described.
The crypto module 120 receives block by block starting from a first plaintext block M1 in a block unit of r bits from the outside. As illustrated in
At this point, the second function 122 never transmits a plaintext block value to the outside, but processes the ciphertext block information in real time without storing it and generates a third output value pair (OUT3_1, OUT3_2).
The third function 123 finally receives a value of the authentication code T from the outside and checks whether a calculated authentication code T is identical to the input authentication code T. At this point, when the value of the authentication code T is correct, the first function 121 transmits the first output value pair (OUT1_1, OUT1_2) of the first function 121 to the outside. On the other hand, when the value of the authentication code T is not correct, the decryption verification process is stopped and an error message is transmitted to the outside. The external decryption module 140 may decrypt the ciphertext C into the plaintext M by using the output first output value pair (OUT1_1, OUT1_2). The decryption module may use the public information such as the associated data or the public nonce as an input at the time of decryption.
The encryption authentication process is as the following. The crypto module 120 firstly receives the additional data A from the outside, a secret nonce N is randomly generated internally, and C0 generated from the secret nonce is transmitted to the outside by using the input secret key K. Each message block is received from the outside, one by one is processed from M1 and ciphertext blocks are generated in real time and transmitted to the outside. In the end, the authentication code T is generated by the secret nonce N and is transmitted to the outside.
The second function 122 receives ciphertext blocks one by one to calculate third output values (OUT3-1, OUT3_2). The third function 123 verifies, by using the secret nonce N, whether an authentication code T input from the outside is correct.
When the authentication code T is correct, the first output value pair (OUT1_1, OUT1_2) is transmitted to the external decryption module 140 and the decryption module 140 performs a decryption operation for a directly input ciphertext. At this point, during the decryption process, public information such as the additional data may be used. In addition, instead of directly transmitting the first output value pair, a value obtained by applying the first output value pair to a public replacement function may be transmitted to the decryption module. On the other hand, when the authentication code T is not correct, an error message is transmitted to the outside and the decryption verification process is terminated.
A crypto module of the other party, which has known the shared secret key K, may obtain the used temporary secret key pair (N, N′) from C0. At this point, in order to efficiently verify whether the temporary secret key pair (N, N′) is valid which is temporary secret information corresponding to the C0 value, an index corresponding to the temporary secret key pair (N, N′) may be transmitted therewith. Here, the index indicates an index used at the time of generating the temporary secret key with the shared key K. At the time of encryption authentication, the crypto module receives additional data A and plaintext blocks one by one from the outside, and generates ciphertext blocks in real time to transmit them to the outside. At this point, a padding method for a message may be any efficient and reversible method. In addition, in the end, an authentication code T is generated by using the temporary secret key pair and transmitted to the outside, and then the encryption authentication process is terminated.
When the C0 is not valid, the decryption verification process is stopped. On the other hand, when the C0 is valid, the decryption operation is performed by using the corresponding temporary secret key pair (N, N′). Finally when the authentication code T is correct, the first output value pair (OUT1_1, OUT1_2) is transmitted to the external decryption module 140, and the decryption module 140 may decrypt the ciphertext by using the input first output value pair (OUT1-1, OUT1_2).
Furthermore, detailed embodiments according to the encryption authentication and decryption verification schemes will be described with reference to
At this point, the MAC function may be sequentially processed in a block unit or in a unit of a small number of blocks. This is because at the time of decryption verification, when the decryption is performed by using a counter (CTR) mode, a plaintext block or plaintext blocks are received in a block unit or a small number of blocks, and the plaintext block or the plaintext blocks are delivered to the MAC function as an input thereof to generate the authentication code T in real time. In addition, the crypto module 120a encrypts the authentication code T to generate K* at the time of encryption authentication by using a key K shared between the crypto modules, and in the end, generates a ciphertext for the input plaintext with the authentication code T adopted as a counter in the CTR encryption mode and a value of K* adopted as the secret key K in the CTR mode. At this point, the value of K* is used as a one-time cipher key and a ciphertext may be generated by applying the one-time cipher key generated like this to various cipher modes as well as the CRT mode illustrated in
For decryption verification, the crypto module 120a firstly receives a nonce N, additional data A, and a ciphertext C, performs CTR decryption and at the same time, verifies a MAC value by using a message block obtained in real time, and verifies the authentication code T. When the authentication code T is not correct, the decryption verification is stopped. On the other hand, when the authentication code T is correct, the crypto module 120 calculates the ciphertext value of K* corresponding to the authentication code T by using the shared secret key and transmits the value of K* to the external device. Finally, the external device performs a decryption operation for the ciphertext by using an authentication code T and K*.
On the other hand, the foregoing description is about specific embodiments for practicing the present invention. The present invention encompasses the technical spirit of abstract and conceptual idea that may be used as a future technology as well as specific and actually useable means itself.
The present invention is applicable to all devices performing a crypto operation.
Number | Date | Country | Kind |
---|---|---|---|
10-2013-0070677 | Jun 2013 | KR | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/KR2014/005417 | 6/19/2014 | WO | 00 |