WO2014200301A1 - Electronic device with code module and method for processing code using same - Google Patents

Electronic device with code module and method for processing code using same Download PDF

Info

Publication number
WO2014200301A1
WO2014200301A1 PCT/KR2014/005200 KR2014005200W WO2014200301A1 WO 2014200301 A1 WO2014200301 A1 WO 2014200301A1 KR 2014005200 W KR2014005200 W KR 2014005200W WO 2014200301 A1 WO2014200301 A1 WO 2014200301A1
Authority
WO
WIPO (PCT)
Prior art keywords
secret key
temporary secret
value
temporary
message
Prior art date
Application number
PCT/KR2014/005200
Other languages
French (fr)
Korean (ko)
Inventor
장동훈
홍석희
Original Assignee
Chang Dong Hoon
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chang Dong Hoon filed Critical Chang Dong Hoon
Publication of WO2014200301A1 publication Critical patent/WO2014200301A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/71Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information

Definitions

  • the present invention relates to an electronic device having a cryptographic module and its cryptographic methods.
  • Template attack among side channel attacks is a powerful attack method that can be applied when the same encryption operation can be repeatedly performed. Thus, control over cryptographic operations is required so as not to repeat the same cryptographic operations.
  • DoS Denial of Service
  • the present invention proposes a cryptographic operation method that provides strong security against side channel attacks including DoS attacks and template attacks.
  • a method of decrypting an electronic device having an encryption module includes: receiving a message encrypted by a temporary secret key; On the basis of whether an entry consisting of the temporary secret key and a value (eg, hash or encryption, or the temporary secret key itself) for verifying the temporary secret key exists in the temporary secret key table of the cryptographic module. Determining whether the temporary secret key is valid; And if the temporary secret key is invalid, not decrypting the encrypted message.
  • a value eg, hash or encryption, or the temporary secret key itself
  • the method further includes decrypting the encrypted message.
  • determining whether the temporary private key is valid comprises determining that the temporary private key is invalid if the entry was used in a previous decryption operation.
  • the determining whether the temporary private key is valid may include determining that the temporary private key is not valid if the number of times the entry has been used in a previous decryption operation is greater than or equal to a predetermined value.
  • the temporary secret key table may include a plurality of entries including an index, a temporary secret key, and a verification value of the temporary secret key (for example, a verification value may be the temporary secret key itself). Include.
  • the method may further include deleting an entry for which a temporary secret key is not valid among the plurality of entries from the temporary secret table; And adding a new entry to the temporary secret table, the new entry consisting of a new index, a new temporary secret key corresponding to the new index, and a value for verifying the new temporary secret key.
  • the method may further include determining, from the temporary secret table, whether the number of entries in which the temporary secret key is invalid among the plurality of entries is greater than or equal to a predetermined value; and wherein the number of the invalid entries is determined in advance. Updating the temporary secret table when greater than or equal to the value.
  • the method may further include receiving an authentication code generated by the temporary secret key and the message.
  • the method may further include stopping the verification operation on the authentication code when the temporary secret key is invalid; And when the temporary secret key is valid, performing a verification operation on the authentication code.
  • the method may further include not decrypting the encrypted message when a verification operation for the authentication code fails.
  • the method may further include decrypting the encrypted message when the verification operation on the authentication code is successful.
  • An electronic device receives a message encrypted with a temporary secret key having a limit on the number of times of use, and based on whether a verification value corresponding to the temporary secret key exists in the temporary secret key table.
  • a temporary secret key manager for determining whether the secret key is valid; And a decryption unit that does not decrypt the encrypted message if the temporary secret key is invalid.
  • the temporary secret key manager generates another temporary secret key.
  • the cryptographic module includes an encryption unit for encrypting the message with another temporary secret key.
  • the cryptographic module uses a message authentication code and a cryptographic primitive function.
  • the message authentication code is generated to authenticate a message and additional head information of the message.
  • An encryption method of an electronic device having an encryption module may include generating a plurality of entries including a temporary secret key having a limit on the number of times of use and a verification value of the temporary secret key; Selecting any one of the plurality of entries; Encrypting the message using the temporary private key of the selected entry; And generating an authentication code using the used temporary secret key and the message.
  • the temporary secret key is generated on a sequential basis.
  • the temporary secret key is protected using an encryption operation, a hash function, or a synchronization operation.
  • the method may further include transmitting the verification value and the encrypted message to another cryptographic module.
  • the electronic device having the cryptographic module and the encryption / decryption methods thereof according to the present invention can fundamentally block the subchannel attack by stopping the decryption operation according to the number of times the temporary secret key is used.
  • FIG. 1 is a diagram illustrating an encryption system for explaining the concept of the present invention by way of example.
  • FIG. 2 is a flowchart illustrating an encryption method of an electronic device having an encryption module according to an embodiment of the present disclosure.
  • 3 is a diagram illustrating a secret secret key generation method by a sequential processing method.
  • FIG. 4 is a diagram illustrating an embodiment of a method of encrypting a temporary secret key.
  • FIG. 5 is a diagram illustrating an embodiment of a method of hashing a temporary secret key.
  • FIG. 6 illustrates a modified ECB mode according to an embodiment of the present invention.
  • FIG. 7 illustrates a modified CBC mode according to an embodiment of the present invention.
  • FIG 8 illustrates a modified CTR mode according to an embodiment of the present invention.
  • FIG. 9 is a flowchart illustrating a decryption method of an electronic device having an encryption module according to an embodiment of the present disclosure.
  • FIG. 10 is a flowchart exemplarily illustrating an encryption code-based encryption method (simple password authentication method) according to an embodiment of the present invention.
  • FIG. 11 is a diagram for describing a block cipher-based cipher authentication and decryption verification method according to an exemplary embodiment of the present invention.
  • FIG. 12 is a diagram illustrating a method of generating a mask train from a temporary secret nonce.
  • FIG. 13 is a diagram illustrating an example of a change to the checksum generation method illustrated in FIG. 11.
  • FIG. 14 is a diagram illustrating an example of changing a last message block processing method and a checksum illustrated in FIG. 11.
  • FIG. 15 is a diagram illustrating an example of changing a mask value applying method when processing the last message block illustrated in FIG. 14.
  • FIG. 16 is a diagram illustrating an example of a change to a case where the additional information shown in FIG. 14 is to be authenticated together.
  • 17 is a diagram illustrating an example of a method of updating a key of every block cipher without applying a mask value according to an embodiment of the present invention.
  • FIG. 18 is a diagram illustrating an example of a change to a case where the additional information shown in FIG. 17 is to be authenticated together.
  • FIG. 19 is a diagram illustrating an example of updating a key by using a temporary secret value when processing the last checksum illustrated in FIG. 17.
  • 20 is a diagram illustrating an example of defining a mask value using a key value of a block cipher according to an embodiment of the present invention.
  • 21 is a flowchart illustrating a decryption verification method of an electronic device having an encryption module according to an embodiment of the present disclosure.
  • FIG. 22 is a diagram illustrating an example of generating temporary secret nonce (Ni, Ni ') by a sequential processing method using a substitution function P according to an embodiment of the present invention.
  • FIG. 23 is a diagram illustrating an example of designing an encryption authentication scheme based on prefix free message padding based on a substitution function according to an embodiment of the present invention.
  • FIG. 24 is a diagram illustrating an example of designing an encryption authentication scheme based on arbitrary reversible message padding based on a substitution function according to an embodiment of the present invention.
  • FIG. 25 is a diagram illustrating an example of designing an encryption authentication scheme based on arbitrary reversible message padding using a substitution function and a non-zero constant value according to an embodiment of the present invention.
  • FIG. 26 is a diagram illustrating an example of a method of processing additional information illustrated in FIG. 23 and changing an authentication code value having an arbitrary length to be generated.
  • FIG. 27 is a diagram illustrating an example of generating temporary secret nonce (Ni, Ni ', Ni' ') by a sequential processing method using a compression function f according to an embodiment of the present invention.
  • FIG. 28 is a diagram illustrating an example of designing an encryption authentication scheme based on prefix free message padding based on a compression function f according to an embodiment of the present invention.
  • FIG. 29 is a diagram illustrating an example of designing an encryption authentication scheme based on arbitrary reversible message padding based on a compression function f according to an embodiment of the present invention.
  • FIG. 30 is a diagram illustrating an example of designing an encryption authentication scheme based on arbitrary reversible message padding using a compression function and a non-zero constant value.
  • 31 is a view showing a modified CBC mode according to an embodiment of the present invention.
  • FIG. 32 is a view showing a modified CBC mode according to an embodiment of the present invention.
  • 34 is a diagram showing PMAC.
  • TTK Table temporary secret key table
  • 36 is a diagram illustrating a temporary secret key table according to an embodiment of the present invention.
  • FIG. 37 is a diagram exemplarily illustrating a method for adding an entry of a temporary secret key table according to an embodiment of the present invention.
  • 38 is a diagram illustrating a temporary secret key table update method according to an embodiment of the present invention.
  • FIG. 1 is a view showing the best mode for practicing the present invention.
  • Template attack among side channel attacks is a powerful attack method that can be applied when the same encryption operation can be repeatedly performed. Thus, control over cryptographic operations is required so as not to repeat the same cryptographic operations.
  • DoS Denial of Service
  • the present invention proposes a cryptographic operation method that provides strong security against side channel attacks including DoS attacks and template attacks.
  • the cryptographic system 10 includes a first electronic device 100 and a second electronic device 200 that perform cryptographic communication through an external channel 11.
  • the external channel 11 may be a channel protected from an attacker's attack.
  • Each of the first electronic device 100 and the second electronic device 200 may include cryptographic modules 120 and 220 for performing cryptographic communication and cryptographic operation.
  • the first electronic device 100 transmits encrypted data generated by performing an encryption operation
  • the second electronic device 200 transmits the encrypted data received from the first electronic device 100.
  • the cryptographic operation includes various cryptographic operations such as encryption and decryption, authentication, digital signature, and key sharing.
  • the cryptographic module 120 of the first electronic device 100 includes a first temporary secret key manager 122 and an encryption unit 224.
  • the first temporary private key manager 122 generates a temporary private key ("TPK") required for the encryption operation.
  • the temporary secret key (TPK) has a limit on the number of uses. That is, the temporary secret key (TPK) can be used one or more times, but not more than that.
  • the temporary secret key (TPK) may be a temporary secret value (or key), such as a one-time password, secret nonce, session key.
  • the encryption unit 224 performs a cryptographic operation using the temporary secret key TPK.
  • the data values C generated through the encryption operation are transmitted to the external channel 11 through the internal channel 101 of the first electronic device 100. At this time, it is possible to transmit a value C0 that is difficult to infer corresponding to the temporary secret key TPK.
  • the transmitted verification value C0 is a verification value for the temporary secret key TPK.
  • the verification value C0 may be a hash value of the temporary secret key TPK.
  • the verification value C0 may be an authentication code value of the temporary secret key TPK.
  • the verification value C0 may be an encrypted value of the temporary secret key TPK.
  • the verification value C0 may be the same as or different from the verification value in the temporary secret value table in the cryptographic module.
  • the verification value which is the subject of verification in the temporary secret value table may be the temporary secret value
  • C0 may be the cipher text of the temporary secret value.
  • C0 can be an empty string.
  • the cryptographic module 200 of the second electronic device 200 includes a second temporary secret key manager 222 and a decryption unit 224.
  • the decryption unit 224 may include a process of performing decryption or verifying authentication.
  • the second temporary secret key manager 222 determines from C0 whether a corresponding temporary secret key (TPK) is in its internal memory, verifies / determines whether it is a valid temporary secret key (TPalid), and decrypts it accordingly.
  • Unit 224 may be activated. For example, if the temporary secret key TPK is a valid temporary TPK, an activation signal EN may be generated.
  • the decryption unit 224 performs a process on the encrypted data received from the first electronic device 100 in response to the activation signal EN.
  • each of the cryptographic modules 120 and 220 may be implemented so as not to trust the first electronic device 100 and the second electronic device 200, which are driving subjects.
  • the cryptographic modules 120 and 220 may share a secret key with each other in advance to generate temporary secret values.
  • the valid temporary TPK may be a temporary secret key that is not used in a previous cryptographic operation.
  • the valid temporary TPK may be a temporary private key used up to a predetermined number of times in a previous cryptographic operation.
  • the second temporary secret key manager 222 may verify / determine whether it is a valid temporary secret key (TPalid TPK) based on whether the temporary secret key (TPK) is used or how many times it is used.
  • the decryption unit 224 of the present invention does not initiate a decryption operation unless the temporary secret key TPK is not a valid temporary secret key TPK. That is, if the temporary secret key TPK is not a valid temporary TPK, the operation of the cryptographic module 220 may be immediately stopped.
  • the encryption module 120 of the first electronic device 100 is illustrated in terms of encryption, and the encryption module 220 of the second electronic device 200 is only illustrated in terms of decryption.
  • the cryptographic modules can perform various cryptographic operations, such as encryption and decryption and authentication, digital signature generation and verification.
  • the cryptographic module 120 of the first electronic device 100 may include components 222 and 224 of the cryptographic module 220 of the second electronic device 200, or may include the cryptographic module of the second electronic device 200.
  • 220 may include components 122 and 124 of the cryptographic module 12 of the first electronic device.
  • the cryptographic system 10 performs a cryptographic operation in consideration of whether the temporary secret key (TPK) is used in the previous cryptographic operation or the number of repetitive use, thereby subchannel and DoS attacks including template attacks. Secure cryptographic communication can be performed.
  • TPK temporary secret key
  • FIG. 2 is a flowchart illustrating an encryption method according to an embodiment of the present invention. 1 and 2, the encryption method is as follows.
  • a temporary secret key TPK that is not used in the temporary secret key manager 122 or used less than a predetermined number of times is generated (S110).
  • the temporary secret key (TPK) generated so as not to be known from the attacker is protected (S120).
  • the hash value C0 of the temporary secret key TPK may be generated to protect the temporary secret key TPK.
  • the message is encrypted using the temporary secret key TPK in the encryption unit 224 (S130). Finally, it sends an encrypted message to the other party with C0.
  • a temporary secret key is important secret information that will be used, such as a session key or a one-time password for performing cryptographic operations.
  • TPK temporary secret key
  • FIG. 3 is a diagram illustrating a secret secret key generation method by a sequential processing method.
  • a temporary secret key (TPK) or a nonce (N) value using a shared key K and a block cipher E shared between two cryptographic modules 120, 220 (see FIG. 1). are generated sequentially. If the first nonce (1, N1) is used for the first encryption operation, the second nonce (2, N2) is used for the next second encryption operation, and the third nonce (3, N3) for the third encryption operation. Will be used. Alternatively, temporary secret nonce values may be used in various ways. A characteristic of the sequential processing scheme shown in FIG.
  • TPK temporary secret key
  • the generated temporary secret key (TPK) is dangerous if known to the attacker.
  • the temporary secret key TPK can be protected by generating a verification value C0 for the temporary secret key TPK using the following three methods. The first is the encryption method, the second is the hash function, and the third is the temporary secret key (TPK) synchronization.
  • K is a secret key value shared between the two cryptographic modules 120, 220, and constant is any fixed constant value.
  • An encryption module eg, 120 of FIG. 1 wishing to perform encryption generates an encrypted nonce (C0) by encrypting the generated nonce (N), and encrypts the generated nonce (C0) with a relative cipher.
  • the encrypted nonce is a value that cannot be deduced by an attacker who does not know the shared key (K).
  • the XOR operation for protecting the nonce N from the encrypted nonce C0 may be efficiently implemented to be secured by the subchannel attack.
  • the value of the shared key K must be shared in advance between two correct devices which want to communicate.
  • the temporary secret key manager (e.g., 122) stores the nonce value and its index number in a table.
  • the table can be any memory space in the cryptographic module. For example, if you store (1, N1), (2, N2), and (3, N3) and use N1 and delete it, instead of (1, N1), instead of (1, N1), you fill the table with (4, N4) instead. You can add new nonce values to the table like this. If N1 is not used due to communication problems, N1 may be deleted after a certain time to prevent memory leaks.
  • the temporary secret key manager may add information on the number of times each nonce value is used to each entry in order to repeatedly use the nonce value up to a predetermined number.
  • FIG. 5 is a diagram illustrating a temporary secret key (TPK) protection according to the hash function (H) scheme by way of example.
  • the hash function H is a one-way hash function.
  • N temporary secret value
  • C0 hash value
  • the hash function H does not include any secret information. Also, without knowing the temporary secret key (TPK), the attacker will not be able to infer the hash value (C0).
  • the temporary secret value nonce N and its hash value C0 used for more than a limited number of times may be deleted from the table so that it is no longer available. That is, the corresponding entry can be deleted from the table.
  • the temporary secret key manager may add information on the number of times each nonce value is used to each entry in order to repeatedly use the nonce value up to a predetermined number.
  • each cryptographic module has a TPK table of the same size.
  • the sizes of the TPK tables may be different.
  • a table has 10 entries. The description here is based on hash. The temporary key usage count is 1, for example.
  • the TPK table may sort the entries by using the C0 value for efficient C0 search.
  • Step 2 After defining the table as in Step 1, the two cryptographic modules begin communicating.
  • the cryptographic data (C) obtained by performing a cryptographic operation using N values, which are temporary secret values, is transmitted to the counterpart according to a protocol established between the two devices.
  • N values which are temporary secret values
  • A sends to B.
  • the index is used from the smallest N values.
  • A generates the encrypted data C using the temporary secret value Ni used at any point in time.
  • the update time may be shortened by sorting the entries using the C0 value.
  • A sends C0_i value corresponding to Ni to C together with the cipher data C.
  • the index i value is not sent together.
  • the reason is that i is an index value, so that the attacker can easily infer and send (i, C0 ') to the attacker as if it were A, then B verifies that C0_i and C0_i' corresponding to Ni corresponding to i are the same. Or check if the hash value of Ni is equal to C0_i '. If an attacker repeatedly asks about the same i value, there is a risk that the Ni or C0_i value will be exposed by side channel attacks such as template attacks. Therefore, in the present invention, i value is not sent. B then checks if C0_i exists in its TPK table, and if C0_i does not exist, no further cryptographic operations are performed.
  • the cryptographic operation is performed using Ni. If there is an entry (j, Nj, C0_j) for all js less than or equal to i in B's TPK table, it is deleted and filled with new entries. In this case, instead of updating the entry every time, it may be a regular period, and the update time may be shortened by sorting the entries using the C0 value.
  • the temporary secret key validation method of the present invention is not limited to the above-described method, it can be implemented in various ways.
  • the hash value of the temporary secret key (TPK), which is a verification value corresponding to the temporary secret key, is sent to the counterpart.
  • the other party determines whether there is a corresponding temporary secret key (TPK) from C0, and if the temporary secret key (TPK) corresponding to C0 exists, determines that it is available and performs a cryptographic operation.
  • the verification value C0 here may be the same as or different from the verification value in the temporary secret key table owned by the temporary secret key manager.
  • TKI temporary secret key
  • FIGS. 6 to 8 are diagrams illustrating an encryption scheme according to an embodiment of the present invention.
  • N has been hashed.
  • H is a hash function and the block cipher key is updated each time using the temporary secret key (N).
  • M the final output value
  • C C0
  • An encryption scheme according to an embodiment of the present invention may be implemented such that the secret value N is not repeatedly used. This can be implemented with a temporary secret nonce value (N).
  • FIG. 6 is a diagram illustrating a modified electronic book (ECB) mode of a block cipher algorithm according to an embodiment of the present invention.
  • EBC electronic book
  • FIG. 7 illustrates a modified cipher-block chaining (CBC) mode of a block cipher algorithm according to an embodiment of the present invention.
  • CBC cipher-block chaining
  • FIG. 8 is a modified CTR (counter) mode of the block cipher algorithm according to an embodiment of the present invention.
  • a block cipher is used like a stream cipher.
  • the constant values (const, const + 1, const + 2, ...) entered into the blocks are counted up sequentially, and each block is encrypted with different keys generated from the given temporary secret value.
  • the encryption method of the present invention is not limited to the block encryption method shown in Figs. Similar to the above, it is applicable to encryption schemes based on various cryptographic primitives, such as block ciphers.
  • 9 is a flowchart illustrating a decoding method according to an embodiment of the present invention. 1 and 9, the decoding process proceeds as follows.
  • the encrypted message C is input to the second electronic device 200 through the external channel 11 (S210). It is determined whether the temporary secret key TPK used to generate the encrypted message C in the temporary secret key manager 222 is valid (S220). In other words, if the temporary secret key (TPK) has never been used in a previous encryption / decryption operation or the number of times of use does not exceed a predetermined value, the temporary secret key (TPK) is a valid temporary secret key (Valid TPK). If the temporary secret key TPK is valid, the message C encrypted by the decryption unit 224 is decrypted (S330). On the other hand, if the temporary secret key TPK is not valid, the operation of the encryption module 220 including the decryption unit 220 is stopped (S335).
  • the decryption operation after verifying the temporary secret key (TPK), the decryption operation may be determined according to the result.
  • the decryption step is to limit the number of times of use of the same verification value C0. For example, once used hashes or encrypted verification values C0 may no longer be used. Whether repeated use of the hash or the encrypted verification value C0 is important because implementations that are not guaranteed to be random are vulnerable to side channel attacks. Therefore, the temporary secret key (TPK) corresponding to the hash or encrypted verification value (C0) is determined by using a table managed by the temporary secret key manager, and is repeated if it is already used or for a limited number of times. If used, the decryption operation will be aborted.
  • TPK temporary secret key
  • the temporary secret key (TPK) After verifying that the temporary secret key (TPK) has not been used repeatedly, the temporary secret key (TPK) is calculated. After that, the decryption operation is performed on the input ciphertext C.
  • the encryption / decryption operation of the present invention may add an authentication method.
  • FIG. 10 is a flowchart exemplarily illustrating a block encryption method combining an authentication method according to an exemplary embodiment of the present invention.
  • the block encryption method proceeds as follows.
  • a temporary secret key (TPK) is generated based on the sequential processing (S310).
  • the temporary secret key verification value C0 is generated from the temporary secret key TPK generated using one of the three methods described above (encryption method, hash method, synchronization method) (S320).
  • Encryption method, hash method, synchronization method S320
  • fixed secret secret keys are not repeatedly used for a predetermined number.
  • the message is encrypted so that the internal state value is continuously changed, and an authentication code is generated (S330).
  • the nonce column is used to generate a mask column to protect the session key.
  • a mask value is used to protect input / output information of an encryption primitive using a session key.
  • cryptographic primitives include block ciphers, compression functions, substitution functions, and tweakable block ciphers.
  • FIG. 11 is a diagram illustrating a block ciphering operation for explaining a cipher authentication method according to an exemplary embodiment of the present invention.
  • FIG. 11 it is assumed that a modified offset code book (OCB) mode is used for convenience of description.
  • OBC offset code book
  • the size of the last unit message Mt may be selected from any value between 1 and the block size.
  • Const is a fixed constant value.
  • Const in different drawings is not the same constant value.
  • Const we write Const to mean a fixed constant. The same applies to the rest of the constant values, such as Const '.
  • the mask values Z1, Z2,... Generated from the temporary secret nonce N are used to protect the shared secret key K from side channel attacks in cryptographic authentication in FIG. 11.
  • the attacker can thoroughly hide the I / O information of the block cipher during the encryption authentication process. Therefore, the shared channel K value used for the block cipher by the subchannel attacker can be protected.
  • K may be a session key value.
  • the nonce and session key values can be maintained in a table like the TPK table generation method. In the case of the decryption verification process, only the temporary secret key used in the TPK table can be used to provide strong security against various side channel attacks.
  • a hash function based method is used when C0 occurs.
  • encryption-based, synchronization-based schemes may be used.
  • the method illustrated in FIG. 11 takes a method of generating mask values randomly as shown in FIG. 12 to provide strong safety against side channel attacks.
  • a mask value is also applied to the output of the block cipher when the last authentication code T value is generated to protect the shared key or session key K used.
  • the modified OCB mode shown in FIG. 11 may provide strong safety against side channel attacks.
  • FIG. 14 is a diagram illustrating an example of changing a last message block processing method and a checksum illustrated in FIG. 11.
  • FIG. 14 has a difference in the method of generating a checksum and processing of the last message block compared to that shown in FIG.
  • M arbitrary length
  • 10 * M1
  • Checksum a1 xor a2 xor ... xor at.
  • ai not the message block.
  • FIG. 15 is a diagram illustrating an example of changing a mask value applying method when processing the last message block illustrated in FIG. 14.
  • a mask value is defined as a value cyclically shifted using a constant value constant in the last message block shown in FIG. 14. The constant must not be zero or a multiple of the block size. As such, applying a different mask value when processing the last message block provides security against counterfeit attacks. Similarly, mask values can be changed for other structures.
  • FIG. 16 is a diagram illustrating an example of a change to a case where the additional information shown in FIG. 14 is to be authenticated together.
  • A a method of generating a cipher text and an authentication code in a case where additional information A is included in comparison with FIG. 14 is illustrated.
  • the additional information is referred to as A
  • A is padded.
  • the size of A should be a multiple of the block size.
  • a 10 * padding method may be used as the padding method.
  • checksum ⁇ 1 xor ...
  • the additional information may be extended to other cases.
  • FIG. 17 is a diagram illustrating an example of a method of updating a key of every block cipher without applying a mask value according to an embodiment of the present invention.
  • Const and Const ' are different constant values.
  • the key value used for the block cipher is updated every time without using mask values.
  • M M1
  • the size of the last Mt may take any value between 1 and the block size.
  • Checksum M1 xor M2 xor ... xor (Mt
  • FIG. 19 is a diagram illustrating an example of updating a key by using a temporary secret value when processing the last checksum illustrated in FIG. 17. Referring to FIG. 19, it is shown that the block cipher key is updated by using a temporary secret nonce (N) during the last checksum processing shown in FIG. 17. Similarly, other ways can be changed.
  • N temporary secret nonce
  • a checksum is generated by using the values of the plain text and the mask value after the XOR operation, not the checksum from the plain text itself.
  • 21 is a flowchart illustrating a decryption verification operation according to an embodiment of the present invention. 10 to 21, the decoding verification operation is as follows.
  • the encrypted message C and the authentication code T are input to the encryption module 240 (see FIG. 1) (S410). It is determined whether the temporary secret key TPK corresponding to the encrypted message C or the authentication code T is valid (S420). As described in the above-described decryption step, it is determined whether the temporary secret key (TPK) corresponding to C0 has been repeatedly used for a limited number of times. If the temporary secret key (TPK) is valid, the authentication code (T) is verified, and the decryption operation on the encrypted message (C) is performed (S440), while the temporary secret key (TPK) is not valid. If not, verification of the authentication code (T) is not in progress or the decryption operation for the encrypted message (C) is stopped (S445). That is, if the temporary secret key TTP has already been used for a limited number of times, the verification code T verification operation or decryption operation is immediately stopped.
  • FIG. 23 is a diagram illustrating an example of designing an encryption authentication scheme based on prefix free message padding based on a substitution function according to an embodiment of the present invention.
  • the substitution function-based encryption authentication and decryption verification process using the authentication method of the present invention are as follows.
  • the password authentication process proceeds as follows.
  • the temporary secret keys Ni, Ni ', i are integers
  • the verification key C0 is generated similarly, thereby protecting the temporary secret key TPK.
  • the encryption process is performed so that the internal state value is continuously changed by using a temporary secret key (TPK) generated to secure side channel attacks. That is, in the case where the shared key, session key, or temporary secret key are not repeatedly used in the base cryptographic primitive (here, substitution function or compression function), the reverse operation is performed by hiding a part or all of each input / output of the inner primitive. It also prevents attackers from knowing about forward operations. This prevents an attacker from obtaining the shared key, session key, or temporary secret key used.
  • TPK temporary secret key
  • FIG. 23 is a diagram illustrating an example of designing an encryption authentication scheme based on arbitrary reversible message padding based on a substitution function according to an embodiment of the present invention.
  • pad (M) M1
  • Mt is expressed.
  • the padding method pad must be prefix-free for safety reasons. This means that for any two different messages M, M ', pad (M) should never be a prefix of pad (M').
  • C ( C0
  • Ct) and an ⁇ bit value are generated for the message M.
  • 24 and 25 are diagrams exemplarily illustrating any reversible padding methods in which the message padding method shown in FIG. 23 is not prefix free.
  • FIG. 26 is a view illustrating a method of changing an authentication code value having an arbitrary length to output additional information shown in FIG. 14. Similarly, Figs. 25 and 26 may also be changeable.
  • the substitution function-based decoding process proceeds as follows. First, the temporary secret key verification value C0 is used to determine whether the temporary secret key TPK corresponding to the verification value C0 has been previously used. After verifying that the temporary secret key TPK has not been repeatedly used, the temporary secret key TPK is calculated, and a decryption operation and an authentication code verification operation on the input encrypted message C are performed. If the temporary secret key TPK corresponding to the verification value C0 is invalid, the decryption operation and the authentication code verification operation are immediately stopped.
  • FIG. 27 is a diagram illustrating an example of generating temporary secret nonce (Ni, Ni ', Ni' ') by a sequential processing method using a compression function f according to an embodiment of the present invention.
  • temporary secret keys Ni, Ni ', and Ni' ' are sequentially generated from the shared key K using the compression function f.
  • the generated temporary secret keys Ni, Ni ', and Ni' ' are protected as described above, and an encryption operation and an authentication code are generated using the temporary secret keys.
  • FIG. 28 is a diagram illustrating an example of designing an encryption authentication scheme based on prefix free message padding based on a compression function f according to an embodiment of the present invention.
  • pad (M) M1
  • the padding method pad should be prefix-free for safety reasons. This means that for any two different messages M, M ', pad (M) should never be a prefix of pad (M').
  • C ( C0
  • Ct) and an ⁇ bit value are generated.
  • 29 and 30 show an arbitrary reversible padding method in which the message padding method shown in FIG. 28 is not prefix free.
  • it can be changed to output an authentication code value of any length in the additional information in Figures 28, 29, and 30.
  • the temporary secret key (TPK) verification operation and thus decryption and authentication operation are similar to that of the substitution function.
  • the message authentication operation proceeds similarly to the message encryption operation.
  • FIG. 31 is a diagram illustrating a CBC MAC (cipher block chaining message authentication code) according to an embodiment of the present invention. Since the nonce value is not applied to the CBC MAC, the secret key value may be exposed in all block cipher operations. Therefore, a masking process is required so that the block cipher secret value is changed each time or the block cipher input / output value is not exposed as shown in the various examples.
  • CBC MAC cipher block chaining message authentication code
  • OMAC one-key MAC
  • H (Cst1) and H L (Cst2) can be used as a mask value of the last block cipher I / O value, using fixed constant values Cst1 and Cst2 instead of secret value (L).
  • H (N) and H '(N) are performed and taken as C
  • the nonce and the shared key value may be simultaneously entered into the H input value, and the nonce may be encrypted using the shared key K instead of hashing the temporary secret key TPK.
  • PMAC parallelizable MAC
  • the authentication code verification operation is performed according to the result after verifying that the temporary secret key (TPK) is not used repeatedly.
  • TTK Table temporary secret key table
  • the encryption / decryption operation proceeds as follows.
  • the encryption module A (eg, 120 of FIG. 1) selects any one of a plurality of entries of the temporary secret key table for the encryption operation (1). In the following description, it is assumed that the selected entry is (N3, C0_3) for convenience of description.
  • the cryptographic module A encrypts the message using the nonce value N3 contained in the selected entries N3, C0_3.
  • the encrypted message is then sent to the cryptographic module B (eg, 220 of FIG. 1). At this time, the cryptographic module B verifies whether a part of the encrypted message, that is, the verification value C0_3 corresponding to the nonce value N3 selected in the encryption operation, is included in the entries existing in the temporary secret key table ( 2). If the temporary secret key TPK is verified to be valid, the encryption module B proceeds to decrypt the encrypted message using this (3).
  • the temporary secret key table may further include an index to facilitate the search of the encrypted nonce value.
  • a temporary secret key table may be composed of a plurality of entries consisting of an index, a nonce value, and a hash value (or a verification value) thereof.
  • the two cryptographic modules (A, B) can start communication.
  • the cryptographic data (C) obtained by performing a cryptographic operation using N values, which are temporary secret values, is transmitted to the counterpart according to a protocol defined between the two electronic devices.
  • the encryption operation or the decryption operation uses N values with small indexes.
  • A generates the encrypted data C using the temporary secret value Ni used at any point in time.
  • the entry (i, Ni, C0_i) used in the temporary secret key table is deleted and filled with the new index.
  • the entry instead of updating the entry every time, the entry may be performed at regular intervals, and the search time may be shortened by sorting the entries using the verification value C0 during the update.
  • A sends the verification value C0_i corresponding to the nonce value Ni to the B together with the encrypted data C.
  • FIG. The index i value is not sent together. The reason is that i is an index value, so that the attacker can easily infer and send the attacker to (i, C0 ') by pretending to be A, then B is the verification value (C0_i) and C0_i' corresponding to Ni corresponding to i It will verify that it is the same. Or, it is checked whether the hash value of Ni is equal to the verification value C0_i '. If an attacker repeatedly asks about the same i value, there is a risk that the Ni or C0_i value will be exposed by side channel attacks such as template attacks.
  • B can check whether there is a verification value C0_i without knowing the index value i in its TPK table. If C0_i is missing, no further cryptographic operations are performed. If there is a C0_i value in the TPK table, the cryptographic operation is performed using Ni. Then, if there is an entry (j, Nj, C0_j) for all js less than or equal to i in B's TPK table, it is deleted and filled with new entries. In this case, instead of updating the entry every time, the entry may be performed at regular intervals, and the search time may be shortened by sorting the entries using the verification value C0 during the update.
  • FIG. 37 is a diagram exemplarily illustrating a method for adding an entry of a temporary secret key table according to an embodiment of the present invention.
  • the first nonce N1 is used for an encryption operation or a decryption operation.
  • the entries N1 and CO_1 used are invalidation data in the temporary secret key table.
  • the cryptographic module can then add a new entry consisting of a new nonce (Nk + 1) and its hash value (CO_k + 1) to the temporary secret key table.
  • the method for adding an entry of the temporary secret key table shown in FIG. 37 is merely an embodiment.
  • the method of adding an entry of the temporary secret key table of the present invention can be implemented in various ways.
  • the present invention can be implemented to update the temporary secret key table if the number of entries used in the temporary secret key table is greater than or equal to a predetermined number.
  • the schemes introduced in FIGS. 35 to 37 may be similarly used for various encryption operations such as encryption, decryption verification, authentication code generation and verification, as well as encryption and decryption.
  • k entries may be newly generated when a predetermined condition is satisfied.
  • the predetermined condition may be whether the number of entries used for the encryption / decryption operation is equal to or greater than the predetermined number.
  • a general cryptographic system is implemented in such a way that a counterpart calculates a temporary secret key value by performing a cryptographic operation by passing a counter to the counterpart.
  • the counter value does not decrease and increases.
  • the cryptographic operation based on the counter value has the advantage that it can be used to shorten the search time and the small memory, etc. The reason is that the counter value does not decrease and increases, so even if a secret counter value is used, a legitimate counter value can be easily derived.
  • Another cryptographic system is implemented to perform decryption without limiting the number of random ciphertexts, while providing security for side channel attacks without the need to maintain counter values.
  • a method of adding a process of authenticating each message block is presented.
  • this repeated authentication process is inefficient in an environment where communication efficiency is important, and in a battery-based environment, energy consumption increases, which makes it difficult to use.
  • An encryption system can maximize communication efficiency and minimize energy consumption.
  • the cryptographic system of the present invention is implemented not to send counter values that are easily inferred in the future to the counterpart, but only to the counterpart, such as hash values, to be validated before the cryptographic operation begins. Unlike conventional methods, it does not use counters, so it provides security for template attacks and validates before the start of cryptographic operations. Therefore, it can efficiently detect DoS attacks.
  • the cryptographic system of the present invention may specifically perform encryption and decryption and authentication to be safe from side channel attacks.
  • the present invention can be applied to various cryptographic operations such as authentication code generation, digital signature, key authentication, key exchange, etc.
  • the present invention has shown the invention and specific embodiments thereof, and includes all techniques that can be easily inferred therefrom. do.
  • the present invention is applicable to any device that performs cryptographic operations.

Abstract

An electronic device according to the present invention includes: a temporary password key manager for receiving a message encrypted with a temporary password key limited in the number of uses and determining whether the temporary password key is effective depending on whether a proof value corresponding to the temporary password key exists in a temporary password key table; and a code module including a decryption unit for not decrypting the encrypted message if the temporary password key is not effective.

Description

암호 모듈을 갖는 전자 장치 및 그것의 암호연산 방법들Electronic device having cryptographic module and its cryptographic methods
본 발명은 암호 모듈을 갖는 전자 장치 및 그것의 암호연산 방법들에 관한 것이다.The present invention relates to an electronic device having a cryptographic module and its cryptographic methods.
해킹 기법이 발달함에 따라 이에 대한 대응 비용 또한 증가하고 있다. 특히 RFID, 스마트카드, 스마트폰, 센서, 유비쿼터스, 사물 인터넷과 같은 하드웨어기반 신규 구현 환경 및 기술이 도래함에 따라 이들의 통신 환경에 사용될 수 있는 저전력, 저비용, 고효율, 높은 안전성을 제공하는 암호 통신 기법에 대한 요구가 점점 커지고 있는 상황이다. As hacking techniques evolve, the cost of response increases. In particular, with the advent of new hardware-based implementation environments and technologies such as RFID, smart cards, smartphones, sensors, ubiquitous, and the Internet of Things, cryptographic communication techniques that provide low power, low cost, high efficiency, and high security that can be used in their communication environments. The demand for is increasing.
해킹에 대한 대응 비용 측면에서 가장 걸림돌이 되는 공격으로 부채널 공격이 있다. 특히 전자파, 소리 등을 이용한 부채널 공격들은 탐지도 어려울 뿐만 아니라 쉽게 습득이 가능한 공격 정보이기 때문에, 이에 대한 보안 대책이 수립되어야 한다. 그러나 과도한 구현 비용의 증가로 말미암아 실제 대응 기법 구현하는 데에는 어려움이 있는 상황이다.One of the most obstacles in terms of countermeasures against hacking is side channel attack. In particular, since subchannel attacks using electromagnetic waves and sound are not only difficult to detect but also easily obtainable attack information, security measures should be established. However, due to the excessive increase in the implementation cost, it is difficult to implement the actual response method.
부채널 공격 중에서 Template 공격은 동일 암호 연산을 반복적으로 수행할 수 있는 경우에 적용될 수 있는 강력한 공격 방법이다. 따라서, 동일한 암호 연산을 반복적으로 하지 않도록 암호 연산에 대한 컨트롤이 요구된다. Template attack among side channel attacks is a powerful attack method that can be applied when the same encryption operation can be repeatedly performed. Thus, control over cryptographic operations is required so as not to repeat the same cryptographic operations.
또한, 동시에 DoS(Denial of Service) 공격에 대한 안전성도 고려해야 한다. DoS 공격의 경우, 리소스들을 낭비하도록 하게 하여, 배터리 기반 기기의 수명을 줄일 뿐 아니라, 정당한 암호 연산 마저 하지 못하게 막는 경우도 발생하게 된다. 따라서 DoS 공격과 같이 리소스를 낭비하도록 하는 공격자의 공격 징후를 빨리 탐지하여 차단하는 것이 중요하다. At the same time, you must also consider the safety against Denial of Service (DoS) attacks. In the case of DoS attacks, resources are wasted, which not only shortens the life of battery-based devices, but also prevents legitimate cryptographic operations. Therefore, it is important to quickly detect and block the attacker's indications of wasting resources such as DoS attacks.
본 발명에서는 DoS 공격과 Template 공격을 포함한 부채널 공격에 강한 안전성을 제공하는 암호연산 방법에 대해 제안한다. The present invention proposes a cryptographic operation method that provides strong security against side channel attacks including DoS attacks and template attacks.
본 발명의 실시 예에 따른 암호 모듈을 갖는 전자 장치의 복호화 방법은: 임시 비밀키에 의해 암호화된 메시지를 입력 받는 단계; 상기 임시 비밀키와 상기 임시 비밀키의 검증을 위한 값(예를 들어, 해쉬 혹은 암호화, 또는 상기 임시 비밀 키 자신)으로 구성된 엔트리가 상기 암호 모듈의 임시 비밀키 테이블에 존재하는 지를 근거로 하여 상기 임시 비밀키가 유효한 지를 판별하는 단계; 및 상기 임시 비밀키가 유효하지 않다면, 상기 암호화된 메시지를 복호화하지 않는 단계를 포함한다.According to an embodiment of the present disclosure, a method of decrypting an electronic device having an encryption module includes: receiving a message encrypted by a temporary secret key; On the basis of whether an entry consisting of the temporary secret key and a value (eg, hash or encryption, or the temporary secret key itself) for verifying the temporary secret key exists in the temporary secret key table of the cryptographic module. Determining whether the temporary secret key is valid; And if the temporary secret key is invalid, not decrypting the encrypted message.
실시 예에 있어서, 상기 임시 비밀키가 유효하다면, 상기 암호화된 메시지를 복호화하는 단계를 더 포함한다.In an embodiment, if the temporary secret key is valid, the method further includes decrypting the encrypted message.
실시 예에 있어서, 상기 임시 비밀키가 유효한 지를 판별하는 단계는, 상기 엔트리가 이전 암복호화 동작에서 사용되었다면, 상기 임시 비밀키를 유효하지 않다고 판별하는 단계를 포함한다.In an embodiment, determining whether the temporary private key is valid comprises determining that the temporary private key is invalid if the entry was used in a previous decryption operation.
실시 예에 있어서, 상기 임시 비밀키가 유효한 지를 판별하는 단계는, 상기 엔트리가 이전 암복호화 동작에서 사용된 회수가 사전에 결정된 값 이상이면, 상기 임시 비밀키를 유효하지 않다고 판별하는 단계를 포함한다.In an embodiment, the determining whether the temporary private key is valid may include determining that the temporary private key is not valid if the number of times the entry has been used in a previous decryption operation is greater than or equal to a predetermined value. .
실시 예에 있어서, 상기 임시 비밀키 테이블은 인덱스, 임시 비밀키 및 상기 임시 비밀키의 검증값(이때, 예를 들어, 검증 값은 상기 임시 비밀키 자신이 될 수 있음)으로 구성된 복수의 엔트리들을 포함한다.The temporary secret key table may include a plurality of entries including an index, a temporary secret key, and a verification value of the temporary secret key (for example, a verification value may be the temporary secret key itself). Include.
실시 예에 있어서, 상기 임시 비밀 테이블로부터 상기 복수의 엔트리들 중에서 임시 비밀키가 유효하지 않은 엔트리를 삭제하는 단계; 및 상기 임시 비밀 테이블에 새로운 인덱스, 상기 새로운 인덱스에 대응하는 새로운 임시 비밀키 및 상기 새로운 임시 비밀키를 검증하기 위한 값으로 구성된 새로운 엔트리를 추가하는 단계를 더 포함한다.The method may further include deleting an entry for which a temporary secret key is not valid among the plurality of entries from the temporary secret table; And adding a new entry to the temporary secret table, the new entry consisting of a new index, a new temporary secret key corresponding to the new index, and a value for verifying the new temporary secret key.
실시 예에 있어서, 상기 임시 비밀 테이블로부터 상기 복수의 엔트리들 중에서 임시 비밀키가 유효하지 않은 엔트리들의 개수가 사전에 결정된 값 이상인 지를 판별하는 단계;및 상기 유효하지 않은 엔트리들의 개수가 상기 사전에 결정된 값 이상일 때, 상기 임시 비밀 테이블을 업데이트하는 단계를 더 포함한다.The method may further include determining, from the temporary secret table, whether the number of entries in which the temporary secret key is invalid among the plurality of entries is greater than or equal to a predetermined value; and wherein the number of the invalid entries is determined in advance. Updating the temporary secret table when greater than or equal to the value.
실시 예에 있어서, 상기 임시 비밀키와 메시지에 의해 발생된 인증 코드를 입력 받는 단계를 더 포함한다.In an embodiment, the method may further include receiving an authentication code generated by the temporary secret key and the message.
실시 예에 있어서, 상기 임시 비밀키가 유효하지 않을 때, 상기 인증 코드에 대한 검증 동작을 중단하는 단계; 및 상기 임시 비밀키가 유효할 때, 상기 인증 코드에 대한 검증 동작을 수행하는 단계를 더 포함한다.The method may further include stopping the verification operation on the authentication code when the temporary secret key is invalid; And when the temporary secret key is valid, performing a verification operation on the authentication code.
실시 예에 있어서, 상기 인증 코드에 대한 검증 동작이 실패하였을 때, 상기 암호화된 메시지를 복호화하지 않는 단계를 더 포함한다.The method may further include not decrypting the encrypted message when a verification operation for the authentication code fails.
실시 예에 있어서, 상기 인증 코드에 대한 검증 동작이 성공하였을 때, 상기 암호화된 메시지를 복호화하는 단계를 더 포함한다.The method may further include decrypting the encrypted message when the verification operation on the authentication code is successful.
본 발명의 실시 예에 따른 전자 장치는, 사용 회수의 제한을 갖는 임시 비밀키로 암호화된 메시지를 입력 받고, 상기 임시 비밀키에 대응하는 검증값이 임시 비밀키 테이블에 존재하는 지를 근거로 하여 상기 임시 비밀키가 유효한 지 판별하는 임시 비밀키 매니저; 및 상기 임시 비밀키가 유효하지 않다면, 상기 암호화된 메시지를 복호화하지 않는 복호화 유닛;을 포함하는 암호 모듈을 갖는다.An electronic device according to an embodiment of the present disclosure receives a message encrypted with a temporary secret key having a limit on the number of times of use, and based on whether a verification value corresponding to the temporary secret key exists in the temporary secret key table. A temporary secret key manager for determining whether the secret key is valid; And a decryption unit that does not decrypt the encrypted message if the temporary secret key is invalid.
실시 예에 있어서, 상기 임시 비밀키 매니저는 다른 임시 비밀키를 발생한다.In an embodiment, the temporary secret key manager generates another temporary secret key.
실시 예에 있어서, 상기 암호 모듈은 다른 임시 비밀키로 메시지를 암호화시키는 암호화 유닛을 포함한다.In an embodiment, the cryptographic module includes an encryption unit for encrypting the message with another temporary secret key.
실시 예에 있어서, 상기 암호 모듈은 메시지 인증 코드 및 암호 프리미티브(cryptographic primitive) 함수를 사용한다.In an embodiment, the cryptographic module uses a message authentication code and a cryptographic primitive function.
실시 예에 있어서, 상기 메시지 인증 코드는 메시지와 상기 메시지의 부가 헤드 정보를 인증하기 위해 발생된다.In an embodiment, the message authentication code is generated to authenticate a message and additional head information of the message.
본 발명의 실시 예에 따른 암호 모듈을 갖는 전자 장치의 암호화 방법은, 사용 회수의 제한을 갖는 임시 비밀키 및 상기 임시 비밀키의 검증값으로 구성된 복수의 엔트리들을 발생하는 단계; 상기 복수의 엔트리들 중 어느 하나를 선택하는 단계; 상기 선택된 엔트리의 임시 비밀키를 이용하여 메시지를 암호화하는 단계; 및 상기 이용된 임시 비밀키 및 상기 메시지를 이용하여 인증 코드를 발생하는 단계를 포함한다.An encryption method of an electronic device having an encryption module according to an embodiment of the present disclosure may include generating a plurality of entries including a temporary secret key having a limit on the number of times of use and a verification value of the temporary secret key; Selecting any one of the plurality of entries; Encrypting the message using the temporary private key of the selected entry; And generating an authentication code using the used temporary secret key and the message.
실시 예에 있어서, 상기 임시 비밀키는 순차처리 기반으로 발생된다.In an embodiment, the temporary secret key is generated on a sequential basis.
실시 예에 있어서, 상기 임시 비밀키는, 암호화 동작, 해쉬 함수, 혹은 동기화 동작을 이용하여 보호된다.In an embodiment, the temporary secret key is protected using an encryption operation, a hash function, or a synchronization operation.
실시 예에 있어서, 상기 검증값 및 상기 암호화된 메시지를 다른 암호 모듈로 전송하는 단계를 더 포함한다.In an embodiment, the method may further include transmitting the verification value and the encrypted message to another cryptographic module.
상술한 바와 같이 본 발명에 따른 암호 모듈을 갖는 전자 장치 및 그것의 암복호화 방법들은, 임시 비밀키의 사용 회수에 따라 복호화 동작을 중단함으로써, 부채널 공격을 원천적으로 차단할 수 있다.As described above, the electronic device having the cryptographic module and the encryption / decryption methods thereof according to the present invention can fundamentally block the subchannel attack by stopping the decryption operation according to the number of times the temporary secret key is used.
도 1은 본 발명의 개념을 설명하기 위한 암호 시스템을 예시적으로 보여주는 도면이다.1 is a diagram illustrating an encryption system for explaining the concept of the present invention by way of example.
도 2는 본 발명의 실시 예에 따른 암호 모듈을 갖는 전자 장치의 암호화 방법에 대한 흐름도이다.2 is a flowchart illustrating an encryption method of an electronic device having an encryption module according to an embodiment of the present disclosure.
도 3은 순차 처리 방식에 의한 비밀 비밀키 발생 방법을 예시적으로 보여주는 도면이다.3 is a diagram illustrating a secret secret key generation method by a sequential processing method.
도 4는 임시 비밀키를 암호화 하는 방식에 대한 실시 예를 보여주는 도면이다.4 is a diagram illustrating an embodiment of a method of encrypting a temporary secret key.
도 5는 임시 비밀키를 해쉬하는 방식에 대한 실시 예를 보여주는 도면이다.5 is a diagram illustrating an embodiment of a method of hashing a temporary secret key.
도 6은 본 발명의 실시 예에 따른 변형된 ECB 모드를 보여주는 도면이다.6 illustrates a modified ECB mode according to an embodiment of the present invention.
도 7은 본 발명의 실시 예에 따른 변형된 CBC 모드를 보여주는 도면이다.7 illustrates a modified CBC mode according to an embodiment of the present invention.
도 8은 본 발명의 실시 예에 따른 변형된 CTR 모드를 보여주는 도면이다.8 illustrates a modified CTR mode according to an embodiment of the present invention.
도 9는 본 발명의 실시 예에 따른 암호 모듈을 갖는 전자 장치의 복호화 방법에 대한 흐름도이다.9 is a flowchart illustrating a decryption method of an electronic device having an encryption module according to an embodiment of the present disclosure.
도 10은 본 발명의 실시 예에 따른 인증 코드 기반의 암호화 방법(간단히 암호 인증 방법)을 예시적으로 보여주는 흐름도이다.10 is a flowchart exemplarily illustrating an encryption code-based encryption method (simple password authentication method) according to an embodiment of the present invention.
도 11은 본 발명의 실시 예에 따른 블록 암호 기반 암호 인증 및 복호 검증 방법을 설명하기 위한 도면이다.11 is a diagram for describing a block cipher-based cipher authentication and decryption verification method according to an exemplary embodiment of the present invention.
도 12는 임시 비밀 난스로부터 마스크 열을 발생하는 방법을 예시적으로 보여주는 도면이다.12 is a diagram illustrating a method of generating a mask train from a temporary secret nonce.
도 13은 도 11에 도시된 체크썸(Checksum) 발생 방법에 대한 변경의 예를 보여주는 도면이다.FIG. 13 is a diagram illustrating an example of a change to the checksum generation method illustrated in FIG. 11.
도 14는 도 11에 도시된 마지막 메시지 블록 처리 방식 및 체크썸(Checksum) 변경의 예를 보여주는 도면이다.FIG. 14 is a diagram illustrating an example of changing a last message block processing method and a checksum illustrated in FIG. 11.
도 15는 도 14에 도시된 마지막 메시지 블록 처리 시 마스크 값 적용 방식의 변경의 예를 보여주는 도면이다.FIG. 15 is a diagram illustrating an example of changing a mask value applying method when processing the last message block illustrated in FIG. 14.
도 16은 도 14에 도시된 부가정보를 함께 인증하고자 할 경우에 대한 변경의 예를 보여주는 도면이다.FIG. 16 is a diagram illustrating an example of a change to a case where the additional information shown in FIG. 14 is to be authenticated together.
도 17은 본 발명의 실시 예에 따른 마스크 값 적용 없이 매 블록 암호의 키를 갱신하는 방식의 예를 보여주는 도면이다.17 is a diagram illustrating an example of a method of updating a key of every block cipher without applying a mask value according to an embodiment of the present invention.
도 18은 도 17에 도시된 부가정보를 함께 인증하고자 할 경우에 대한 변경의 예를 보여주는 도면이다.FIG. 18 is a diagram illustrating an example of a change to a case where the additional information shown in FIG. 17 is to be authenticated together.
도 19는 도 17에 도시된 마지막 체크썸(Checksum) 처리시 임시 비밀 값을 이용하여 키를 갱신하는 예를 보여주는 도면이다.FIG. 19 is a diagram illustrating an example of updating a key by using a temporary secret value when processing the last checksum illustrated in FIG. 17.
도 20은 본 발명의 실시 예에 따른 블록 암호의 키 값을 이용하여 마스크 값을 정의하는 경우에 대한 예를 보여주는 도면이다.20 is a diagram illustrating an example of defining a mask value using a key value of a block cipher according to an embodiment of the present invention.
도 21은 본 발명의 실시 예에 따른 암호 모듈을 갖는 전자 장치의 복호 검증 방법에 대한 흐름도이다.21 is a flowchart illustrating a decryption verification method of an electronic device having an encryption module according to an embodiment of the present disclosure.
도 22는 본 발명의 실시 예에 따른 치환 함수(P)를 이용하여 순차 처리 방식에 의한 임시 비밀 난스들(Ni, Ni')을 발생하는 예를 보여주는 도면이다. FIG. 22 is a diagram illustrating an example of generating temporary secret nonce (Ni, Ni ') by a sequential processing method using a substitution function P according to an embodiment of the present invention.
도 23은 본 발명의 실시 예에 따른 치환 함수에 기반하여 프리픽스 프리(prefix free) 메시지 패딩에 기반한 암호인증 방식을 설계하는 예를 보여주는 도면이다.FIG. 23 is a diagram illustrating an example of designing an encryption authentication scheme based on prefix free message padding based on a substitution function according to an embodiment of the present invention.
도 24는 본 발명의 실시 예에 따른 치환 함수에 기반하여 임의의 리버서블(reversible) 메시지 패딩에 기반한 암호인증 방식을 설계하는 예를 보여주는 도면이다.FIG. 24 is a diagram illustrating an example of designing an encryption authentication scheme based on arbitrary reversible message padding based on a substitution function according to an embodiment of the present invention.
도 25는 본 발명의 실시 예에 따른 치환 함수와 논-제로(non-zero) 상수 값을 이용하여 임의의 리버서블(reversible) 메시지 패딩에 기반한 암호인증 방식을 설계하는 예를 보여주는 도면이다.FIG. 25 is a diagram illustrating an example of designing an encryption authentication scheme based on arbitrary reversible message padding using a substitution function and a non-zero constant value according to an embodiment of the present invention.
도 26은 도 23에 도시된 부가정보를 처리하고 임의의 길이의 인증코드 값을 발생할 수 있도록 변경하는 방식에 대한 예를 보여주는 도면이다.FIG. 26 is a diagram illustrating an example of a method of processing additional information illustrated in FIG. 23 and changing an authentication code value having an arbitrary length to be generated.
도 27은 본 발명의 실시 예에 따른 압축 함수(f)를 이용하여 임시 비밀 난스들(Ni,Ni', Ni'')을 순차 처리 방식에 의해 발생하는 예를 보여주는 도면이다.27 is a diagram illustrating an example of generating temporary secret nonce (Ni, Ni ', Ni' ') by a sequential processing method using a compression function f according to an embodiment of the present invention.
도 28은 본 발명의 실시 예에 따른 압축 함수(f)에 기반하여 프리픽스 프리(prefix free) 메시지 패딩에 기반한 암호인증 방식을 설계하는 예를 보여주는 도면이다.FIG. 28 is a diagram illustrating an example of designing an encryption authentication scheme based on prefix free message padding based on a compression function f according to an embodiment of the present invention.
도 29은 본 발명의 실시 예에 따른 압축 함수(f)에 기반하여 임의의 리버서블(reversible) 메시지 패딩에 기반한 암호인증 방식을 설계하는 예를 보여주는 도면이다.FIG. 29 is a diagram illustrating an example of designing an encryption authentication scheme based on arbitrary reversible message padding based on a compression function f according to an embodiment of the present invention.
도 30은 압축 함수와 논-제로(non-zero) 상수 값을 이용하여 임의의 리버서블(reversible) 메시지 패딩에 기반한 암호인증 방식을 설계하는 예를 보여주는 도면이다.30 is a diagram illustrating an example of designing an encryption authentication scheme based on arbitrary reversible message padding using a compression function and a non-zero constant value.
도 31은 발명의 실시 예에 따른 변형된 CBC 모드를 보여주는 도면이다.31 is a view showing a modified CBC mode according to an embodiment of the present invention.
도 32는 본 발명의 실시 예에 따른 변형된 CBC 모드를 보여주는 도면이다.32 is a view showing a modified CBC mode according to an embodiment of the present invention.
도 33은 OMAC을 보여주는 도면이다.33 shows OMAC.
도 34는 PMAC을 보여주는 도면이다.34 is a diagram showing PMAC.
도 35는 본 발명의 실시 예에 따른 임시 비밀키 테이블(TPK Table)을 이용한 암복호화 동작을 예시적으로 설명하는 도면이다.35 is a diagram exemplarily illustrating an encryption / decryption operation using a temporary secret key table (TPK Table) according to an embodiment of the present invention.
도 36은 본 발명의 실시 예에 따른 임시 비밀키 테이블을 예시적으로 보여주는 도면이다.36 is a diagram illustrating a temporary secret key table according to an embodiment of the present invention.
도 37은 본 발명의 실시 예에 따른 임시 비밀키 테이블의 엔트리 추가 방법을 예시적으로 보여주는 도면이다.37 is a diagram exemplarily illustrating a method for adding an entry of a temporary secret key table according to an embodiment of the present invention.
도 38은 본 발명의 실시 예에 따른 임시 비밀키 테이블 업데이트 방법을 예시적으로 보여주는 도면이다.38 is a diagram illustrating a temporary secret key table update method according to an embodiment of the present invention.
본 발명의 실시를 위한 최성의 형태를 보여주는 도면은 도 1이다.1 is a view showing the best mode for practicing the present invention.
아래에서는 도면들을 이용하여 본 발명의 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있을 정도로 본 발명의 내용을 명확하고 상세하게 기재할 것이다.DETAILED DESCRIPTION Hereinafter, the contents of the present invention will be described clearly and in detail so that those skilled in the art can easily implement the drawings.
부채널 공격 중에서 Template 공격은 동일 암호 연산을 반복적으로 수행할 수 있는 경우에 적용될 수 있는 강력한 공격 방법이다. 따라서, 동일한 암호 연산을 반복적으로 하지 않도록 암호 연산에 대한 컨트롤이 요구된다. Template attack among side channel attacks is a powerful attack method that can be applied when the same encryption operation can be repeatedly performed. Thus, control over cryptographic operations is required so as not to repeat the same cryptographic operations.
또한, 동시에 DoS(Denial of Service) 공격에 대한 안전성도 고려해야 한다. DoS 공격의 경우, 리소스들을 낭비하도록 하게 하여, 배터리 기반 기기의 수명을 줄일 뿐 아니라, 정당한 암호 연산 마저 하지 못하게 막는 경우도 발생하게 된다. 따라서 DoS 공격과 같이 리소스를 낭비하도록 하는 공격자의 공격 징후를 빨리 탐지하여 차단하는 것이 중요하다. At the same time, you must also consider the safety against Denial of Service (DoS) attacks. In the case of DoS attacks, resources are wasted, which not only shortens the life of battery-based devices, but also prevents legitimate cryptographic operations. Therefore, it is important to quickly detect and block the attacker's indications of wasting resources such as DoS attacks.
본 발명에서는 DoS 공격과 Template 공격을 포함한 부채널 공격에 강한 안전성을 제공하는 암호연산 방법에 대해 제안한다.The present invention proposes a cryptographic operation method that provides strong security against side channel attacks including DoS attacks and template attacks.
도 1은 본 발명의 개념을 설명하기 위한 암호 시스템(10)을 예시적으로 보여주는 도면이다. 도 1을 참조하면, 암호 시스템(10)은 외부 채널(11)을 통하여 암호 통신을 수행하는 제 1 전자 장치(100)와 제 2 전자 장치(200)를 포함한다. 여기서 외부 채널(11)은 공격자의 공격으로부터 보호된 채널일 수 있다.1 exemplarily shows a cryptographic system 10 for explaining the concept of the present invention. Referring to FIG. 1, the cryptographic system 10 includes a first electronic device 100 and a second electronic device 200 that perform cryptographic communication through an external channel 11. Here, the external channel 11 may be a channel protected from an attacker's attack.
제 1 전자 장치(100) 및 제 2 전자 장치(200) 각각은 암호 통신 및 암호 연산을 수행하기 위한 암호 모듈(120, 220)을 포함할 수 있다. 도 1에서는 설명의 편의를 위하여 제 1 전자 장치(100)가 암호화 동작을 수행하여 발생된 암호 데이터를 송신하고, 제 2 전자 장치(200)는 제 1 전자 장치(100)로부터 수신한 암호 데이터를 이용하여 암호 연산을 수행한다고 가정하겠다. 여기서 암호 연산은 암복호화, 인증, 전자서명, 키 공유 등 다양한 암호 연산들을 포함한다.Each of the first electronic device 100 and the second electronic device 200 may include cryptographic modules 120 and 220 for performing cryptographic communication and cryptographic operation. In FIG. 1, for convenience of description, the first electronic device 100 transmits encrypted data generated by performing an encryption operation, and the second electronic device 200 transmits the encrypted data received from the first electronic device 100. Suppose you perform a cryptographic operation using The cryptographic operation includes various cryptographic operations such as encryption and decryption, authentication, digital signature, and key sharing.
제 1 전자 장치(100)의 암호 모듈(120)은 제 1 임시 비밀키 매니저(122) 및 암호화 유닛(224)을 포함한다.The cryptographic module 120 of the first electronic device 100 includes a first temporary secret key manager 122 and an encryption unit 224.
제 1 임시 비밀키 매니저(122)는 암호화 동작에 필요한 임시 비밀키(temporary private key, "TPK")를 발생한다. 여기서 임시 비밀키(TPK)는 사용 회수의 제한을 갖는다. 즉, 임시 비밀키(TPK)는 한번 혹은 복수번 사용될 수 있으나, 그 이상은 사용할 수 없다. 예를 들어, 임시 비밀키(TPK)는 일회용 패스 워드, 비밀 난스(nonce), 세션 키(session key)와 같은 임시로 사용하는 비밀 값(혹은, 키)일 수 있다.The first temporary private key manager 122 generates a temporary private key ("TPK") required for the encryption operation. Here, the temporary secret key (TPK) has a limit on the number of uses. That is, the temporary secret key (TPK) can be used one or more times, but not more than that. For example, the temporary secret key (TPK) may be a temporary secret value (or key), such as a one-time password, secret nonce, session key.
암호화 유닛(224)은 임시 비밀키(TPK)를 이용하여 암호 연산을 수행한다. 암호 연산을 통해 발생된 데이터 값(C)들은 제 1 전자 장치(100)의 내부 채널(101)을 통하여 외부 채널(11)로 전송된다. 이때, 임시 비밀키(TPK)에 대응되는 유추하기 힘든 값(C0)을 함께 전송할 수 있다. 여기서, 상기 전송된 검증값(C0)은 임시 비밀키(TPK)에 대한 검증값이다. 실시 예에 있어서, 검증값(C0)은 임시 비밀키(TPK)의 해쉬 값이 될 수 있다. 다른 실시 예에 있어서, 검증값(C0)은 임시 비밀키(TPK)의 인증 코드 값일 수 있다. 또 다른 실시 예에 있어서, 검증값(C0)은 임시 비밀키(TPK)의 암호화된 값일 수 있다. 상기 검증 값(C0)은 암호 모듈 내의 임시 비밀 값 테이블에 있는 검증값과 동일할 수도 다를 수도 있다. 후에 설명될 암호화에 의한 C0 값 생성의 경우, 임시 비밀 값 테이블 내의 검증의 대상이 되는 검증 값이 바로 임시 비밀 값이 될 수 있고, C0는 상기 임시 비밀 값의 암호문이 될 수가 있다. 또는 임시 비밀 키가 두 암호 모듈 사이에 동기화가 된 경우에는 C0는 빈(empty) 스트링이 될 수 있다.The encryption unit 224 performs a cryptographic operation using the temporary secret key TPK. The data values C generated through the encryption operation are transmitted to the external channel 11 through the internal channel 101 of the first electronic device 100. At this time, it is possible to transmit a value C0 that is difficult to infer corresponding to the temporary secret key TPK. Here, the transmitted verification value C0 is a verification value for the temporary secret key TPK. In an embodiment, the verification value C0 may be a hash value of the temporary secret key TPK. In another embodiment, the verification value C0 may be an authentication code value of the temporary secret key TPK. In another embodiment, the verification value C0 may be an encrypted value of the temporary secret key TPK. The verification value C0 may be the same as or different from the verification value in the temporary secret value table in the cryptographic module. In the case of generating the C0 value by encryption, which will be described later, the verification value which is the subject of verification in the temporary secret value table may be the temporary secret value, and C0 may be the cipher text of the temporary secret value. Alternatively, if the temporary secret key is synchronized between the two cryptographic modules, C0 can be an empty string.
도시되지 않았지만, 내부 채널(101)과 외부 채널(11) 사이에는 외부 채널(11)에 전송 가능한 데이터로 변경하기 위한 적절한 인터페이스가 존재할 수 있다.Although not shown, there may be an appropriate interface between the inner channel 101 and the outer channel 11 for changing to data transmittable to the outer channel 11.
제 2 전자 장치(200)의 암호 모듈(200)은 제 2 임시 비밀키 매니저(222) 및 복호화 유닛(224)을 포함한다. 이때, 복호화 유닛(224)은 복호화를 수행하거나 인증을 검증하는 과정을 포함할 수 있다.The cryptographic module 200 of the second electronic device 200 includes a second temporary secret key manager 222 and a decryption unit 224. In this case, the decryption unit 224 may include a process of performing decryption or verifying authentication.
제 2 임시 비밀키 매니저(222)는 C0로부터 이에 대응되는 임시 비밀키(TPK)가 자신의 내부 메모리에 있는지를 파악하여, 유효한 임시 비밀키(Valid TPK)인 지를 검증/판별하고, 이에 따라 복호화 유닛(224)을 활성화시킬 수 있다. 예를 들어, 임시 비밀키(TPK)가 유효한 임시 비밀키(Valid TPK) 라면, 활성화 신호(EN)가 발생될 수 있다. 복호화 유닛(224)은 활성화 신호(EN)에 응답하여 제 1 전자 장치(100)으로부터 수신된 암호 데이터에 대한 처리를 수행한다. 실시 예에 있어서, 암호 모듈들(120, 220) 각각은 구동하는 주체인 제 1 전자 장치(100) 및 제 2 전자 장치(200)를 신뢰하지 않도록 구현될 수 있다. 실시 예에 있어서, 암호 모듈들(120, 220)은 임시 비밀 값들을 발생하기 위해 사전에 미리 서로 비밀키를 공유할 수 있다.The second temporary secret key manager 222 determines from C0 whether a corresponding temporary secret key (TPK) is in its internal memory, verifies / determines whether it is a valid temporary secret key (TPalid), and decrypts it accordingly. Unit 224 may be activated. For example, if the temporary secret key TPK is a valid temporary TPK, an activation signal EN may be generated. The decryption unit 224 performs a process on the encrypted data received from the first electronic device 100 in response to the activation signal EN. According to an embodiment of the present disclosure, each of the cryptographic modules 120 and 220 may be implemented so as not to trust the first electronic device 100 and the second electronic device 200, which are driving subjects. In an embodiment, the cryptographic modules 120 and 220 may share a secret key with each other in advance to generate temporary secret values.
실시 예에 있어서, 유효한 임시 비밀키(Valid TPK)는 이전 암호 연산에서 사용되지 않는 임시 비밀키일 수 있다.In an embodiment, the valid temporary TPK may be a temporary secret key that is not used in a previous cryptographic operation.
다른 실시 예에 있어서, 유효한 임시 비밀키(Valid TPK)는 이전 암호 연산에서 사전에 결정된 회수 이하로 사용된 임시 비밀키일 수 있다. 제 2 임시 비밀키 매니저(222)는 임시 비밀키(TPK)가 사용되었는 지 혹은 사용되었다면 몇 번 사용되었는 지를 근거로 하여 유효한 임시 비밀키(Valid TPK)인지를 검증/판별할 수 있다.In another embodiment, the valid temporary TPK may be a temporary private key used up to a predetermined number of times in a previous cryptographic operation. The second temporary secret key manager 222 may verify / determine whether it is a valid temporary secret key (TPalid TPK) based on whether the temporary secret key (TPK) is used or how many times it is used.
본 발명의 복호화 유닛(224)은 임시 비밀키(TPK)가 유효한 임시 비밀키(Valid TPK)가 아니라면 복호화 동작을 개시하지 않는다. 즉, 임시 비밀키(TPK)가 유효한 임시 비밀키(Valid TPK)가 아니라면, 즉각적으로 암호 모듈(220)의 동작이 중단될 수 있다.The decryption unit 224 of the present invention does not initiate a decryption operation unless the temporary secret key TPK is not a valid temporary secret key TPK. That is, if the temporary secret key TPK is not a valid temporary TPK, the operation of the cryptographic module 220 may be immediately stopped.
한편, 도 1에서는 제 1 전자 장치(100)의 암호 모듈(120)은 암호화 관점에서 구성을 도시하였고, 제 2 전자 장치(200)의 암호 모듈(220)은 복호화 관점에서 구성을 도시하였을 뿐이다. 여기서 암호 모듈들은 암복호화 및 인증, 전자서명 발생 및 검증 등 다양한 암호 연산을 수행할 수 있다. 제 1 전자 장치(100)의 암호 모듈(120)은 제 2 전자 장치(200)의 암호 모듈(220)의 구성들(222, 224)을 포함하거나, 제 2 전자 장치(200)의 암호 모듈(220)은 제 1 전자 장치의 암호 모듈(12)의 구성들(122, 124)을 포함할 수 있다.Meanwhile, in FIG. 1, the encryption module 120 of the first electronic device 100 is illustrated in terms of encryption, and the encryption module 220 of the second electronic device 200 is only illustrated in terms of decryption. Here, the cryptographic modules can perform various cryptographic operations, such as encryption and decryption and authentication, digital signature generation and verification. The cryptographic module 120 of the first electronic device 100 may include components 222 and 224 of the cryptographic module 220 of the second electronic device 200, or may include the cryptographic module of the second electronic device 200. 220 may include components 122 and 124 of the cryptographic module 12 of the first electronic device.
본 발명의 실시 예에 따른 암호 시스템(10)은 임시 비밀키(TPK)의 이전 암호 연산에서 사용 여부 혹은 반복 사용 회수를 고려하여 암호연산을 수행함으로써, Template 공격을 포함하는 부채널 공격 및 DoS 공격에 안전한 암호 통신을 수행할 수 있다.The cryptographic system 10 according to an embodiment of the present invention performs a cryptographic operation in consideration of whether the temporary secret key (TPK) is used in the previous cryptographic operation or the number of repetitive use, thereby subchannel and DoS attacks including template attacks. Secure cryptographic communication can be performed.
아래에서는 이러한 임시 비밀키(TPK)을 어떻게 발생하고 사용하는지, 그리고 어떻게 임시 비밀키(TPK)을 이용하여 암호 연산을 수행하는지에 대해 상세하게 설명할 것이다.In the following, we will explain in detail how to generate and use a temporary secret key (TPK) and how to perform cryptographic operations using the temporary secret key (TPK).
도 2는 본 발명의 실시 예에 따른 암호화 방법을 예시적으로 보여주는 흐름도이다. 도 1 및 도 2를 참조하면, 암호화 방법은 다음과 같다. 임시 비밀키 매니저(122)에서 사용되지 않거나 혹은 소정의 회수 이하로 사용된 임시 비밀키(TPK)가 발생된다(S110). 공격자로부터 알려지지 않도록 발생된 임시 비밀키(TPK)가 보호된다(S120). 가령, 임시 비밀키(TPK)의 해쉬 값(C0)을 발생하여 임시 비밀키(TPK)를 보호할 수 있다. 이어서 암호화 유닛(224)에서 임시 비밀키(TPK)를 이용하여 메시지가 암호화 된다(S130). 그리고 최종, C0와 함께 상대방에게 암호화된 메시지를 보낸다.2 is a flowchart illustrating an encryption method according to an embodiment of the present invention. 1 and 2, the encryption method is as follows. A temporary secret key TPK that is not used in the temporary secret key manager 122 or used less than a predetermined number of times is generated (S110). The temporary secret key (TPK) generated so as not to be known from the attacker is protected (S120). For example, the hash value C0 of the temporary secret key TPK may be generated to protect the temporary secret key TPK. Subsequently, the message is encrypted using the temporary secret key TPK in the encryption unit 224 (S130). Finally, it sends an encrypted message to the other party with C0.
아래에서는, 암호화 방법에 대하여 구체적으로 설명하겠다.In the following, the encryption method will be described in detail.
임시 비밀키(TPK) 발생(도 2, S110 단계) Temporary Secret Key (TPK) Generation (Figure 2, step S110)
임시 비밀키(TPK)는 암호 연산을 수행하기 위한 세션 키 혹은 일회용 패스워드처럼 사용될 중요한 비밀 정보이다. 여기서는 임시 비밀키(TPK)의 발생의 한 방법으로 순차처리 기반에 근거한 발생 방법 및 이를 다루는 방법을 설명한다.A temporary secret key (TPK) is important secret information that will be used, such as a session key or a one-time password for performing cryptographic operations. As a method of generating a temporary secret key (TPK), a generation method based on sequential processing and a method of dealing with the same are described.
도 3은 순차 처리 방식에 의한 비밀 비밀키 발생 방법을 예시적으로 보여주는 도면이다. 도 3을 참조하면, 두 암호 모듈들(120, 220, 도 1 참조) 사이에 공유된 공유키(K)와 블록 암호(E)를 이용하여, 임시 비밀키(TPK) 혹은 난스(N) 값들이 순차적으로 발생 된다. 제 1 암호화 동작에 제 1 난스(1,N1)를 사용했으면, 다음 제 2 암호화 동작에 제 2 난스(2,N2)를 사용하고, 그 다음 제 3 암호화 동작에 제 3 난스(3,N3)가 사용 될 것이다. 또는 다양한 방식으로 임시 비밀 난스 값들이 사용될 수 있다. 도 3에 도시된 순차 처리 방식의 특징은, 다음에 사용될 신규 임시 비밀키(TPK)로 사용될 난스를 발생하기 위하여 블록암호 연산을 한번 만 수행한다는 것이다. 이는 구현 효율성의 극대화를 제공할 수 있다. 또는 블록암호 출력 값의 일부만을 이용하여 난스 값으로 정의할 수 하면, 특정 난스 값이 공격자에게 노출된다고 할지라도, 그 이전 또는 그 이후에 사용된 난스를 보호할 수 있게 된다. 또는 블록암호 연산을 여러 번에 걸쳐서 신규 임시 비밀키(TPK)를 발생할 수 있다.3 is a diagram illustrating a secret secret key generation method by a sequential processing method. Referring to FIG. 3, a temporary secret key (TPK) or a nonce (N) value using a shared key K and a block cipher E shared between two cryptographic modules 120, 220 (see FIG. 1). Are generated sequentially. If the first nonce (1, N1) is used for the first encryption operation, the second nonce (2, N2) is used for the next second encryption operation, and the third nonce (3, N3) for the third encryption operation. Will be used. Alternatively, temporary secret nonce values may be used in various ways. A characteristic of the sequential processing scheme shown in FIG. 3 is that the block cipher operation is performed only once to generate a nonce to be used as a new temporary secret key (TPK) to be used next. This can provide maximum implementation efficiency. Alternatively, if a nonce value can be defined using only a part of the block cipher output value, even if a particular nonce value is exposed to an attacker, the nonce used before or after it can be protected. Alternatively, a new temporary secret key (TPK) can be generated several times of block cipher operations.
발생된 임시 비밀키(TPK) 보호(도 2, S120 단계)Generated temporary secret key (TPK) protection (Figure 2, step S120)
발생된 임시 비밀키(TPK)는 공격자에게 알려지면 위험하다. 이에 임시 비밀키(TPK)는 다음의 세 가지 방식을 이용하여 임시 비밀키(TPK)에 대한 검증값(C0)을 발생함으로써 보호될 수 있다. 첫째는 암호화 방식이고, 둘째는 해쉬 함수를 이용한 방식, 셋째로 임시 비밀키(TPK) 동기화에 의한 방식이다.The generated temporary secret key (TPK) is dangerous if known to the attacker. The temporary secret key TPK can be protected by generating a verification value C0 for the temporary secret key TPK using the following three methods. The first is the encryption method, the second is the hash function, and the third is the temporary secret key (TPK) synchronization.
도 4는 암호화 방식에 따른 임시 비밀키(TPK) 보호를 예시적으로 보여주는 도면이다. K는 두 암호 모듈들(120, 220) 사이에 공유된 비밀키 값이고, constant는 임의의 고정된 상수 값이다. 암호화를 수행하기를 원하는 암호 모듈(예를 들어, 도 1의 120)은 발생된 난스(N)를 암호화함으로써, 암호화된 난스(C0)를 발생하고, 발생된 암호화된 난스(C0)를 상대 암호 모듈(예를 들어, 220)로 전송하게 된다. 여기서 암호화된 난스는 공유 키(K)를 모르는 공격자에 의해 유추가 불가능한 값이다. 이때, 암호화된 난스(C0)로부터 난스(N)을 보호하기 위한 XOR 연산은 부채널 공격에 의해 안전하도록 효율적으로 구현될 수 있다. 이때, 암호화된 난스(C0)로부터 난스(N)를 복호하기 위해서 공유 키(K) 값이 통신을 하기를 원하는 올바른 두 기기 사이에 미리 공유되어야 한다.4 is a diagram exemplarily illustrating temporary secret key (TPK) protection according to an encryption method. K is a secret key value shared between the two cryptographic modules 120, 220, and constant is any fixed constant value. An encryption module (eg, 120 of FIG. 1) wishing to perform encryption generates an encrypted nonce (C0) by encrypting the generated nonce (N), and encrypts the generated nonce (C0) with a relative cipher. To the module (eg, 220). The encrypted nonce is a value that cannot be deduced by an attacker who does not know the shared key (K). In this case, the XOR operation for protecting the nonce N from the encrypted nonce C0 may be efficiently implemented to be secured by the subchannel attack. At this time, in order to decrypt the nonce N from the encrypted nonce C0, the value of the shared key K must be shared in advance between two correct devices which want to communicate.
임시 비밀키 매니저(예를 들어, 122)는 난스 값과 그것의 인덱스 번호를 테이블에 저장해 놓는다. 이때 테이블은 암호 모듈 내에 있는 임의의 메모리 공간이 될 수 있다. 가령, (1,N1), (2,N2), (3,N3)를 저장해 놓고, N1를 사용하고 삭제하면, (1,N1)대신 (4,N4)를 대신 테이블에 채워 놓는다. 이렇게 신규 난스 값들을 테이블에 추가할 수 있다. 만약, 통신 상의 문제로 N1이 사용되지 않는다면, 메모리 누수를 막기 위하여 일정 시간이 지난 후 N1를 삭제할 수 있다. 그리고 임시 비밀키 매니저는 사전에 미리 정해진 수 이하로 반복하여 난스 값을 사용할 수 있도록 하기 위해, 각 엔트리에 각 난스 값의 사용 회수에 대한 정보를 추가할 수 있다.The temporary secret key manager (e.g., 122) stores the nonce value and its index number in a table. The table can be any memory space in the cryptographic module. For example, if you store (1, N1), (2, N2), and (3, N3) and use N1 and delete it, instead of (1, N1), instead of (1, N1), you fill the table with (4, N4) instead. You can add new nonce values to the table like this. If N1 is not used due to communication problems, N1 may be deleted after a certain time to prevent memory leaks. The temporary secret key manager may add information on the number of times each nonce value is used to each entry in order to repeatedly use the nonce value up to a predetermined number.
도 5는 해쉬 함수(H) 방식에 따른 임시 비밀키(TPK) 보호를 예시적으로 보여주는 도면이다. 도 5에서는 설명의 편의를 위하여 해쉬 함수(H)가 일방향 해쉬 함수라고 가정하겠다. 임시 비밀 값 난스(N)를 보호하기 위하여 그것의 해쉬 값(C0)가 발생된다. 이때, 해쉬 함수(H)에는 어떤 비밀 정보도 포함되지 않는다. 또한 임시 비밀키(TPK)를 모르는 이상, 공격자는 해당 해쉬 값(C0)를 유추할 수 없게 된다.5 is a diagram illustrating a temporary secret key (TPK) protection according to the hash function (H) scheme by way of example. In FIG. 5, for convenience of explanation, it is assumed that the hash function H is a one-way hash function. In order to protect the temporary secret value nonce (N), its hash value (C0) is generated. At this time, the hash function H does not include any secret information. Also, without knowing the temporary secret key (TPK), the attacker will not be able to infer the hash value (C0).
난스(N)가 랜덤하기 때문에 해쉬 값(C0)로부터 난스(N)에 대한 어떤 정보도 전력, 전자파 등의 부채널 공격으로부터 노출되지 않는다. 두 암호 모듈들(120, 220) 각각은 인덱스와 임시 비밀키 난스들(N)과 각각의 해쉬 값( C0(=H(N))) 들을 모듈 내의 메모리에 테이블로 저장해 놓는다. 즉, 테이블은 해쉬 값(C0)와 난스 값(인덱스,N)로 구성된 엔트리를 포함한다. 따라서, 상대 암호 모듈(예를 들어, 240)은 테이블을 이용하여 해쉬 값(C0)로부터 대응되는 인덱스 및 임시 비밀 값 난스(N)를 얻을 수 있다.Since the nonce N is random, no information about the nonce N from the hash value C0 is exposed from subchannel attacks such as power and electromagnetic waves. Each of the two cryptographic modules 120, 220 stores the index and temporary secret key nonce (N) and their hash values (C0 (= H (N))) as a table in memory in the module. That is, the table includes an entry consisting of a hash value C0 and a nonce value (index, N). Accordingly, the counterpart cryptographic module (eg, 240) may use the table to obtain the corresponding index and temporary secret value nonce (N) from the hash value (C0).
실시 예에 있어서, 제한된 회수 이상 사용된 임시 비밀 값 난스(N)와 그것의 해쉬 값(C0)은 더 이상 사용할 수 없도록 테이블에서 삭제될 수 있다. 즉, 대응하는 엔트리가 테이블에서 삭제될 수 있다.In an embodiment, the temporary secret value nonce N and its hash value C0 used for more than a limited number of times may be deleted from the table so that it is no longer available. That is, the corresponding entry can be deleted from the table.
실시 예에 있어서, 새로운 임시 비밀 값 난스(N) 및 그것의 해쉬 값(C0)을 발생하여 테이블에 새롭게 업데이트 될 수 있다. 예를 들어, (1,N1,C0_1=H(N1)), (2,N2,C0_2=H(N2)), (3,N3,C0_3=H(N3)) 관련 테이블이 모듈 내에 안전하게 저장되고, 각 난스(N1, N2, N3)의 사용 회수를 한 번으로 제한하는 경우, 난스(N1)가 한번 사용되면 저장 공간으로부터 엔트리(1,N1,C0_1=H(N1))가 삭제되고, 그 자리에 새로운 엔트리(4,N4,C0_4=H(N4))가 채워질 수 있다. 만약, 통신 상의 문제로 인하여, 또는 공격자의 통신 방해로 인하여, N1이 사용되지 않고 바로 N2가 사용될 경우, 일정 시간이 지난 후, N1을 삭제하고 다른 난스 값으로 채워 놓으므로 메모리 누수를 차단할 수 있다. 그리고 임시 비밀키 매니저는 사전에 미리 정해진 수 이하로 반복하여 난스 값을 사용할 수 있도록 하기 위해, 각 엔트리에 각 난스 값의 사용 회수에 대한 정보를 추가할 수 있다.In an embodiment, a new temporary secret value nonce (N) and its hash value (C0) may be generated and updated in the table. For example, (1, N1, C0_1 = H (N1)), (2, N2, C0_2 = H (N2)), and (3, N3, C0_3 = H (N3)) related tables are safely stored within the module. When limiting the number of times of use of each nonce (N1, N2, N3) to one time, once the nonce (N1) is used, the entry (1, N1, C0_1 = H (N1)) is deleted from the storage space. The new entry (4, N4, C0_4 = H (N4)) may be filled in place. If N1 is not used and N2 is used immediately due to a communication problem or an interruption of an attacker's communication, the memory leak can be blocked since N1 is deleted and filled with another nonce value after a certain time. . The temporary secret key manager may add information on the number of times each nonce value is used to each entry in order to repeatedly use the nonce value up to a predetermined number.
해쉬 함수 방식에 따른 임시 비밀키(TPK)을 보호할 경우, 해쉬 함수 기반 방식의 내부 상태 값들이 랜덤한 값이기에 전력 소모량, 전자파, 소리 등 비침투성 부채널 공격에 대해 강한 안전성이 제공될 수 있다.When protecting the temporary secret key (TPK) according to the hash function method, since the internal state values of the hash function-based method are random values, strong security can be provided against non-invasive subchannel attacks such as power consumption, electromagnetic waves, and sound. .
좀더 구체적으로, 통신을 원하는 두 암호 모듈 A와 B가 공유 키 K를 공유하고 있으며, 각 암호 모듈 내에 동일 크기의 TPK 테이블을 갖고 있다고 가정하겠다. 이때, TPK 테이블의 크기가 서로 다를 수 있다. 가령, 테이블은 10 개의 엔트리를 갖고 있다고 하자. 여기서는 해쉬기반으로 설명한다. 그리고 임시 키 사용 회수는 1인 경우로 예를 들어 설명한다. 이때 TPK 테이블은 C0 검색을 효율적으로 하기 위하여 C0 값을 이용하여 엔트리들을 정렬해 놓을 수 있다.More specifically, it is assumed that two cryptographic modules A and B wishing to communicate share a shared key K, and each cryptographic module has a TPK table of the same size. In this case, the sizes of the TPK tables may be different. For example, a table has 10 entries. The description here is based on hash. The temporary key usage count is 1, for example. In this case, the TPK table may sort the entries by using the C0 value for efficient C0 search.
단계 1. 두 암호 모듈 A와 B 각각은 공유 키 K로부터 10 개의 엔트리를 발생한다. 이때, 각 엔트리는 인덱스, 임시 비밀키, 해쉬 값이 된다. 즉, 첫번째 엔트리는 (1,N1,C0_1=H(N1)), 두번째 엔트리는 (2,N2,C0_2=H(N2))가 된다. 이렇게, 열번째 엔트리 (10,N10, C0_10=H(N10))까지 발생한다. 이때 테이블은 인덱스를 제외한 나머지 값들은 두 암호 모듈들 A(도 1 참조, 120)와 B(도 1 참조, 220) 외에는 알 수 없게 된다. Step 1. Each of the two cryptographic modules A and B generates 10 entries from the shared key K. At this time, each entry becomes an index, a temporary secret key, and a hash value. That is, the first entry is (1, N1, C0_1 = H (N1)), and the second entry is (2, N2, C0_2 = H (N2)). Thus, the tenth entry (10, N10, C0_10 = H (N10)) occurs. At this time, the table cannot know the remaining values other than the two cryptographic modules A (see FIG. 1 and 120) and B (see FIG. 1 and 220).
단계 2. 단계 1에서처럼 테이블 정의가 끝나면, 두 암호 모듈은 통신을 시작한다. 두 기기간 정해진 프로토콜에 따라 임시 비밀 값들인 N 값들을 이용하여 암호 연산을 수행하여 얻은 암호 데이터(C)를 상대방에게 전달한다. 여기서는 A가 B에게 보내는 경우를 생각해 보겠다. 이때 인덱스가 작은 N 값들부터 이용한다. A는 임의의 시점에서 사용한 임시 비밀 값 Ni을 이용하여, 암호 데이터(C)를 발생한다. 그리고 TPK 테이블에서 (i,Ni,C0_i)를 삭제하고, 새로운 인덱스로 자리를 채운다. 이때, 매번 엔트리를 업데이트 하는 대신, 일정한 주기로 할 수 있으며, 업데이트시 C0 값을 이용하여 엔트리를 정렬하여 검색 시간을 단축시킬 수 있다. Step 2. After defining the table as in Step 1, the two cryptographic modules begin communicating. The cryptographic data (C) obtained by performing a cryptographic operation using N values, which are temporary secret values, is transmitted to the counterpart according to a protocol established between the two devices. Consider the case where A sends to B. In this case, the index is used from the smallest N values. A generates the encrypted data C using the temporary secret value Ni used at any point in time. Then delete (i, Ni, C0_i) from the TPK table and fill it with the new index. In this case, instead of updating the entry every time, it may be a regular period, and the update time may be shortened by sorting the entries using the C0 value.
A는 B에게 Ni에 대응되는 C0_i 값을 암호 데이터(C)와 함께 보낸다. 이때 인덱스 i 값은 함께 보내지 않는다. 그 이유는 i는 인덱스 값이라 공격자가 쉽게 유추가 가능하고, 공격자에게 A인 것처럼 위장하여 (i,C0')을 보내면, B는 i에 해당하는 Ni에 대응되는 C0_i와 C0_i'이 동일한가를 검증하거나 또는 Ni의 해쉬 값이 C0_i'와 같은가를 체크한다. 만약 공격자가 동일한 i 값에 대해서 반복적으로 질문을 할 경우, Ni 또는 C0_i 값을 공격자가 Template 공격과 같은 부채널 공격에 의해 노출될 위험을 안고 있다. 따라서 본 발명의 경우 i 값을 보내지 않는다. 그러면 B는 자신의 TPK 테이블에서 C0_i가 있는지 체크하고, 만약 C0_i가 없으면, 더 이상 암호 연산을 수행하지 않는다.A sends C0_i value corresponding to Ni to C together with the cipher data C. The index i value is not sent together. The reason is that i is an index value, so that the attacker can easily infer and send (i, C0 ') to the attacker as if it were A, then B verifies that C0_i and C0_i' corresponding to Ni corresponding to i are the same. Or check if the hash value of Ni is equal to C0_i '. If an attacker repeatedly asks about the same i value, there is a risk that the Ni or C0_i value will be exposed by side channel attacks such as template attacks. Therefore, in the present invention, i value is not sent. B then checks if C0_i exists in its TPK table, and if C0_i does not exist, no further cryptographic operations are performed.
만약 TPK 테이블에서 C0_i 값이 있으면, Ni를 이용하여 암호 연산을 수행한다. 그리고 B가 갖고 있는 TPK 테이블에서 i 보다 작거나 같은 모든 j에 대해 엔트리 (j,Nj,C0_j)가 있으면 삭제하고, 새로운 엔트리들로 자리를 채운다. 이때, 매번 엔트리를 업데이트 하는 대신, 일정한 주기로 할 수 있으며, 업데이트시 C0 값을 이용하여 엔트리를 정렬하여 검색 시간을 단축시킬 수 있다.If there is a C0_i value in the TPK table, the cryptographic operation is performed using Ni. If there is an entry (j, Nj, C0_j) for all js less than or equal to i in B's TPK table, it is deleted and filled with new entries. In this case, instead of updating the entry every time, it may be a regular period, and the update time may be shortened by sorting the entries using the C0 value.
B가 A에게 암호 데이터를 보내고자 하는 경우에도 위와 동일한 방법으로 계속 진행을 한다.If B wants to send encrypted data to A, he continues in the same way.
또한, 임시 비밀키를 동기화하는 방식이 있다. 임시 비밀키(TPK)와 관련된 정보를 전혀 상대 암호 모듈에게 전송하지 않는다. 이는 두 암호 모듈들(120, 220) 사이에 난스 값에 대한 동기화가 요구된다.There is also a way to synchronize the temporary secret key. Never send information related to a temporary secret key (TPK) to the other cryptographic module. This requires synchronization of nonce values between the two cryptographic modules 120 and 220.
한편, 본 발명의 임시 비밀키 유효성 검증 방법은 상술 된 방법에 제한되지 않으며, 다양한 방법들로 구현가능하다.On the other hand, the temporary secret key validation method of the present invention is not limited to the above-described method, it can be implemented in various ways.
임시 비밀키(TPK)을 이용하여 메시지 암호화 수행(도 2, S130 단계)Message encryption using a temporary secret key (TPK) (FIG. 2, step S130)
임시 비밀키(TPK)를 이용하여 암호 연산을 수행한 후, 임시 비밀키에 대응되는 검증값인 C0 값, 가령 임시 비밀키(TPK)의 해쉬 값을 상대방에게 보내게 된다. 이때, 상대방은 C0로부터 대응되는 임시 비밀키(TPK)이 있는지를 임시 비밀키 매니저가 파악한 후, C0에 해당되는 임시 비밀키(TPK)가 존재하면 사용 가능한 것으로 판단하고 암호 연산을 수행하게 된다. 여기서의 검증값 C0는 임시 비밀키 매니저가 소유한 임시 비밀 키 테이블 내의 검증값과 같을 수도 다를 수도 있다. After the encryption operation is performed using the temporary secret key (TPK), the hash value of the temporary secret key (TPK), which is a verification value corresponding to the temporary secret key, is sent to the counterpart. At this time, the other party determines whether there is a corresponding temporary secret key (TPK) from C0, and if the temporary secret key (TPK) corresponding to C0 exists, determines that it is available and performs a cryptographic operation. The verification value C0 here may be the same as or different from the verification value in the temporary secret key table owned by the temporary secret key manager.
부채널 공격에 안전하도록 암호화 동작을 수행하기 위해서 고정된 비밀 정보 값을 반복적으로 사용해서는 안된다. 즉, 임시 비밀키(TPK)을 이용하여 내부 상태 값이 지속적으로 바뀌도록 암호화 과정이 설계될 것이다. 즉, 임시 비밀키를 이용하여 내부 블록 암호에 사용될 블록 키들을 발생하여 블록 암호 각각에 다른 블록 키들을 적용한다. Fixed secret values should not be used repeatedly to perform cryptographic operations to protect against side channel attacks. In other words, the encryption process will be designed to continuously change the internal state value using the temporary secret key (TPK). That is, block keys to be used for an internal block cipher are generated using a temporary secret key to apply different block keys to each block cipher.
도 6 내지 도 8은 본 발명의 실시 예에 따른 암호화 방식을 보여주는 도면들이다. 설명의 편의를 위하여 임시 비밀키(N)가 해싱(hashing)되었다고 가정하겠다. 여기서 H는 해쉬 함수이며, 임시 비밀키(N)를 이용하여 블록 암호 키는 매번 업데이트 된다. 입력된 메시지(M)를 암호화할 경우, 최종 출력 값은 C=C0||C1||... 이 된다. 본 발명의 실시 예에 따른 암호화 방식은 비밀 값(N)이 반복 사용되지 않도록 구현될 수 있다. 이를 위해 임시 비밀 난스 값(N)을 가지고 구현될 수 있다.6 to 8 are diagrams illustrating an encryption scheme according to an embodiment of the present invention. For convenience of explanation, it is assumed that the temporary secret key N has been hashed. Where H is a hash function and the block cipher key is updated each time using the temporary secret key (N). When encrypting the input message (M), the final output value is C = C0 || C1 || ... An encryption scheme according to an embodiment of the present invention may be implemented such that the secret value N is not repeatedly used. This can be implemented with a temporary secret nonce value (N).
도 6은 본 발명의 실시 예에 따른 블록 암호 알고리즘의 변형된 ECB(electronic book) 모드를 보여주는 도면이다. 도 6을 참조하면, 평문을 일정 크기의 블록으로 나누어 처리하고, 각 블록은 주어진 임시 비밀 값으로부터 발생된 서로 다른 키들로 암호화된다.FIG. 6 is a diagram illustrating a modified electronic book (ECB) mode of a block cipher algorithm according to an embodiment of the present invention. Referring to FIG. 6, the plain text is divided into blocks of a certain size, and each block is encrypted with different keys generated from a given temporary secret value.
도 7은 본 발명의 실시 예에 따른 블록 암호 알고리즘의 변형된 CBC(cipher-block chaining) 모드를 보여주는 도면이다. 도 7을 참조하면, 현재의 평문 블록과 바로 직전의 암호 블록을 XOR 연산한 것을 알고리즘의 입력으로 이용되고, 각 블록은 주어진 임시 비밀 값으로부터 발생된 서로 다른 키들로 암호화된다.FIG. 7 illustrates a modified cipher-block chaining (CBC) mode of a block cipher algorithm according to an embodiment of the present invention. Referring to FIG. 7, an XOR operation of the current plaintext block and the immediately preceding cipher block is used as an input of an algorithm, and each block is encrypted with different keys generated from a given temporary secret value.
도 8은 본 발명의 실시 예에 따른 블록 암호 알고리즘의 변형된 CTR(counter) 모드이다. 도 8을 참조하면, 블록 암호가 스트림 암호처럼 사용된다. 블록에 입력되는 상수 값(const, const+1, const+2, ...)은 순차적으로 카운트 업 되고, 각 블록은 주어진 임시 비밀 값으로부터 발생된 서로 다른 키들로 암호화된다. 한편, 본 발명의 암호화 방법은 도 6 내지 도 8에 도시된 블록 암호화 방법에 제한되지 않는다. 상술 된 것과 유사한 방법으로 블록 암호처럼 다양한 암호 프리미티브에 기반한 암호화 방식들에 적용 가능하다.8 is a modified CTR (counter) mode of the block cipher algorithm according to an embodiment of the present invention. Referring to Figure 8, a block cipher is used like a stream cipher. The constant values (const, const + 1, const + 2, ...) entered into the blocks are counted up sequentially, and each block is encrypted with different keys generated from the given temporary secret value. On the other hand, the encryption method of the present invention is not limited to the block encryption method shown in Figs. Similar to the above, it is applicable to encryption schemes based on various cryptographic primitives, such as block ciphers.
도 9는 본 발명의 실시 예에 따른 복호화 방법을 예시적으로 보여주는 흐름도이다. 도 1 및 도 9를 참조하면, 복호화 과정은 다음과 같이 진행된다.9 is a flowchart illustrating a decoding method according to an embodiment of the present invention. 1 and 9, the decoding process proceeds as follows.
제 2 전자 장치(200)에 외부 채널(11)을 통하여 암호화된 메시지(C)가 입력된다(S210). 임시 비밀키 매니저(222)에서 암호화된 메시지(C)를 발생하는데 사용된 임시 비밀키(TPK)가 유효한 지가 판별된다(S220). 즉, 임시 비밀키(TPK)가 이전 암복호화 동작에 사용된 적이 없거나, 사용 회수가 사전에 결정된 값을 초과하지 않으면, 임시 비밀키(TPK)는 유효한 임시 비밀키(Valid TPK)이다. 만일, 임시 비밀키(TPK)가 유효하다면, 복호화 유닛(224)에서 암호화된 메시지(C)가 복호화 된다(S330). 반면에 임시 비밀키(TPK)가 유효하지 않다면, 복호화 유닛(220)를 포함하는 암호 모듈(220)의 동작이 멈춰진다(S335).The encrypted message C is input to the second electronic device 200 through the external channel 11 (S210). It is determined whether the temporary secret key TPK used to generate the encrypted message C in the temporary secret key manager 222 is valid (S220). In other words, if the temporary secret key (TPK) has never been used in a previous encryption / decryption operation or the number of times of use does not exceed a predetermined value, the temporary secret key (TPK) is a valid temporary secret key (Valid TPK). If the temporary secret key TPK is valid, the message C encrypted by the decryption unit 224 is decrypted (S330). On the other hand, if the temporary secret key TPK is not valid, the operation of the encryption module 220 including the decryption unit 220 is stopped (S335).
본 발명의 실시 예에 따른 복호화 방법은 임시 비밀키(TPK)에 대한 검증을 수행한 뒤, 그 결과에 따라 복호화 동작 여부를 결정할 수 있다.In the decryption method according to an embodiment of the present invention, after verifying the temporary secret key (TPK), the decryption operation may be determined according to the result.
아래에서는 복호화 동작을 자세하게 설명하도록 하겠다.The decoding operation will be described in detail below.
임시 비밀키(TPK)의 반복 사용 여부 확인(도 9, S210 단계) Check whether the temporary secret key (TPK) is used repeatedly (FIG. 9, step S210)
복호화 단계는 동일한 검증값(C0)의 사용 회수를 제한하는 데에 있다. 가령 한번 사용된 해쉬 또는 암호화된 검증 값(C0)는 더 이상 사용하지 않을 수도 있다. 해쉬 또는 암호화된 검증 값(C0)의 반복 사용 여부가 중요한 이유는, 랜덤성이 보장되지 않는 구현 방식은 부채널 공격에 취약하기 때문이다. 따라서 해쉬 또는 암호화된 검증값(C0)에 대응되는 임시 비밀키(TPK)이 이전에 사용되었던 값인지를 임시 비밀키 매니저가 관리하는 테이블을 이용하여 판별하고, 이미 사용된 경우 혹은 제한된 회수 이상 반복 사용된 경우, 복호화 동작이 중단될 것이다.The decryption step is to limit the number of times of use of the same verification value C0. For example, once used hashes or encrypted verification values C0 may no longer be used. Whether repeated use of the hash or the encrypted verification value C0 is important because implementations that are not guaranteed to be random are vulnerable to side channel attacks. Therefore, the temporary secret key (TPK) corresponding to the hash or encrypted verification value (C0) is determined by using a table managed by the temporary secret key manager, and is repeated if it is already used or for a limited number of times. If used, the decryption operation will be aborted.
임시 비밀키(TPK)을 이용하여 암호문 복호화(도 9, S230, S235)Decrypt cipher text using temporary secret key (TPK) (FIG. 9, S230, S235)
임시 비밀키(TPK)가 반복 사용되지 않았다는 것을 검증한 후, 임시 비밀키(TPK)가 계산된다. 이 후에 입력된 암호문(C)에 대한 복호화 동작이 수행된다.After verifying that the temporary secret key (TPK) has not been used repeatedly, the temporary secret key (TPK) is calculated. After that, the decryption operation is performed on the input ciphertext C.
한편, 본 발명의 암복호화 동작은 인증 방식을 추가할 수 있다.Meanwhile, the encryption / decryption operation of the present invention may add an authentication method.
블록암호 기반 암복호화 + 인증 방식에 관하여About block cipher-based encryption / decryption + authentication method
도 10은 본 발명의 실시 예에 따른 인증 방식을 결합한 블록 암호화 방법을 예시적으로 보여주는 흐름도이다. 도 10을 참조하면, 블록 암호화 방법은 다음과 같이 진행된다. 앞서 설명된 바와 같이 순차처리 기반으로 임시 비밀키(TPK)가 발생 된다(S310). 앞서 설명한 세 가지 방식(암호화 방식, 해쉬 방식, 동기화 방식)중 하나를 사용하여 발생된 임시 비밀키(TPK)로부터 임시 비밀키 검증값(C0)가 발생 된다(S320). 부채널 공격에 안전하도록 암호화를 수행하기 위해서는 고정된 비밀 비밀키들이 사전에 정해진 수 이상 반복적으로 사용되지 않는다. 발생된 임시 비밀키(TPK)을 이용하여 내부 상태 값이 지속적으로 바뀌도록 메시지가 암호화되고, 인증 코드가 발생된다(S330). 이번에는 세션 키를 위한 TPK 테이블, 난스열을 위한 TPK 테이블에 기반하여 설계되는 암호 인증 방식에 대해 설명하고자 한다. 여기서 난스 열은 세션 키를 보호하기 위한 마스크 열 발생에 사용된다. 구체적으로, 세션 키가 사용된 암호 프리미티브의 입출력 정보를 보호하기 위하여 마스크 값을 사용하게 된다. 이때 암호 프리미티브의 예로는 블록암호, 압축함수, 치환함수, tweakable 블록암호 등이 있다.10 is a flowchart exemplarily illustrating a block encryption method combining an authentication method according to an exemplary embodiment of the present invention. Referring to FIG. 10, the block encryption method proceeds as follows. As described above, a temporary secret key (TPK) is generated based on the sequential processing (S310). The temporary secret key verification value C0 is generated from the temporary secret key TPK generated using one of the three methods described above (encryption method, hash method, synchronization method) (S320). In order to secure encryption against side channel attacks, fixed secret secret keys are not repeatedly used for a predetermined number. Using the generated temporary secret key (TPK), the message is encrypted so that the internal state value is continuously changed, and an authentication code is generated (S330). This time, I will explain the password authentication scheme that is designed based on the TPK table for session keys and the TPK table for nonce columns. Here, the nonce column is used to generate a mask column to protect the session key. Specifically, a mask value is used to protect input / output information of an encryption primitive using a session key. Examples of cryptographic primitives include block ciphers, compression functions, substitution functions, and tweakable block ciphers.
도 11은 본 발명의 실시 예에 따른 암호 인증 방식을 설명하기 위한 블록 암호화 동작을 보여주는 도면이다. 도 11에서는 설명의 편의를 위하여 변형된 OCB (offset code book) 모드라고 가정하겠다. 도 11을 참조하면, 임의의 길이의 메시지(M)이 입력 될 때, 메시지(M)를 블록 암호의 블록 크기 단위로 쪼개어 이를 M=M1||M2||...||Mt 와 같이 표기한다. 이때, 마지막 단위 메시지(Mt)의 크기는 1에서부터 블록 크기 사이의 임의의 값 중에서 선택될 수 있다.FIG. 11 is a diagram illustrating a block ciphering operation for explaining a cipher authentication method according to an exemplary embodiment of the present invention. FIG. In FIG. 11, it is assumed that a modified offset code book (OCB) mode is used for convenience of description. Referring to FIG. 11, when a message M having an arbitrary length is input, the message M is divided into block size units of a block cipher and expressed as M = M1 || M2 || ... || Mt. do. In this case, the size of the last unit message Mt may be selected from any value between 1 and the block size.
도 12는 임시 비밀 난스로부터 마스크 열을 발생하는 방법을 예시적으로 보여주는 도면이다. 여기서 Const는 고정된 상수 값이다. 본 발명에서 서로 다른 도면에 동일한 Const를 썼다고 해서 동일한 상수 값인 것은 아니다. 편의상 고정된 상수라는 뜻에서 Const라고 쓴다. Const'등 나머지 상수 값들에 대해서도 마찬가지이다. 도 12을 참조하면, 임시 비밀 난스(N)으로부터 발생된 마스크 값들(Z1, Z2,...)은 도 11에서 공유 비밀키(K)를 암호 인증시 부채널 공격으로부터 보호하는 데 사용된다. 매번 다른 랜덤한 마스크 값들(Z1, Z2,...)을 사용함으로써, 공격자로 하여금 암호인증 과정 동안 블록 암호의 입출력 정보를 철저히 숨길 수 있다. 따라서, 부채널 공격자로 하여금 블록 암호에 사용된 공유 키(K) 값이 보호될 수 있다. 이때 K는 세션 키 값이 될 수 있다. 그리고, 난스 열 및 세션 키 값들은 TPK 테이블 발생 방식처럼 각각 테이블을 유지하여 사용할 수 있다. 복호검증 과정의 경우에는 TPK 테이블에 사용된 임시 비밀 키만을 사용하도록 함으로 다양한 부채널 공격에 대한 강한 안전성을 제공할 수 있게 된다.12 is a diagram illustrating a method of generating a mask train from a temporary secret nonce. Where Const is a fixed constant value. In the present invention, the same Const in different drawings is not the same constant value. For convenience, we write Const to mean a fixed constant. The same applies to the rest of the constant values, such as Const '. Referring to FIG. 12, the mask values Z1, Z2,... Generated from the temporary secret nonce N are used to protect the shared secret key K from side channel attacks in cryptographic authentication in FIG. 11. By using different random mask values (Z1, Z2, ...) each time, the attacker can thoroughly hide the I / O information of the block cipher during the encryption authentication process. Therefore, the shared channel K value used for the block cipher by the subchannel attacker can be protected. K may be a session key value. The nonce and session key values can be maintained in a table like the TPK table generation method. In the case of the decryption verification process, only the temporary secret key used in the TPK table can be used to provide strong security against various side channel attacks.
그러면, 도 11과 같이 암호화 및 인증을 수행함으로써, 암호문C(=C0||C1||...||Ct)와 τ비트 값인 인증 코드(T)가 발생된다. 도 11에서는 C0 발생시 해쉬 함수 기반 방법이 사용되었다. 유사하게, 암호화 기반, 동기화 기반 방식들이 사용될 수도 있다. 공유 키(K)는 두 암호 모듈들(120, 220) 사이에 공유된 키,그리고 체크썸(Checksum)=M1 xor M2 xor ... xor (Mt||0*) 으로 정의된다.Then, by performing encryption and authentication as shown in FIG. 11, an encryption code C (= C0 || C1 || ... || Ct) and an τ bit value are generated. In FIG. 11, a hash function based method is used when C0 occurs. Similarly, encryption-based, synchronization-based schemes may be used. The shared key K is defined as the shared key between the two cryptographic modules 120 and 220, and Checksum = M1 xor M2 xor ... xor (Mt || 0 *).
도 11에 도시된 방식은 일반적인 OCB 모드와 달리 부채널 공격에 강한 안전성을 제공하도록 하기 위하여, 도 12에서 보인 것처럼 마스크 값들을 매번랜덤하도록 발생하는 방식을 취하고 있다. 또한, 도 11에서는 마지막 인증코드 T 값 발생시 블록 암호의 출력에도 마스크 값을 적용하여 사용된 공유 키 또는 세션 키 K를 보호하고 있다. 또한 TPK 테이블 내의 유효한 임시 비밀 값만 복호검증 과정시 사용하도록 유도함으로써 다양한 부채널 공격에 대한 안전성을 제공할 수 있다. 결론적으로, 도 11에 도시된 변형된 OCB 모드는 부채널 공격에 강력한 안전성을 제공할 수 있다.Unlike the general OCB mode, the method illustrated in FIG. 11 takes a method of generating mask values randomly as shown in FIG. 12 to provide strong safety against side channel attacks. In addition, in FIG. 11, a mask value is also applied to the output of the block cipher when the last authentication code T value is generated to protect the shared key or session key K used. In addition, it is possible to provide safety against various side channel attacks by inducing only valid temporary secret values in the TPK table to be used in the decryption verification process. In conclusion, the modified OCB mode shown in FIG. 11 may provide strong safety against side channel attacks.
도 13은 도 11에 도시된 체크썸(Checksum)을 Checksum=a1 xor a2 xor ...xor at xor (Mt||0*) 으로 변경한 경우를 보여주는 도면이다.FIG. 13 is a diagram illustrating a case where the checksum shown in FIG. 11 is changed to Checksum = a1 xor a2 xor ... xor at xor (Mt || 0 *).
도 14는 도 11에 도시된 마지막 메시지 블록 처리 방식 및 체크썸(Checksum) 변경의 예를 보여주는 도면이다. 도 14는 도 11에 도시된 것과 비교하여, 체크썸(Checksum) 발생하는 방법과 마지막 메시지 블록 처리에 차이점을 갖는다. 임의의 길이의 메시지(M)이 입력될 때, 10* 패딩을 이용하여 M||10*=M1||M2||...||Mt 와 같이 표기한다. 그러면, 도 14에 도시된 바와 같이 암호화 및 인증을 수행함으로써, 암호화된 메시지(C)(=C0||C1||...||Ct)와 τ비트 값인 인증 코드(T)가 발생된다. 이때 Checksum=a1 xor a2 xor ... xor at 으로 정의된다. 여기서 메시지 블록이 아닌, ai들 값들로 Checksum를 발생한다.FIG. 14 is a diagram illustrating an example of changing a last message block processing method and a checksum illustrated in FIG. 11. FIG. 14 has a difference in the method of generating a checksum and processing of the last message block compared to that shown in FIG. When a message of arbitrary length (M) is entered, it is written as M || 10 * = M1 || M2 || ... || Mt using 10 * padding. Then, by performing encryption and authentication as shown in FIG. 14, an encrypted message C (= C0 || C1 || ... || Ct) and an authentication code T having a τ bit value are generated. In this case, Checksum = a1 xor a2 xor ... xor at. Here we generate a checksum with the values of ai, not the message block.
도 15는 도 14에 도시된 마지막 메시지 블록 처리 시 마스크 값 적용 방식의 변경의 예를 보여주는 도면이다. 도 15을 참조하면, 도 14에 도시된 마지막 메시지 블록에 constant라는 상수 값을 이용하여 순환이동 시킨 값으로 마스크 값이 정의된다. 이때 constant는 0 혹은 블록 크기의 배수가 되면 안된다. 이처럼 마지막 메시지 블록 처리시 다른 마스크 값을 적용함으로써 위조 공격에 대한 안전성이 제공된다. 이와 유사하게 다른 구조들에 대해서도 마스크 값 변경이 가능하다.FIG. 15 is a diagram illustrating an example of changing a mask value applying method when processing the last message block illustrated in FIG. 14. Referring to FIG. 15, a mask value is defined as a value cyclically shifted using a constant value constant in the last message block shown in FIG. 14. The constant must not be zero or a multiple of the block size. As such, applying a different mask value when processing the last message block provides security against counterfeit attacks. Similarly, mask values can be changed for other structures.
도 16은 도 14에 도시된 부가정보를 함께 인증하고자 할 경우에 대한 변경의 예를 보여주는 도면이다. 도 16을 참조하면, 도 14와 비교하여 부가정보(A)가 포함된 경우에 대해 암호문과 인증 코드를 발생 방법을 도시한다. 부가정보를 A라고 할 때, 먼저, A에 패딩이 수행된다. 패딩 후 A의 크기가 블록 크기의 배수가 되어야 한다. 아래에서는 설명의 편의를 위하여, 패딩 방법을 pad라고 할 때, pad(A)=A1||...||Aj 처럼 패딩 후의 크기가 j 블록으로 표현된다고 가정하겠다. 예를 들어, 패딩 방법으로 10* 패딩 방법이 이용될 수 있다. 그리고 체크썸(Checksum)= α1 xor ...xor αj xor a1 xor a2 xor ...xor at로 정의된다. 이 때, 암호문과 인증 코드가 발생된다. 즉, 부가 정보(A)는 암호문의 크기에는 변화를 주지 않고, 단지 인증 코드 발생시에만 영향을 준다. 즉, 암호화된 메시지(C)(=C0||C1||...||Ct)와 τ비트 값인 인증 코드(T)가 발생된다. 유사한 방식으로 나머지 방식들에 대해서도 부가정보가 추가된 경우로 확장될 수 있다.FIG. 16 is a diagram illustrating an example of a change to a case where the additional information shown in FIG. 14 is to be authenticated together. Referring to FIG. 16, a method of generating a cipher text and an authentication code in a case where additional information A is included in comparison with FIG. 14 is illustrated. When the additional information is referred to as A, first, A is padded. After padding, the size of A should be a multiple of the block size. For convenience of explanation, when the padding method is pad, it is assumed that the size after padding is expressed as a j block, such as pad (A) = A1 || ... || Aj. For example, a 10 * padding method may be used as the padding method. And checksum = α1 xor ... xor αj xor a1 xor a2 xor ... xor at. At this time, a cipher text and an authentication code are generated. That is, the additional information A does not change the size of the cipher text, but only affects the generation of the authentication code. That is, an encrypted message C (= C0 || C1 || ... || Ct) and an authentication code T having a τ bit value are generated. In a similar manner, the additional information may be extended to other cases.
도 17은 본 발명의 실시 예에 따른 마스크 값 적용 없이 매 블록 암호의 키를 갱신하는 방식의 예를 보여주는 도면이다. 여기서, Const와 Const' 서로 다른 상수 값들이다. 도 17을 참조하면, 상술 된 방식들과 달리 마스크 값들을 사용하지 않고 매번 블록 암호에 사용된 키 값이 업데이트 된다. 임의의 길이의 메시지(M)가 입력 될 때, 메시지(M)을 블록 암호의 블록 크기 단위로 쪼개어, 이를 M=M1||M2||...||Mt 와 같이 표기한다. 이때, 마지막(Mt)의 크기는 1에서 블록 크기 사이의 임의의 값을 취할 수 있다. 그러면, 도 14에 도시된 바와 같이 암호화 및 인증을 수행함으로써, 암호화된 메시지(C)(=C0||C1||...||Ct)와 τ비트 값인 인증 코드(T)가 발생된다. 체크썸(Checksum)=M1 xor M2 xor ...xor (Mt||0*)으로 정의된다.17 is a diagram illustrating an example of a method of updating a key of every block cipher without applying a mask value according to an embodiment of the present invention. Where Const and Const 'are different constant values. Referring to FIG. 17, unlike the above-described schemes, the key value used for the block cipher is updated every time without using mask values. When a message M of arbitrary length is input, the message M is split into block cipher block size units and written as M = M1 || M2 || ... || Mt. At this time, the size of the last Mt may take any value between 1 and the block size. Then, by performing encryption and authentication as shown in FIG. 14, an encrypted message C (= C0 || C1 || ... || Ct) and an authentication code T having a τ bit value are generated. Checksum = M1 xor M2 xor ... xor (Mt || 0 *).
도 18은 도 17에 도시된 부가정보를 함께 인증하고자 할 경우에 대한 변경의 예를 보여주는 도면이다. 도 18을 참조하면, 도 17에 도시된 부가정보를 어떻게 처리할 수 있는지를 보여준다. 이때, 체크썸은 Checksum= α1 xor ...xor αj xor M1 xor M2 xor ...xor (Mt||0*)으로 정의된다.FIG. 18 is a diagram illustrating an example of a change to a case where the additional information shown in FIG. 17 is to be authenticated together. Referring to FIG. 18, it is shown how the additional information illustrated in FIG. 17 may be processed. At this time, the checksum is defined as Checksum = α1 xor ... xor αj xor M1 xor M2 xor ... xor (Mt || 0 *).
도 19는 도 17에 도시된 마지막 체크썸(Checksum) 처리시 임시 비밀 값을 이용하여 키를 갱신하는 예를 보여주는 도면이다. 도 19를 참조하면, 도 17에 도시된 마지막 체크썸(Checksum) 처리 과정 시 임시 비밀 난스(N)을 이용하여 블록 암호 키를 업데이트 하는 것을 보여준다. 이와 유사하게 다른 방식들에 대해서도 변경이 가능하다.FIG. 19 is a diagram illustrating an example of updating a key by using a temporary secret value when processing the last checksum illustrated in FIG. 17. Referring to FIG. 19, it is shown that the block cipher key is updated by using a temporary secret nonce (N) during the last checksum processing shown in FIG. 17. Similarly, other ways can be changed.
도 20은 도 19에 도시된 매번 블록 암호 연산 앞에 마스크 값을 블록 암호의 키 값을 이용하여 발생시키는 것을 보여준다. 그리고 체크썸(Checksum)을 평문 자체로부터가 아닌, 평문과 마스크 값을 XOR 연산 후의 값들을 이용함으로써 체크썸(Checksum)이 발생된다. 이때 체크썸은 Checksum = a1 xor a2 xor ...xor at 으로 정의된다. 부가정보 A가 추가되는 경우에도 앞에서와 유사하게 정의할 수 있다.20 shows generating a mask value before each block cipher operation shown in FIG. 19 by using a key value of the block cipher. A checksum is generated by using the values of the plain text and the mask value after the XOR operation, not the checksum from the plain text itself. At this time, the checksum is defined as Checksum = a1 xor a2 xor ... xor at. When additional information A is added, it can be defined similarly to the above.
도 21은 본 발명의 실시 예에 따른 복호검증동작을 보여주는 흐름도이다. 도 10 내지 도 21을 참조하면, 복호검증 동작은 다음과 같다.21 is a flowchart illustrating a decryption verification operation according to an embodiment of the present invention. 10 to 21, the decoding verification operation is as follows.
암호 모듈(도 1 참조, 240)에 암호화된 메시지(C)와 인증 코드(T)가 입력된다(S410). 암호화된 메시지(C) 혹은 인증 코드(T)에 대응하는 임시 비밀키(TPK)가 유효한지 판별된다(S420). 앞서 설명했던 복호화 단계에서 설명했던 방식대로 C0에 대응되는 임시 비밀키(TPK)이 제한된 회수 이상 반복 사용되었던 값인지를 판별된다. 만일, 임시 비밀키(TPK)가 유효하다면, 인증 코드(T)가 검증되고, 암호화된 메시지(C)에 대한 복호화 동작이 수행된다(S440), 반면에, 임시 비밀키(TPK)가 유효하지 않다면, 인증 코드(T)의 검증이 진행되지 않거나 암호화된 메시지(C)에 대한 복호화 동작이 중단된다(S445). 즉, 임시 비밀키(TPK)가 제한된 회수 이상 이미 사용된 경우 인증 코드(T) 검증 동작 혹은 복호화 동작이 즉각적으로 중단된다.The encrypted message C and the authentication code T are input to the encryption module 240 (see FIG. 1) (S410). It is determined whether the temporary secret key TPK corresponding to the encrypted message C or the authentication code T is valid (S420). As described in the above-described decryption step, it is determined whether the temporary secret key (TPK) corresponding to C0 has been repeatedly used for a limited number of times. If the temporary secret key (TPK) is valid, the authentication code (T) is verified, and the decryption operation on the encrypted message (C) is performed (S440), while the temporary secret key (TPK) is not valid. If not, verification of the authentication code (T) is not in progress or the decryption operation for the encrypted message (C) is stopped (S445). That is, if the temporary secret key TTP has already been used for a limited number of times, the verification code T verification operation or decryption operation is immediately stopped.
치환함수 기반 암복호화 + 인증 방식에 관하여Substitution-based encryption / decryption + authentication scheme
도 23은 본 발명의 실시 예에 따른 치환 함수에 기반하여 프리픽스 프리(prefix free) 메시지 패딩에 기반한 암호인증 방식을 설계하는 예를 보여주는 도면이다. 본 발명의 인증 방식을 이용한 치환함수 기반의 암호인증 및 복호검증 과정은 다음과 같다. 우선 암호인증 과정은 다음과 같이 진행된다. 앞서 설명한 방식과 동일하게 순차처리 기반을 수행함으로써, 도 22에 도시된 바와 같이 치환함수(P)를 이용하여 공유 키(K)로부터 임시 비밀키들 (Ni, Ni', i는 정수)을 순차적 발생된다. 이 후에, 앞서 설명한 바와 같이 유사하게 검증키(C0)가 발생됨으로써, 임시 비밀키(TPK)가 보호된다. 이후에 부채널 공격에 안전하도록 발생된 임시 비밀키(TPK)을 이용하여 내부 상태 값이 지속적으로 바뀌도록 암호화 과정이 수행된다. 즉, 기반 암호 프리미티브 (여기서는 치환함수 또는 압축함수) 에 공유 키 또는 세션 키 또는 임시 비밀키가 반복적으로 사용되지 않는 않는 경우에 있어서, 내부 프리미티브의 입출력 각각의 일부 또는 전부를 숨기는 방식을 취하여 역연산 또는 순방향 연산에 대해 공격자가 알 수 없도록 하고 있다. 이로 인해 공격자는 사용된 공유 키 또는 세션 키 또는 임시 비밀키를 얻을 수 없게 된다.FIG. 23 is a diagram illustrating an example of designing an encryption authentication scheme based on prefix free message padding based on a substitution function according to an embodiment of the present invention. The substitution function-based encryption authentication and decryption verification process using the authentication method of the present invention are as follows. First, the password authentication process proceeds as follows. By performing the sequential processing in the same manner as described above, the temporary secret keys (Ni, Ni ', i are integers) are sequentially generated from the shared key K by using the substitution function P as shown in FIG. 22. do. Thereafter, as described above, the verification key C0 is generated similarly, thereby protecting the temporary secret key TPK. Afterwards, the encryption process is performed so that the internal state value is continuously changed by using a temporary secret key (TPK) generated to secure side channel attacks. That is, in the case where the shared key, session key, or temporary secret key are not repeatedly used in the base cryptographic primitive (here, substitution function or compression function), the reverse operation is performed by hiding a part or all of each input / output of the inner primitive. It also prevents attackers from knowing about forward operations. This prevents an attacker from obtaining the shared key, session key, or temporary secret key used.
도 23은 본 발명의 실시 예에 따른 치환 함수에 기반하여 임의의 리버서블(reversible) 메시지 패딩에 기반한 암호인증 방식을 설계하는 예를 보여주는 도면이다. 도 23을 참조하면, 임의의 길이의 메시지(M)를 처리하기 위해서 패딩 방법 pad를 적용한 후, pad(M)=M1||M2||...||Mt 와 같이 표기한다. 특히, 안전성을 위하여 패딩 방법 pad는 prefix-free이어야 한다. 이는 임의의 서로 다른 두 메시지(M), M'에 대해, pad(M)은 결코 pad(M')의 프리픽스(prefix)가 되어서는 안된다는 뜻이다. 도 18에 도시된 바와 같이 메시지(M)에 대해 C(=C0||C1||...||Ct)와 τ비트 값인 인증 코드(T)가 발생된다.FIG. 23 is a diagram illustrating an example of designing an encryption authentication scheme based on arbitrary reversible message padding based on a substitution function according to an embodiment of the present invention. Referring to FIG. 23, after the padding method pad is applied to process a message M having an arbitrary length, pad (M) = M1 || M2 || ... || Mt is expressed. In particular, the padding method pad must be prefix-free for safety reasons. This means that for any two different messages M, M ', pad (M) should never be a prefix of pad (M'). As shown in FIG. 18, C (= C0 || C1 || ... || Ct) and an τ bit value are generated for the message M.
도 24 및 도 25는 도 23에 도시된 메시지 패딩 방법이 프리픽스 프리(prefix free)가 아닌 임의의 리버서블(reversible) 패딩 방법들에 대하여 예시적으로 보여주는 도면들이다.24 and 25 are diagrams exemplarily illustrating any reversible padding methods in which the message padding method shown in FIG. 23 is not prefix free.
도 26은 도 14에 도시된 부가 정보에 임의의 길이의 인증 코드 값을 출력할 수 있도록 변경한 방식을 보여준다. 유사하게 도 25 및 도 26도 변경 가능할 수 있다.FIG. 26 is a view illustrating a method of changing an authentication code value having an arbitrary length to output additional information shown in FIG. 14. Similarly, Figs. 25 and 26 may also be changeable.
다음으로, 치환함수 기반의 복호 과정은 다음과 같이 진행된다. 우선적으로, 임시 비밀키 검증값(C0)을 이용하여 검증값(C0)에 대응되는 임시 비밀키(TPK)가 이전에 사용되었던 값인지가 판별된다. 임시 비밀키(TPK)가 반복 사용되지 않은 것을 검증한 후, 임시 비밀키(TPK)가 계산되고, 입력된 암호화된 메시지(C)에 대한 복호화 동작 및 인증 코드 검증 동작이 수행된다. 만일, 검증값(C0)에 대응되는 임시 비밀키(TPK)가 유효하지 않다면, 즉각적으로 복호화 동작 및 인증 코드 검증 동작이 중단된다.Next, the substitution function-based decoding process proceeds as follows. First, the temporary secret key verification value C0 is used to determine whether the temporary secret key TPK corresponding to the verification value C0 has been previously used. After verifying that the temporary secret key TPK has not been repeatedly used, the temporary secret key TPK is calculated, and a decryption operation and an authentication code verification operation on the input encrypted message C are performed. If the temporary secret key TPK corresponding to the verification value C0 is invalid, the decryption operation and the authentication code verification operation are immediately stopped.
압축함수 기반 암복호화 + 인증 방식에 관하여Compression Function Based Encryption / Authentication
압축 함수 기반 암복화 방식은 치환 함수 기반 방식과 매우 유사하게 수행된다. 도 27은 본 발명의 실시 예에 따른 압축 함수(f)를 이용하여 임시 비밀 난스들(Ni,Ni', Ni'')을 순차 처리 방식에 의해 발생하는 예를 보여주는 도면이다. 도 27를 참조하면, 압축함수 f를 이용하여 공유 키(K)로부터 임시 비밀키들(Ni,Ni', Ni'')이 순차적으로 발생 된다. 발생된 임시 비밀키들(Ni,Ni', Ni'')은 앞에서 설명된 바와 같이 보호되고, 임시 비밀키들을 이용하여 암호화 동작 및 인증 코드가 발생된다.The compression function based encryption scheme is performed very similarly to the substitution function based scheme. 27 is a diagram illustrating an example of generating temporary secret nonce (Ni, Ni ', Ni' ') by a sequential processing method using a compression function f according to an embodiment of the present invention. Referring to FIG. 27, temporary secret keys Ni, Ni ', and Ni' 'are sequentially generated from the shared key K using the compression function f. The generated temporary secret keys Ni, Ni ', and Ni' 'are protected as described above, and an encryption operation and an authentication code are generated using the temporary secret keys.
도 28은 본 발명의 실시 예에 따른 압축 함수(f)에 기반하여 프리픽스 프리(prefix free) 메시지 패딩에 기반한 암호인증 방식을 설계하는 예를 보여주는 도면이다. 도 28을 참조하면, 임의의 길이의 메시지(M)를 처리하기 위해서 패딩 방법 pad를 적용한 후, pad(M)=M1||M2||...||Mt 와 같이 표기한다. 특히, 안전성을 위하여 패딩 방법 pad는 프리픽스 프리(prefix-free)이어야 한다. 이는 임의의 서로 다른 두 메시지(M), M'에 대해, pad(M)은 결코 pad(M')의 prefix가 되어서는 안된다는 뜻이다. 입력된 메시지(M)에 대해 C(=C0||C1||...||Ct)와 τ비트 값인 인증 코드(T)가 발생된다.FIG. 28 is a diagram illustrating an example of designing an encryption authentication scheme based on prefix free message padding based on a compression function f according to an embodiment of the present invention. Referring to FIG. 28, after applying a padding method pad to process a message M of an arbitrary length, it is written as pad (M) = M1 || M2 || ... || Mt. In particular, the padding method pad should be prefix-free for safety reasons. This means that for any two different messages M, M ', pad (M) should never be a prefix of pad (M'). For the input message M, C (= C0 || C1 || ... || Ct) and an τ bit value are generated.
도 29 및 도 30은 도 28에 도시된 메시지 패딩 방법이 프리픽스 프리(prefix free)가 아닌 임의의 reversible 패딩 방법을 보여준다. 한편, 도 27에 도시된 바와 같이, 도 28, 도 29, 및 도 30에 부가 정보에 임의의 길이의 인증 코드 값을 출력할 수 있도록 변경될 수 있다.29 and 30 show an arbitrary reversible padding method in which the message padding method shown in FIG. 28 is not prefix free. On the other hand, as shown in Figure 27, it can be changed to output an authentication code value of any length in the additional information in Figures 28, 29, and 30.
한편, 임시 비밀키(TPK) 검증 동작 및 그에 따른 복호화 및 인증 동작은 치환 함수 기반의 그것과 유사하다.On the other hand, the temporary secret key (TPK) verification operation and thus decryption and authentication operation are similar to that of the substitution function.
메시지 인증 방식에 관하여About message authentication method
메시지 인증 동작은 메시지 암호화 동작과 유사하게 진행된다.The message authentication operation proceeds similarly to the message encryption operation.
도 31은 본 발명의 실시 예에 따른 CBC MAC(cipher block chaining message authentication code)을 예시적으로 보여주는 도면이다. CBC MAC에는 난스 값이 적용되지 않기 때문에, 모든 블록 암호 연산에서 비밀키 값이 노출될 수 있다. 따라서, 앞서 여러 예들에서 보인 것처럼 매번 블록 암호 비밀 값이 변경되던가, 아니면 블록 암호 입출력 값이 노출되지 않도록 마스킹 과정이 요구된다.31 is a diagram illustrating a CBC MAC (cipher block chaining message authentication code) according to an embodiment of the present invention. Since the nonce value is not applied to the CBC MAC, the secret key value may be exposed in all block cipher operations. Therefore, a masking process is required so that the block cipher secret value is changed each time or the block cipher input / output value is not exposed as shown in the various examples.
도 32는 본 발명의 실시 예에 따른 마스킹 과정을 적용시킨 경우를 보여준다. CBC MAC 값은 T로부터 정의하지만, 앞서 설명한 방식으로 난스 값을 보호하기 위하여, 해쉬 함수 H와 H'이용하여 임시 비밀 값(N)에 대해 C=H(N)와 T=H'(N) xor X (여기서 X는 마지막 블록암호의 출력값임, H'(N)은 마스크 값으로 사용)를 수행하고, 최종 MAC 값으로 C||T 으로 취한다.32 illustrates a case where a masking process according to an embodiment of the present invention is applied. The CBC MAC value is defined from T, but in order to protect the nonce in the manner described above, C = H (N) and T = H '(N) for the temporary secret value (N) using the hash functions H and H'. Perform xor X (where X is the output of the last block cipher and H '(N) is used as the mask value) and take C || T as the final MAC value.
도 33은 본 발명의 실시 예에 따른 OMAC(one-key MAC)를 보여주는 도면이다. OMAC 역시 CBC MAC 처럼 난스 값이 적용되지 않기 때문에, 모든 블록 암호 연산에서 비밀키 값이 노출될 수 있다. 따라서, 매번 블록 암호 비밀 값을 바꾸던가, 아니면 블록 암호 입출력 값이 노출되지 않도록 마스킹 과정이 요구된다. 구체적으로, 도 33에서 설명한 방식으로 OMAC를 변형시키면 된다. 그리고, 마지막 블록암호 입력 값 부분에 고정된 비밀 값들인 HL(Cst1)과 HL(Cst2)를 적용하는 대신, 가령 예를 들어, H(Cst1||N)과 H(Cst2||N)을 발생하여 (이때, 비밀 값(L)대신 고정된 상수 값 Cst1과 Cst2를 사용), 마지막 블록암호 입출력 값의 마스크 값들로 활용할 수 있다. 앞서 설명한 방식으로 임시 비밀키(N)을 보호하기 위하여, H(N)과 H'(N)를 수행하고, 앞서 동일한 방식으로 최종 인증 코드 값으로 C||T 으로 취한다. 이때, H 입력 값에 난스와 공유키 값이 동시에 들어갈 수 있으며, 임시 비밀키(TPK)에 대한 해싱 대신 공유키(K)를 이용하여 난스를 암호화하는 방식을 취할 수도 있다.33 is a diagram illustrating a one-key MAC (OMAC) according to an embodiment of the present invention. Since OMAC does not apply nonce values like CBC MAC, secret key values can be exposed in all block cipher operations. Therefore, a masking process is required so that the block cipher secret value is changed every time or the block cipher input / output value is not exposed. Specifically, the OMAC may be modified in the manner described with reference to FIG. 33. And instead of applying fixed secret values H L (Cst1) and H L (Cst2) to the last block code input value part, for example, H (Cst1 || N) and H (Cst2 || N) Can be used as a mask value of the last block cipher I / O value, using fixed constant values Cst1 and Cst2 instead of secret value (L). In order to protect the temporary secret key (N) in the manner described above, H (N) and H '(N) are performed and taken as C || T as the final authentication code value in the same manner. In this case, the nonce and the shared key value may be simultaneously entered into the H input value, and the nonce may be encrypted using the shared key K instead of hashing the temporary secret key TPK.
도 34는 PMAC(parallelizable MAC)를 보여주는 도면이다. 도 34를 참조하면, L이 고정된 값이기 때문에 안전하지 않다. 따라서, L 값을 변형시켜 주어야 한다. 앞에서 설명한 방식과 마찬가지로 (N,H(N))을 발생하고, C=H(N)로 정의된다. 그리고 앞서 보인 방식으로 N을 이용하여 L 값 혹은 매 블록마다 서로 다른 마스크 값들을 발생하여 블록 암호의 입력 값들을 보호한다. 그리고, 앞서 보인 방식으로 마지막 인증 코드 값 발생시 블록암호의 출력값에 마스크 값을 적용시켜야 한다. 34 is a diagram illustrating a parallelizable MAC (PMAC). Referring to Fig. 34, it is not safe because L is a fixed value. Therefore, L value should be modified. Similarly to the method described above, (N, H (N)) is generated, and C = H (N). In the above-described manner, N is used to generate L masks or different mask values for each block to protect input values of the block cipher. In addition, in the above-described manner, when the last authentication code value is generated, a mask value should be applied to the output value of the block password.
이번에 HMAC에 대해서 살펴보자. 키를 K, 메시지를 M, T를 인증 코드 값이라고 할 때, T=HMAC(K,M)라고 표현된다. 이때, 본 발명의 방식으로 변형할 경우, 예를 들어 C=H(N)이고 T=HMAC(N,M)일 때, M에 대한 최종 인증 코드 값으로 C||T로 정의를 내린다. Let's take a look at HMAC. When the key is K, the message is M, and T is the authentication code value, it is expressed as T = HMAC (K, M). In this case, when the modification of the present invention, for example, when C = H (N) and T = HMAC (N, M), it is defined as C || T as the final authentication code value for M.
인증 코드 검증 동작은 임시 비밀키(TPK)가 반복 사용되지 않은 것을 검증한 후, 그 결과에 따라 수행 된다.The authentication code verification operation is performed according to the result after verifying that the temporary secret key (TPK) is not used repeatedly.
임시 비밀키 테이블을 이용한 구체적인 암호 연산 방법Specific cryptographic operation using temporary secret key table
도 35는 본 발명의 실시 예에 따른 임시 비밀키 테이블(TPK Table)을 이용한 암복호화 동작을 예시적으로 설명하는 도면이다. 임시 비밀키 테이블은 두 암호 모듈들(A,B) 사이에 공유되어 있다고 가정하겠다. 도 35에 도시된 바와 같이, 임시 비밀키 테이블은 복수의 엔트리들을 포함하며, 각각의 엔트리는 난스 값과 그것의 해쉬값으로 구성된다고 가정하겠다.35 is a diagram exemplarily illustrating an encryption / decryption operation using a temporary secret key table (TPK Table) according to an embodiment of the present invention. Assume that the temporary secret key table is shared between two cryptographic modules (A, B). As shown in FIG. 35, it is assumed that the temporary secret key table includes a plurality of entries, each entry consisting of a nonce value and its hash value.
암복호화 동작은 다음과 같이 진행된다. 암호 모듈(A, 예를 들어, 도 1의 120)은 암호화 동작을 위하여 임시 비밀키 테이블의 복수의 엔트리 중 어느 하나를 선택한다(①). 아래에서는 설명의 편의를 위하여 선택된 엔트리가 (N3, C0_3)라고 가정하겠다. 암호 모듈(A)은 선택된 엔트리(N3, C0_3)에 포함된 난스 값(N3)을 이용하여 메시지를 암호화시킨다. 이후, 암호화된 메시지는 암호 모듈(B, 예를 들어, 도 1의 220)으로 전송된다. 이때, 암호 모듈(B)은 암호화된 메시지의 일부, 즉, 암호화 동작시 선택된 난스 값(N3)에 대응하는 검증값(C0_3)이 임시 비밀키 테이블에 존재하는 엔트리들에 포함되어 있는지 검증한다(②). 만일, 임시 비밀키(TPK)가 유효하다고 검증되면, 이를 이용하여 암호 모듈(B)는 암호화된 메시지의 복호화를 진행한다(③).The encryption / decryption operation proceeds as follows. The encryption module A (eg, 120 of FIG. 1) selects any one of a plurality of entries of the temporary secret key table for the encryption operation (①). In the following description, it is assumed that the selected entry is (N3, C0_3) for convenience of description. The cryptographic module A encrypts the message using the nonce value N3 contained in the selected entries N3, C0_3. The encrypted message is then sent to the cryptographic module B (eg, 220 of FIG. 1). At this time, the cryptographic module B verifies whether a part of the encrypted message, that is, the verification value C0_3 corresponding to the nonce value N3 selected in the encryption operation, is included in the entries existing in the temporary secret key table ( ②). If the temporary secret key TPK is verified to be valid, the encryption module B proceeds to decrypt the encrypted message using this (③).
한편, 임시 비밀키 테이블은 암호화된 난스 값 검색을 용이하게 하기 위하여 인덱스를 더 포함할 수 있다.On the other hand, the temporary secret key table may further include an index to facilitate the search of the encrypted nonce value.
도 36은 본 발명의 실시 예에 따른 임시 비밀키 테이블을 예시적으로 보여주는 도면이다. 도 36을 참조하면, 임시 비밀키 테이블은 인덱스, 난스 값, 그것의 해쉬 값(혹은, 검증값)으로 구성된 복수의 엔트리들로 구성될 수 있다.36 is a diagram illustrating a temporary secret key table according to an embodiment of the present invention. Referring to FIG. 36, a temporary secret key table may be composed of a plurality of entries consisting of an index, a nonce value, and a hash value (or a verification value) thereof.
아래에서는 암호 모듈들(A, B) 사이에 임시 비밀키 테이블을 공유하는 방법을 설명하겠다. 도 36에서는 설명의 편의를 위하여 두 암호 모듈들A와 B 각각은 공유 키 K로부터 10개의 엔트리를 발생하였다. 즉, 첫번째 엔트리는 (1,N1,C0_1=H(N1)), 두번째 엔트리는 (2,N2,C0_2=H(N2))가 된다. 열번째 엔트리 (10,N10, C0_10=H(N10))까지 발생한다. 그러면 다음과 같은 테이블이 발생이 된다. 이때 테이블은 인덱스를 제외한 나머지 값들은 두 암호 모듈 A와 B 외에는 알 수 없다.The following describes how to share a temporary secret key table between cryptographic modules A and B. In FIG. 36, two cryptographic modules A and B each generate 10 entries from the shared key K for convenience of description. That is, the first entry is (1, N1, C0_1 = H (N1)), and the second entry is (2, N2, C0_2 = H (N2)). Occurs up to the tenth entry (10, N10, C0_10 = H (N10)). Then, the following table is generated. At this time, the table cannot know the remaining values except indexes except for the two cryptographic modules A and B.
상술 된 바와 같이, 임시 비밀키 테이블 공유가 완료되면, 두 암호 모듈들(A,B)은 통신을 시작할 수 있다. 두 전자 장치들 사이에 정해진 프로토콜에 따라 임시 비밀 값들인 N값들을 이용하여 암호 연산을 수행하여 얻은 암호 데이터(C)를 상대방에게 전달한다. 아래에서는 A가 B에게 보내는 경우를 설명하겠다. 이때 암호화 동작 혹은 복호화 동작은 인덱스가 작은 N 값들부터 이용한다. A는 임의의 시점에서 사용한 임시 비밀 값 Ni을 이용하여, 암호 데이터(C)를 발생한다. 그리고 임시 비밀키 테이블에서 사용된 엔트리(i,Ni,C0_i)를 삭제하고, 새로운 인덱스로 자리를 채운다. 이때, 매번 엔트리를 업데이트 하는 대신, 일정한 주기로 할 수 있으며, 업데이트시 검증값(C0)을 이용하여 엔트리를 정렬하여 검색 시간을 단축시킬 수 있다.As described above, when the temporary secret key table sharing is completed, the two cryptographic modules (A, B) can start communication. The cryptographic data (C) obtained by performing a cryptographic operation using N values, which are temporary secret values, is transmitted to the counterpart according to a protocol defined between the two electronic devices. The following describes the case where A sends to B. At this time, the encryption operation or the decryption operation uses N values with small indexes. A generates the encrypted data C using the temporary secret value Ni used at any point in time. Then, the entry (i, Ni, C0_i) used in the temporary secret key table is deleted and filled with the new index. In this case, instead of updating the entry every time, the entry may be performed at regular intervals, and the search time may be shortened by sorting the entries using the verification value C0 during the update.
A는 B에게 난스값(Ni)에 대응되는 검증값(C0_i)을 암호 데이터(C)와 함께 보낸다. 이때 인덱스 i 값은 함께 보내지 않는다. 그 이유는 i는 인덱스 값이라 공격자가 쉽게 유추가 가능하고, 공격자에게 A인 것처럼 위장하여 (i,C0')임을 보내면, B는 i에 해당하는 Ni에 대응되는 검증값(C0_i)와 C0_i'동일한가를 검증하게 된다. 또는 Ni의 해쉬 값이 검증값(C0_i')와 같은가를 체크하게 된다. 만약 공격자가 동일한 i 값에 대해서 반복적으로 질문을 할 경우, Ni 또는 C0_i 값을 공격자가 Template 공격과 같은 부채널 공격에 의해 노출될 위험을 안고 있다.A sends the verification value C0_i corresponding to the nonce value Ni to the B together with the encrypted data C. FIG. The index i value is not sent together. The reason is that i is an index value, so that the attacker can easily infer and send the attacker to (i, C0 ') by pretending to be A, then B is the verification value (C0_i) and C0_i' corresponding to Ni corresponding to i It will verify that it is the same. Or, it is checked whether the hash value of Ni is equal to the verification value C0_i '. If an attacker repeatedly asks about the same i value, there is a risk that the Ni or C0_i value will be exposed by side channel attacks such as template attacks.
본 발명은 인덱스 i 값을 보내지 않기에, B는 자신의 TPK 테이블에서 인덱스 값(i)을 모르는 상태에서 검증값(C0_i)가 있는지 체크할 수 있다. 만약 C0_i가 없으면, 더이상 암호 연산을 수행하지 않는다. 만약 TPK 테이블에서 C0_i 값이 있으면, Ni를 이용하여 암호 연산을 수행한다. 그리고, B가 갖고 있는 TPK 테이블에서 i 보다 작거나 같은 모든 j에 대해 엔트리 (j,Nj,C0_j)가 있으면 삭제하고, 새로운 엔트리들로 자리를 채운다. 이때, 매번 엔트리를 업데이트 하는 대신, 일정한 주기로 할 수 있으며, 업데이트시 검증값(C0)을 이용하여 엔트리를 정렬하여 검색 시간을 단축시킬 수 있다.Since the present invention does not send the index i value, B can check whether there is a verification value C0_i without knowing the index value i in its TPK table. If C0_i is missing, no further cryptographic operations are performed. If there is a C0_i value in the TPK table, the cryptographic operation is performed using Ni. Then, if there is an entry (j, Nj, C0_j) for all js less than or equal to i in B's TPK table, it is deleted and filled with new entries. In this case, instead of updating the entry every time, the entry may be performed at regular intervals, and the search time may be shortened by sorting the entries using the verification value C0 during the update.
한편, B가 A에게 암호 데이터를 보내고자 하는 경우에도 위와 동일한 방법으로 계속 진행할 수 있다.On the other hand, even if B wants to send encrypted data to A, it can proceed in the same way as above.
도 37은 본 발명의 실시 예에 따른 임시 비밀키 테이블의 엔트리 추가 방법을 예시적으로 보여주는 도면이다. 도 37를 참조하면, 제 1 난스(N1)가 암호화 동작 혹은 복호화 동작에 사용되었다고 가정하겠다. 이때, 사용된 엔트리(N1, CO_1)은 임시 비밀키 테이블에서 무효화 데이터이다. 이에 암호 모듈은 새로운 난스(Nk+1)와 그것의 해쉬값(CO_k+1)로 구성된 새로운 엔트리를 임시 비밀키 테이블에 추가할 수 있다.37 is a diagram exemplarily illustrating a method for adding an entry of a temporary secret key table according to an embodiment of the present invention. Referring to FIG. 37, it is assumed that the first nonce N1 is used for an encryption operation or a decryption operation. At this time, the entries N1 and CO_1 used are invalidation data in the temporary secret key table. The cryptographic module can then add a new entry consisting of a new nonce (Nk + 1) and its hash value (CO_k + 1) to the temporary secret key table.
한편, 도 37에 도시된 임시 비밀키 테이블의 엔트리 추가 방법은, 실시 예에 불과하다. 본 발명의 임시 비밀키 테이블의 엔트리 추가 방법은 다양하게 구현될 수 있다. 본 발명은 임시 비밀키 테이블에서 사용된 엔트리의 개수가 소정의 개수 이상이면, 임시 비밀키 테이블을 업데이트하도록 구현할 수 있다.Meanwhile, the method for adding an entry of the temporary secret key table shown in FIG. 37 is merely an embodiment. The method of adding an entry of the temporary secret key table of the present invention can be implemented in various ways. The present invention can be implemented to update the temporary secret key table if the number of entries used in the temporary secret key table is greater than or equal to a predetermined number.
도 35에서 도 37까지에서 소개한 방식들은 암복호화 뿐 아니라, 암호인증, 복호검증, 인증코드 생성 및 검증 등 다양한 암호연산에 유사하게 사용될 수 있다.The schemes introduced in FIGS. 35 to 37 may be similarly used for various encryption operations such as encryption, decryption verification, authentication code generation and verification, as well as encryption and decryption.
도 38은 본 발명의 실시 예에 따른 임시 비밀키 테이블 업데이트 방법을 예시적으로 보여주는 도면이다. 도 38을 참조하면, k개의 엔트리들은, 소정의 조건이 만족될 때, 새롭게 발생 될 수 있다. 여기서 소정의 조건은, 암복호화 동작에 사용된 엔트리의 개수가 소정의 개수 이상인 지가 될 수 있다.38 is a diagram illustrating a temporary secret key table update method according to an embodiment of the present invention. Referring to FIG. 38, k entries may be newly generated when a predetermined condition is satisfied. Here, the predetermined condition may be whether the number of entries used for the encryption / decryption operation is equal to or greater than the predetermined number.
일반적인 암호 시스템은 카운터를 상대방에게 전달함으로 상대방이 그에 해당되는 임시 비밀키 값을 계산하여 암호 연산을 수행하는 방식으로 구현된다. 이때, 카운터 값은 줄어들지 않고 증가하는 값이다. 먼저 카운트 값이 유효한지를 검증한 후, 암호 연산을 수행하는 데에 있다. 카운터 값이 달라지면 각 카운트 값에 대응되는 임시 비밀키 값 또한 갱신하기 때문에 부채널 공격에 대해 강한 안전성을 제공할 수 있게 된다. 하지만, 카운터 값에 기반한 암호 연산은 검색 시간 단축 및 작은 메모리 등에 사용될 수 있는 장점이 있지만, 카운터 값의 특성상 공격자에게 쉽게 노출될 수 있다. 그 이유는 카운터 값은 줄어들지 않고 증가하는 값이기 때문에, 비밀 카운터 값을 쓴다고 할지라도 쉽게 정당한 카운터 값의 유추가 가능하게 된다. 이로 인해 카운터 값이 정당한 사용자에 의해 발생된 값인지, 아니면 공격자에 의해 발생된 값인지에 대한 검증이 어려워진다. 이로 인해 정당한 사용자에 의해 발생된 카운터 값인지에 대한 추가 검증이 요구된다. 하지만, 이러한 추가 검증 절차는 DoS 공격과 같이 리소스를 낭비하는 공격에 대해 취약하게 되고, 특히 배터리 기반의 암호 연산의 경우 배터리 수명을 크게 단축시킬 수 있다. 또한 동일한 카운터 값에 대응되는 암호 연산을 반복사용할 경우 Template 공격과 같은 부채널 공격에 취약할 수 있다.A general cryptographic system is implemented in such a way that a counterpart calculates a temporary secret key value by performing a cryptographic operation by passing a counter to the counterpart. At this time, the counter value does not decrease and increases. First, verify that the count value is valid, and then perform cryptographic operations. If the counter value is changed, the temporary secret key value corresponding to each count value is also updated, thereby providing strong security against side channel attacks. However, the cryptographic operation based on the counter value has the advantage that it can be used to shorten the search time and the small memory, etc. The reason is that the counter value does not decrease and increases, so even if a secret counter value is used, a legitimate counter value can be easily derived. This makes it difficult to verify whether a counter value is generated by a legitimate user or by an attacker. This requires further verification that the counter is generated by a legitimate user. However, these additional verification procedures are vulnerable to resource-wasting attacks such as DoS attacks, which can significantly reduce battery life, especially for battery-based cryptographic operations. In addition, repeated use of cryptographic operations corresponding to the same counter value can be vulnerable to side channel attacks such as template attacks.
또 다른 암호 시스템은 카운터 값을 유지할 필요가 없이 부채널 공격에 안전성을 주면서, 임의의 암호문을 회수에 제한 없이 복호화를 수행하도록 구현된다. 이를 위해 메시지 블록 하나하나를 인증하는 과정을 추가하는 방법을 제시하고 있다. 하지만, 이러한 반복된 인증 과정은 통신의 효율성이 중요시 되는 환경에서는 비효율적이며, 또한 배터리 기반 환경에서는 에너지 소모량이 증가하게 되어 사용하는 데에 어려움이 있다.Another cryptographic system is implemented to perform decryption without limiting the number of random ciphertexts, while providing security for side channel attacks without the need to maintain counter values. To this end, a method of adding a process of authenticating each message block is presented. However, this repeated authentication process is inefficient in an environment where communication efficiency is important, and in a battery-based environment, energy consumption increases, which makes it difficult to use.
본 발명의 실시 예에 따른 암호 시스템은 통신의 효율성을 극대화하고 및 에너지 소모량을 최소화 시킬 수 있다. 본 발명의 암호 시스템은 앞으로 사용될 값이 쉽게 유추되는 카운터 값을 상대방에게 보내지 않고, 해쉬 값처럼 유추하기 힘든 값만을 상대방에게 보내므로 암호 연산 시작 전의 유효성 검증을 하도록 구현된다. 이는 기존의 방식들과는 달리 카운터를 사용하지 않기에 Template 공격 등에 안전성을 제공하며, 암호 연산 시작 전에 유효성 검증을 하기 때문에, DoS 공격 등에 대한 탐지를 효율적으로 수행 할 수 있다.An encryption system according to an embodiment of the present invention can maximize communication efficiency and minimize energy consumption. The cryptographic system of the present invention is implemented not to send counter values that are easily inferred in the future to the counterpart, but only to the counterpart, such as hash values, to be validated before the cryptographic operation begins. Unlike conventional methods, it does not use counters, so it provides security for template attacks and validates before the start of cryptographic operations. Therefore, it can efficiently detect DoS attacks.
이 외에도, 본 발명의 암호 시스템은 구체적으로 부채널 공격에 안전하도록 암복호화 및 인증을 수행할 수 있다. 본 발명은 인증코드 발생, 전자서명, 키 인증, 키교환 등 다양한 암호 연산에 적용될 수 있으며, 본 발명에서는 발명 사상과 이에 대한 구체적인 실시 예들을 보였으며, 이로부터 쉽게 유추될 수 있는 모든 기법들을 포함한다.In addition, the cryptographic system of the present invention may specifically perform encryption and decryption and authentication to be safe from side channel attacks. The present invention can be applied to various cryptographic operations such as authentication code generation, digital signature, key authentication, key exchange, etc. The present invention has shown the invention and specific embodiments thereof, and includes all techniques that can be easily inferred therefrom. do.
한편, 상술 된 본 발명의 내용은 발명을 실시하기 위한 구체적인 실시 예들에 불과하다. 본 발명은 구체적이고 실제로 이용할 수 있는 수단 자체뿐 아니라, 장차 기술로 활용할 수 있는 추상적이고 개념적인 아이디어인 기술적 사상을 포함할 것이다.On the other hand, the content of the present invention described above is only specific embodiments for carrying out the invention. The invention will include not only specific and practically available means per se, but also technical ideas as abstract and conceptual ideas that may be utilized in future technology.
본 발명은 암호연산을 수행하는 모든 장치에 이용 가능하다.The present invention is applicable to any device that performs cryptographic operations.

Claims (20)

  1. 암호 모듈을 갖는 전자 장치의 복호화 방법에 있어서:A decryption method of an electronic device having an encryption module, comprising:
    임시 비밀키에 의해 암호화된 메시지를 입력 받는 단계;Receiving a message encrypted by a temporary secret key;
    상기 임시 비밀키와 상기 임시 비밀키의 검증값으로 구성된 엔트리가 상기 암호 모듈의 임시 비밀키 테이블에 존재하는 지를 근거로 하여 상기 임시 비밀키가 유효한 지를 판별하는 단계; 및Determining whether the temporary secret key is valid based on whether an entry consisting of the temporary secret key and the verification value of the temporary secret key exists in the temporary secret key table of the cryptographic module; And
    상기 임시 비밀키가 유효하지 않다면, 상기 암호화된 메시지를 복호화하지 않는 단계를 포함하는 복호화 방법.If the temporary secret key is invalid, not decrypting the encrypted message.
  2. 제 1 항에 있어서,The method of claim 1,
    상기 임시 비밀키가 유효하다면, 상기 암호화된 메시지를 복호화하는 단계를 더 포함하는 복호화 방법.And if the temporary secret key is valid, decrypting the encrypted message.
  3. 제 1 항에 있어서,The method of claim 1,
    상기 임시 비밀키가 유효한 지를 판별하는 단계는,Determining whether the temporary secret key is valid,
    상기 엔트리가 이전 암복호화 동작에서 사용되었다면, 상기 임시 비밀키를 유효하지 않다고 판별하는 단계를 포함하는 복호화 방법. If the entry was used in a previous decryption operation, determining that the temporary secret key is invalid.
  4. 제 1 항에 있어서,The method of claim 1,
    상기 임시 비밀키가 유효한 지를 판별하는 단계는,Determining whether the temporary secret key is valid,
    상기 엔트리가 이전 암복호화 동작에서 사용된 회수가 사전에 결정된 값 이상이면, 상기 임시 비밀키를 유효하지 않다고 판별하는 단계를 포함하는 복호화 방법. Determining that the temporary secret key is invalid if the number of times the entry has been used in a previous decryption operation is greater than or equal to a predetermined value.
  5. 제 1 항에 있어서,The method of claim 1,
    상기 임시 비밀키 테이블은 인덱스, 임시 비밀키 및 상기 임시 비밀키의 암호화된 값으로 구성된 복수의 엔트리들을 포함하는 복호화 방법.And the temporary secret key table includes a plurality of entries consisting of an index, a temporary secret key, and an encrypted value of the temporary secret key.
  6. 제 5 항에 있어서,The method of claim 5,
    상기 임시 비밀 테이블로부터 상기 복수의 엔트리들 중에서 임시 비밀키가 유효하지 않은 엔트리를 삭제하는 단계; 및Deleting from the temporary secret table an entry for which a temporary secret key is invalid among the plurality of entries; And
    상기 임시 비밀 테이블에 새로운 인덱스, 상기 새로운 인덱스에 대응하는 새로운 임시 비밀키 및 상기 새로운 임시 비밀키의 검증값으로 구성된 새로운 엔트리를 추가하는 단계를 더 포함하는 복호화 방법.Adding a new entry to the temporary secret table, the new entry consisting of a new index, a new temporary secret key corresponding to the new index, and a verification value of the new temporary secret key.
  7. 제 5 항에 있어서,The method of claim 5,
    상기 임시 비밀 테이블로부터 상기 복수의 엔트리들 중에서 임시 비밀키가 유효하지 않은 엔트리들의 개수가 사전에 결정된 값 이상인 지를 판별하는 단계;및Determining from the temporary secret table whether the number of entries in which the temporary secret key is invalid is greater than or equal to a predetermined value;
    상기 유효하지 않은 엔트리들의 개수가 상기 사전에 결정된 값 이상일 때, 상기 임시 비밀 테이블을 업데이트하는 단계를 더 포함하는 복호화 방법.Updating the temporary secret table when the number of invalid entries is greater than or equal to the predetermined value.
  8. 제 1 항에 있어서,The method of claim 1,
    상기 임시 비밀키와 메시지에 의해 발생된 인증 코드를 입력 받는 단계를 더 포함하는 복호화 방법.And receiving an authentication code generated by the temporary secret key and the message.
  9. 제 8 항에 있어서,The method of claim 8,
    상기 임시 비밀키가 유효하지 않을 때, 상기 인증 코드에 대한 검증 동작을 중단하는 단계; 및Stopping the verification operation for the authentication code when the temporary secret key is invalid; And
    상기 임시 비밀키가 유효할 때, 상기 인증 코드에 대한 검증 동작을 수행하는 단계를 더 포함하는 복호화 방법. And when the temporary secret key is valid, performing a verification operation on the authentication code.
  10. 제 9 항에 있어서,The method of claim 9,
    상기 인증 코드에 대한 검증 동작이 실패하였을 때, 상기 암호화된 메시지를 복호화하지 않는 단계를 더 포함하는 복호화 단계.And not decrypting the encrypted message when a verification operation on the authentication code fails.
  11. 제 9 항에 있어서,The method of claim 9,
    상기 인증 코드에 대한 검증 동작이 성공하였을 때, 상기 암호화된 메시지를 복호화하는 단계를 더 포함하는 복호화 단계.Decrypting the encrypted message when the verification operation on the authentication code is successful.
  12. 사용 회수의 제한을 갖는 임시 비밀키로 암호화된 메시지를 입력 받고, 상기 임시 비밀키에 대응하는 검증값이 임시 비밀키 테이블에 존재하는 지를 근거로 하여 상기 임시 비밀키가 유효한 지 판별하는 임시 비밀키 매니저; 및A temporary secret key manager that receives a message encrypted with a temporary secret key having a limit on the number of times of use, and determines whether the temporary secret key is valid based on whether a verification value corresponding to the temporary secret key exists in the temporary secret key table ; And
    상기 임시 비밀키가 유효하지 않다면, 상기 암호화된 메시지를 복호화하지 않는 복호화 유닛;을 포함하는 암호 모듈을 갖는 전자 장치.And a decryption unit that does not decrypt the encrypted message if the temporary secret key is invalid.
  13. 제 12 항에 있어서,The method of claim 12,
    상기 임시 비밀키 매니저는 다른 임시 비밀키를 발생하는 전자 장치.And the temporary secret key manager generates another temporary secret key.
  14. 제 12 항에 있어서,The method of claim 12,
    상기 암호 모듈은 다른 임시 비밀키로 메시지를 암호화시키는 암호화 유닛을 포함하는 전자 장치.The cryptographic module includes an encryption unit for encrypting the message with another temporary secret key.
  15. 제 14 항에 있어서,The method of claim 14,
    상기 암호 모듈은 메시지 인증 코드 및 암호 프리미티브 함수를 사용하는 전자 장치.The cryptographic module uses a message authentication code and cryptographic primitive function.
  16. 제 15 항에 있어서,The method of claim 15,
    상기 메시지 인증 코드는 메시지와 상기 메시지의 헤드 정보를 인증하기 위해 발생되는 전자 장치.The message authentication code is generated to authenticate a message and the head information of the message.
  17. 암호 모듈을 갖는 전자 장치의 암호화 방법에 있어서:In the encryption method of an electronic device having a cryptographic module:
    사용 회수의 제한을 갖는 임시 비밀키 및 상기 임시 비밀키의 검증값으로 구성된 복수의 엔트리들을 발생하는 단계;Generating a plurality of entries consisting of a temporary secret key having a limit on the number of uses and a verification value of the temporary secret key;
    상기 복수의 엔트리들 중 어느 하나를 선택하는 단계;Selecting any one of the plurality of entries;
    상기 선택된 엔트리의 임시 비밀키를 이용하여 메시지를 암호화하는 단계; 및Encrypting the message using the temporary private key of the selected entry; And
    상기 이용된 임시 비밀키 및 상기 메시지를 이용하여 인증 코드를 발생하는 단계를 포함하는 암호화 방법.Generating an authentication code using the used temporary secret key and the message.
  18. 제 17 항에 있어서,The method of claim 17,
    상기 임시 비밀키는 순차처리 기반으로 발생되는 암호화 방법.And the temporary secret key is generated based on sequential processing.
  19. 제 17 항에 있어서,The method of claim 17,
    상기 임시 비밀키는, 암호화 동작, 해쉬 함수, 혹은 동기화 동작을 이용하여 보호되는 암호화 방법.And the temporary secret key is protected using an encryption operation, a hash function, or a synchronization operation.
  20. 제 17 항에 있어서,The method of claim 17,
    상기 검증값 및 상기 암호화된 메시지를 다른 암호 모듈로 전송하는 단계를 더 포함하는 암호화 방법.Transmitting the verification value and the encrypted message to another cryptographic module.
PCT/KR2014/005200 2013-06-14 2014-06-13 Electronic device with code module and method for processing code using same WO2014200301A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR10-2013-0068071 2013-06-14
KR20130068071 2013-06-14

Publications (1)

Publication Number Publication Date
WO2014200301A1 true WO2014200301A1 (en) 2014-12-18

Family

ID=52022510

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2014/005200 WO2014200301A1 (en) 2013-06-14 2014-06-13 Electronic device with code module and method for processing code using same

Country Status (1)

Country Link
WO (1) WO2014200301A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20030097465A (en) * 2002-06-21 2003-12-31 주식회사 케이티 License issuance apparatus and digital rights management system snd method using it
KR20050054772A (en) * 2003-12-06 2005-06-10 한국전자통신연구원 Method for reusing key using separated encryption key for sending and receiving
US7225157B2 (en) * 1999-02-08 2007-05-29 Copyright Clearance Center, Inc. Limited-use browser and security system
US7373668B1 (en) * 2002-03-29 2008-05-13 Xilinx, Inc. Methods and circuits for protecting proprietary configuration data for programmable logic devices
WO2013009120A2 (en) * 2011-07-13 2013-01-17 (주)시루정보 Mobile communication terminal and apparatus and method for authenticating applications

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7225157B2 (en) * 1999-02-08 2007-05-29 Copyright Clearance Center, Inc. Limited-use browser and security system
US7373668B1 (en) * 2002-03-29 2008-05-13 Xilinx, Inc. Methods and circuits for protecting proprietary configuration data for programmable logic devices
KR20030097465A (en) * 2002-06-21 2003-12-31 주식회사 케이티 License issuance apparatus and digital rights management system snd method using it
KR20050054772A (en) * 2003-12-06 2005-06-10 한국전자통신연구원 Method for reusing key using separated encryption key for sending and receiving
WO2013009120A2 (en) * 2011-07-13 2013-01-17 (주)시루정보 Mobile communication terminal and apparatus and method for authenticating applications

Similar Documents

Publication Publication Date Title
WO2021095998A1 (en) A trusted computing method and system
WO2014069783A1 (en) Password-based authentication method, and apparatus for performing same
US8014526B2 (en) Secure wireless local or metropolitan area network and related methods
WO2014069778A1 (en) Id-based encryption and decryption method, and apparatus for executing same
KR100687455B1 (en) Method for transferring sensitive information using initially unsecured communication
WO2018151390A1 (en) Internet of things device
WO2010087567A1 (en) Method for installing rights object for content in memory card
WO2016039556A1 (en) Apparatus and method for data encryption
WO2012093900A2 (en) Method and device for authenticating personal network entity
WO2020101325A1 (en) Encryption system and method employing permutation group-based encryption technology
WO2013086758A1 (en) Ethernet encryption and authentication system and method
WO2018072261A1 (en) Information encryption method and device, information decryption method and device, and terminal
WO2020186775A1 (en) Service data providing method, apparatus and device, and computer-readable storage medium
CN102986162A (en) License dynamic management method, device and system based on TCM or TPM
WO2016126023A1 (en) Broadcast apparatus and method of authenticating broadcast data
KR20120105511A (en) Method and system for establishing security connection between switch equipments
WO2020242062A1 (en) Device for transmitting key data to subscriber in multicast group
WO2023054857A1 (en) Device inside network
WO2020067734A1 (en) Non-address network equipment and communication security system using same
WO2011111981A2 (en) Method and device for automatic data encryption and decryption
WO2014200301A1 (en) Electronic device with code module and method for processing code using same
CN103795549B (en) Communication content encryption and decryption method and encryption management method based on CS mode
WO2021133074A2 (en) Method for entity or message authentication dedicated to lightweight device, and devices for performing same
WO2020242058A1 (en) Device in multicast group
KR101575050B1 (en) Different Units Same Security

Legal Events

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

Ref document number: 14811516

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14811516

Country of ref document: EP

Kind code of ref document: A1