Encrypted data verification method
By mixing and hashing the data with a randomly generated mixed number before data transmission, the security issues of data integrity and authentication under quantum computer attacks in existing technologies are solved, and higher data verification security and identity authentication reliability are achieved.
Patent Information
- Application Number
- CN202080015504.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-02-19
- Filing Date
- 2020-02-17
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2040-02-17
AI Technical Summary
Existing digital signature technology lacks security when facing quantum computer attacks, making it difficult to effectively verify the integrity of data and the identity of the sender. Traditional hash functions are easily cracked, making data substitution difficult to detect.
The uniqueness and integrity of a dataset is ensured by using a mixing function to mix the data with a randomly generated mixing number, then hashing it and comparing it with a hypothetical second dataset. The mixing number can be generated based on physical quantities or quantum phenomena, mixed using an XOR logic function or an encryption function, and encrypted for transmission using a symmetric or asymmetric key.
It improves the security of data verification, reduces the possibility of data substitution, ensures the integrity of the message and the identity authentication of the sender, and adapts to the attack threat of quantum computers.
Smart Images

Figure CN113811874B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to digital encryption and security of computing and electronic devices, and in particular to digital signatures. Background Art
[0002] Computers and electronic devices are often connected to networks physically, wirelessly, via RFID or by any other secure or unsecure means, and sometimes need to know the identity of the device sending them certain data, for example to ensure that these data have not been transmitted by another device that intercepts them and modifies them before sending them to the legitimate recipient, or they simply need to determine the identity of the sender of the data beyond doubt, such as cars on a road network or RFID tags worn by athletes during a sporting event, or for any other reason where the identity of the data sender is important to the recipient.
[0003] Transmitted data can be encrypted in its entirety using a key belonging to the sender. However, encryption of all data makes the use of one-time keys (one-time ciphers) difficult. Specifically, encryption of all data is a method that uses keys that are as long as the data they encrypt, and these keys must be renewed after use.
[0004] Therefore, it is necessary for computers or other electronic devices communicating, for example, by exchanging text, identifiers, numbers, computer programs, images, or video or audio codes, to use encryption that uses a smaller amount of data than the data being sent to verify the identity of the sending device. For this reason, electronic signatures consisting of a cryptographic hash of the data are used. The term "hash" is used to refer to the result of a hash function that calculates a fingerprint based on initial reference data provided as input. This fingerprint is used to quickly but incompletely identify the initial reference data. The encrypted hash is typically sent along with the data, which is then decrypted by the recipient and compared to the hash of the received data. MD5, SHA1, and SHA256 are algorithms traditionally used for this type of hashing operation. However, the size of a data hash is typically much smaller than the original data, and it is possible to create other data that is similar but slightly different from the original data, whose hash is equivalent to the hash of the original data. Therefore, this data can be substituted for the original data without being rejected by programs used to verify the hash. Any type of data can be substituted, but as the complexity of the data increases (e.g., long text, audio files, photos, or videos), the user's ability to detect the substitution decreases. To perform the substitution, it is not even necessary to decrypt the encrypted hash. Simply computing the hash of the original data is sufficient. Furthermore, hash functions such as MD5 and SHA1 are currently relatively easy to bypass.
[0005] Quantum computers currently under development should soon be able to bypass the security provided by hash functions because they will be able to optimize the starting file to have a preset hash.
[0006] Methods of using hashing technology to improve system security are known in the prior art.
[0007] Patent application CN101547184 uses multiple auxiliary authentication values exchanged between the server and the user.
[0008] In the method proposed in patent application US2011 / 0246433, a hash of the data to be sent is generated and concatenated with the data block to be sent and a random number tag.
[0009] Patent application EP 1 421 548 describes a method for transmitting information in which a message to be sent is concatenated with a random number and then hashed. The hashed result is sent unencrypted to the other party. The message is sometimes transmitted as is or encrypted. The random number is always transmitted to the other party in a signed and optionally encrypted form. The fact that the hash is not encrypted while the message itself is unencrypted makes the transmission vulnerable to attacks by very powerful or quantum computers capable of calculating a random number compatible with the unencrypted message and the hash result. Furthermore, encrypting the entire message has the disadvantage that, if such encryption uses a one-time pad (which is considered unbreakable), both parties must have access to a shared key. Summary of the Invention
[0010] There is a need to further improve the security of hashing techniques, reducing the likelihood of errors in data verification and, where appropriate, allowing for more reliable authentication of the senders of such data.
[0011] The present invention is particularly intended to meet this need and it achieves this object by a method implemented by at least one device for comparing a first data set and a second data set, in particular in order to determine whether the two data sets are identical, the method comprising the following steps:
[0012] a) mixing a number, called the mixing number, with the first data set using a mixing function to obtain mixed data,
[0013] b) hashing the mixed data using a hash function, and
[0014] c) comparing the hash obtained in step b) with a third data set which is assumed to be the hash of a second data set which has been mixed with the same mixing function and the same mixing number used in step a).
[0015] By the invention, and in particular by mixing the first data set with the mixing number before hashing, it is very unlikely that data similar to the first data set will be created which, after mixing with the mixing number, will have the same hash as the mixed first data set.
[0016] Preferably, the method according to the invention does not require the simultaneous presence of two data sets in the device.
[0017] Preferably, the mixing number is randomly generated.
[0018] The mixed number is preferably generated by said device.As a variant, the mixed number is generated by another trusted device.
[0019] The generation of the hybrid number can be based on a pair of input values, at least one of which is a continuously varying physical quantity, such as temperature and time, or based on quantum phenomena. For example, the generation can be based on a photon choosing which of two Young's slits to use to pass through the plate.
[0020] Preferably, the mixing operation in step a) is performed by the device. Alternatively, the mixing is performed by another trusted device.
[0021] The mixing function combines the first data set and the mixing number. Preferably, the mixing function is an XOR logic function that adds the bits of the first data set to the bits of the mixing number one by one. Because the size of the mixing number is typically smaller than the size of the first data set, the bits of the mixing number can be added to the first or last bit of the first data set via XOR.
[0022] The mixed number may be of the same size as the first data set. In this case, all bits are added one by one by the XOR function.
[0023] Alternatively, the mixing function consists in adding a mixing number to the end of the first data set.
[0024] The mixing function may even be an encryption function that encrypts the first data set using the mixing number as an encryption key.
[0025] Preferably, the data in step b) is hashed by said device. Alternatively, the hashing is performed by another trusted device.
[0026] Preferably, the hash function is selected from SHA1, SHA2, SHA256 and MD5 and the Jenkins function.
[0027] A first variant of the method according to the invention is a method for verifying, with the device, the integrity of a message originating from a sender, comprising:
[0028] i. The device receives a message and an identifier of the message, the message forming the first data set,
[0029] ii. Generate mixed numbers,
[0030] iii. implementing steps a) and b) wherein the message is mixed with a mixing number and then hashed,
[0031] iv. optionally encrypting the mixed number,
[0032] v. said device sending an identifier of said message and an optionally encrypted mixed number to the sender of said message,
[0033] vi. said device receiving an encrypted third data set originating from said sender, said third data set preferably having an identifier of said message,
[0034] vii. decrypting the third data set, and
[0035] viii. Implementing step c), if the third data set decrypted in step vii and the hash obtained in step b) are the same, the integrity of the message is ensured.
[0036] By "integrity" of a message it must be understood that it cannot be altered, for example by a malicious third party who intercepts the message during transmission.
[0037] The identifier of the message may be a series of alphanumeric characters and / or symbols that can be converted into numeric words, in particular by means of the ASCII code.
[0038] The message identifier may include the sender's identifier and the message's sequence number.
[0039] The authentication of the sender is ensured in particular by the decryption operation in step vii.
[0040] This first variant of the invention makes it possible to ensure both the integrity of the message received and the integrity of the identity of the sender of the message.
[0041] The steps related to sending and receiving data may be performed using the same communication protocol or using different communication protocols. For example, the data received in step i is received via Wi-Fi, the data sent in step v is sent via 4G, and the data received in step vi is received via WiMAX.
[0042] In step i, the device may also receive an identifier of the sender. This identifier is useful if the device is capable of receiving messages from different senders, allowing it to select an encryption key to be used to encrypt or decrypt the information exchanged with the sender during the encryption and decryption operations described in the first variant of the invention.
[0043] Preferably, the method according to this first variant comprises, between steps v and vi:
[0044] - the sender receives the message's identifier and an optionally encrypted mixing number,
[0045] - optionally decrypt the mixed number,
[0046] - identifying a message sent to said device using an identifier of the message,
[0047] - mix the message with the optionally decrypted mixing number using a mixing function,
[0048] - hash the data produced in the previous step using a hash function,
[0049] - encrypt the hash produced in the previous step, and
[0050] - Sending the encrypted hash to the device, preferably with an identifier of the message.
[0051] The optional encryption of the mixed number in step iv is preferably performed by the device.
[0052] Optional encryption of the mixed number makes it possible to prevent the number from being intercepted and altered by malicious third parties.
[0053] Preferably, the optional encryption of the mixed number is performed using a one-time key of a size at least equal to the size of the number. Since the key is a one-time use, a new key is used each time the mixed number is sent.
[0054] Encryption can also be performed using a symmetric key. The symmetric encryption key is kept secret between the sender and the device and is preferably updated after a certain number of transmissions.
[0055] Alternatively, the optional encryption of the mixed number is asymmetric, performed using the sender's public key known to the device to allow the sender to decrypt using their associated private key, or performed using the device's private key, the device's public key being known to the sender.
[0056] Thus, third parties are prevented from learning or changing the mixed numbers.
[0057] Preferably, the decryption in step vii is performed by the device.
[0058] Preferably, if the encryption in step iv is performed using a one-time key, the decryption in step vii is performed using a symmetric key.
[0059] Alternatively, if the encryption in step iv is performed using a symmetric key, the decryption in step vii is performed using a one-time key.
[0060] The decryption in step vii may also be performed using other methods, such as using a public key known to the device that is associated with the sender's private key used to encrypt the hash received in step vi. Thus, the device is able to prove the identity of the sender.
[0061] If such a symmetric key is used, the mixed number can be the same size as the symmetric key used to encrypt it, and also the same size as the hash.
[0062] Preferably, the private key, symmetric key and one-time use encryption key and mixing number are unguessable and unobservable by third party equipment to prevent the possibility of eavesdropping on the data sent by the sender or the device to generate and transmit a fraudulent second data set, which would result in the integrity of the message received by the device but sent by a sender other than the sender who is supposed to have legitimate possession of the keys being falsely identified.
[0063] If the encryption key X for the mixing number x is known, then the hash of the mixed message can be known, as it is sufficient to decrypt the encryption of x and calculate the message mix before hashing. It is then also possible to guess or know that the encryption key Y for the hash belongs to a small range, and both the hash of the mixed message and its encryption with key Y are known or observable. Therefore, encryption key Y is a function F of encryption key X, or else it belongs to a range that depends on encryption key X. Observing multiple transmissions results in multiple functions F occurring, and the values of keys X and Y lie at the intersection of these functions. This is preferably avoided. Therefore, it is recommended to use values for key X or key Y that change during transmission, or to use an encryption function such that for each observation of the exchange of the triple "message, encryption number, encryption hash," the range of possible keys Y for X is large; this allows the range resulting from the intersection of these ranges to be deduced at each observation. Using a randomly generated mixing number x for key Y is not recommended. Specifically, if the mixed number x is used as encryption key Y, or indeed if the key Y is calculated from the mixed number x using a defined formula (knowing the encrypted value C of the mixed number x encrypted with the key X), then the mixed number x, and therefore Y, becomes another function G of the key X; and the keys X and Y will be at the intersection of the function F and this new function G. Preferably, the key X or the key Y is updated after each exchange.
[0064] The device may further comprise a counter of consecutive failed authentication attempts, which triggers its blocking when a defined number is reached, and the device may be unblocked during an update of the encryption key used to encrypt the mixed number or the encryption key used to encrypt the hash.
[0065] A second variant of the method according to the invention is a method for verifying the integrity of a message originating from a sender using the device, the method comprising:
[0066] i. The device receives a message, an encrypted third data set and an encrypted mixed number,
[0067] ii. decrypting the mixed digital and third data set, and
[0068] iii. Carrying out steps a) to c), if the hash obtained in step b) and the third data set decrypted in step ii) are the same, the integrity of the message is ensured.
[0069] Preferably, the method according to this second variant of the invention comprises, before step i:
[0070] - The sender generates a mixed number,
[0071] - use the mix function to mix the mixed number with the message,
[0072] - hash the data produced in the previous step using a hash function,
[0073] - encrypt the hash produced in the previous step and form a third data set,
[0074] -encrypted mixed numbers, and
[0075] - Sending the message, the encrypted third data set and the encrypted mixed number to the device.
[0076] These steps are performed by the genuine sender and allow detection of alterations to the message by unauthorized third parties.
[0077] The decryption of the mixed number and the third data set in step ii. is preferably performed by said apparatus.
[0078] Preferably, the encryption of the mixed number is performed using a one-time key and the encryption of the third data set is performed using a symmetric key, which is preferably updated from time to time.
[0079] Alternatively, the encryption of the mixed number is performed using a symmetric key, which is preferably updated from time to time, and the encryption of the third data set is performed using a one-time key.
[0080] The encryption of the hybrid number and the encryption of the third data set may also be of the same type or different types, and these types of encryption may employ symmetric keys or asymmetric keys.
[0081] If a pair of asymmetric keys is used for encryption of the mixed number, the private key of the pair is preferably kept by the device, and the corresponding public key is then known to the sender.
[0082] Preferably, the encryption of the third data set is performed using a private key held by the sender, the corresponding public key then being known to the device.
[0083] Thus, by decrypting the mixed number and the third set of data, the device is able to prove the identity of the sender.
[0084] The encryption of the mixed number and the encryption of the third data set may be performed using the same encryption function, in particular when the encryption of the mixed number is asymmetric.
[0085] Alternatively, the encryption of the mixed number and the encryption of the third data set are performed by two different encryption functions.
[0086] Preferably, the type of encryption function to be used forms part of the configuration of the sender and the configuration of the device before communication between the sender and the device is established.
[0087] A third variant of the method according to the invention is a method, wherein the first data set is present in the device and the second data set is present in the second device, the method comprising:
[0088] i. Implement steps a) and b),
[0089] ii. Encrypted mixed number,
[0090] iii. the device sends the encrypted mixed number to the second device,
[0091] iv. the device receives an encrypted hash of the second data set,
[0092] v. decrypting the encrypted hash, and
[0093] vi. Implement step c).
[0094] Preferably, the method according to this third variant of the invention comprises, between steps iii and iv:
[0095] - the second device receives the encrypted mixed number,
[0096] -decrypt mixed numbers,
[0097] - create a modified copy of the second dataset using mixed numbers and mixed functions,
[0098] - hashing the modified copy of the second data set using the hash function,
[0099] - encrypt the hash produced in the previous step and form a third data set, and
[0100] - said second device sending an encrypted hash of the second data set to said device.
[0101] The encryption of the mixed number in step ii. and the decryption of the encrypted hash in step v. are preferably performed by said device.
[0102] Preferably, encryption of the mixed number is performed using a symmetric encryption key shared with the second device.
[0103] Preferably, the encryption of the hash is performed using a one-time key, while the encryption of the mixed number is performed using a symmetric key that is updated from time to time.
[0104] Alternatively, encryption of the mixed number is performed using a one-time key and encryption of the hash is performed using a symmetric key that is updated from time to time.
[0105] The encryption of the mixed number and the encryption of the hash can also be of the same type or of different types, and these types of encryption can use symmetric keys, in particular one-time keys, or asymmetric keys.
[0106] A fourth variant of the method according to the invention is a method for verifying that a data set present in a device has not been modified between two times d1 and d2, the data set forming a first data set at time d1 and a second data set at time d2, the method comprising:
[0107] i. Implement steps a) and b),
[0108] ii. the device securely stores the mixed number and hash obtained in step b),
[0109] iii. creating a modified copy of the second dataset using mixed numbers and mixed functions,
[0110] iv. hashing the modified copy using a hash function to form a third data set, and
[0111] v. Implement step c).
[0112] Advantageously, the method according to this fourth variant does not require the data set to be kept securely.
[0113] Another subject of the invention is a computer program product comprising instructions readable by a processor of a device for implementing the method according to the invention according to any of the variants described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0114] The present invention will be better understood by reading the following detailed description of non-limiting examples of its implementation and examining the accompanying drawings, in which:
[0115] [ Figure 1 ] Figure 1 Schematically shows the data and functions required for implementing the present invention according to the first variant or the second variant of the present invention,
[0116] [ Figure 2 ] Figure 2 Schematically shows an example of implementation of the invention according to a first variant of the invention,
[0117] [ Figure 3 ] Figure 3 Schematically shows an example of implementation of the invention according to a second variant of the invention,
[0118] [ Figure 4 ] Figure 4 Schematically shows data and functions for implementing the invention according to a third variant of the invention,
[0119] [ Figure 5 ] Figure 5 Schematically shows an example of implementation of the invention according to a third variant of the invention,
[0120] [ Figure 6 ] Figure 6 shows an embodiment of the invention according to a fourth variant of the invention,
[0121] [ Figure 7 ] Figure 7 Schematically shows the method for implementing Figure 8 The example data,
[0122] [ Figure 8 ] Figure 8 A first embodiment of the present invention applied to software package verification is shown.
[0123] [ Figure 9 ] Figure 9 A second embodiment of the present invention applied to software package verification is shown.
[0124] [ Figure 10 ] Figure 10 Schematically shows the method for implementing Figure 11 Example of equipment and data,
[0125] [ Figure 11 ] Figure 11 An example of an implementation of the present invention applied to improving the security of an Internet browser is shown.
[0126] [ Figure 12] Figure 12 Schematically shows the method for implementing Figure 13 The example equipment and data, and
[0127] [ Figure 13 ] Figure 13 An implementation example of the present invention applied to improving the security of e-mails is shown. DETAILED DESCRIPTION
[0128] Figure 1 The data and functions for implementing the invention according to the first or second variant of the invention are schematically shown, wherein a message 101 must be sent from device A to device B via a data transmission channel 109, which may or may not be secure.
[0129] Device A may be a personal computer or a smart phone, device B is an email server, and message 101 is, for example, an email sent by the computer or phone via the Internet.
[0130] Device A may also be a server that sends emails or web pages, and device B may be a personal computer or smart phone that receives the emails or web pages.
[0131] Device A may even be a measuring device, such as a device for measuring the consumption of electricity, gas or water, or a device for measuring the wear of components in a machine, and message 101 is the result of such a measurement. Device B is a server that collects the measurement values and communicates with the measuring device via a telecommunication network (such as the Internet of Things, a Wi-Fi network or an LTE network).
[0132] Device A and device B may also be personal computers or smartphones.
[0133] Device A may be a web browser, device B a web server and message 101 is a form filled in by a user of browser A. Receipt of a message need not be distinguished from transmission of a message.
[0134] Device A and device B may each be equipped with a processor for executing the steps of the method according to the invention and a memory for storing the data required for this execution.
[0135] Device B has encryption / decryption data 102B available to it, such as a private key. Device A has encryption / decryption data 102A available to it, such as a public key associated with private key 102B.
[0136] Device A also has encryption / decryption data 103A available to it, such as a private key associated with a public key 103B present in device B.
[0137] Device A and device B possess random number generators 104A and 104B, respectively, a public mixing function 105, and a public hash function 106.
[0138] Device A and device B also have encryption functions 107A and 107B, respectively, and decryption functions 108A and 108B, respectively.
[0139] Figure 2 An example of implementation of the method according to a first variant of the invention is shown.
[0140] In step 201, a first number identifying the message 101 is generated by device A. It may optionally be generated using a random number generator 104A.
[0141] In step 202, the first number is added to the message 101. This addition may be a concatenation in any order defined by the communication protocol used between the two devices.
[0142] In step 203 , device A sends the data generated in step 202 to device B via the data transmission channel 109 .
[0143] In step 204, upon receiving the data, device B randomly generates a second number using random number generator 104B.
[0144] In step 205, device B mixes the second number with the message 101 using a mixing function 105. For example, the mixing function is an XOR operation between the bits of the second number and the same number of bits of the message 101. The mixing function 105 is known to device A.
[0145] In step 206, device B hashes the data obtained in the previous step using hash function 106. Device B also encrypts the second number using public encryption key 103B and encryption function 107B.
[0146] In step 207 , device B sends the first number and the encrypted second number to device A via channel 109 .
[0147] Upon receiving the two numbers, device A decrypts the second number using the encryption private key 103A associated with the public key 103B necessary for encryption and the decryption function 108A associated with the encryption function 107B in step 208. If the second number had not been encrypted by device B, its decryption would be erroneous.
[0148] Using the first number, device A is able to identify the message 101 and mix the decrypted second number with the identified message 101 using a mixing function 105 .
[0149] In step 209 , device A uses the hash function 106 to hash the data generated in the previous step.
[0150] In step 210, device A encrypts the hash obtained in the previous step using encryption private key 103A and encryption function 107A.
[0151] In step 211 , device A sends the encrypted hash to device B via channel 109 .
[0152] In step 212, upon receiving the encrypted hash, device B decrypts the encrypted hash using the encrypted public key 103B associated with the private key 103A necessary for encryption and the decryption function 108B associated with the encryption function 107A.
[0153] In step 213, device B compares the decrypted hash obtained in step 212 with the hash calculated in step 206. If the two hashes are identical, device B concludes that message 101 has not been altered.
[0154] Preferably, the second number used in the mixing must be kept secret until the hashes have been compared to perform verification, but if the device calculating the hash can be trusted, the mixing number can be revealed before so that the data has not been modified between the moment the mixing number is revealed and the hashes are compared.
[0155] Figure 3 A second implementation example of the method according to the second variant of the present invention is shown, where a message 101 needs to be sent from device A to device B.
[0156] Device A and device B may be personal computers or smartphones, and message 101 may be an email.
[0157] Device A and device B can be adjacent cars, and the data exchanged is information related to their movement, and the connection is achieved through a data link between the two cars (such as a 5G link, a low-power Bluetooth link, an ultra-high frequency RFID link, a Lora link, or a Sigfox link).
[0158] In step 301, device A generates a random number using random number generator 104A.
[0159] In step 302 , device A mixes the message 101 with a random number using the mixing function 105 .
[0160] In step 303 , device A hashes the mixed data generated in the previous step using the hash function 106 .
[0161] In step 304, device A encrypts the hash obtained in the previous step using encryption function 107A and encryption private key 103A.
[0162] In step 305, device A encrypts the random number using encryption function 107A and encryption public key 102A.
[0163] In step 306 , the message 101 , the encrypted random number, and the encrypted hash are sent to device B via the transmission channel 109 using the communication protocol agreed upon between the two devices.
[0164] In step 307, upon receiving the data, device B decrypts the hash using decryption function 108B and encryption public key 103B, and decrypts the random number using encryption private key 102B.
[0165] Therefore, device B is able to authenticate device A.
[0166] In step 308 , device B mixes the message 101 with the random number using the mixing function 105 .
[0167] In step 309 , device B hashes the mixed data generated in the previous step using the hash function 106 .
[0168] In step 310 , device B compares its calculated hash with the decrypted hash and draws a conclusion about the integrity of message 101 .
[0169] In this example, device B can forward the data received from device A to a third device. Device B uses private key 102B to decrypt the random number it received from device A and then encrypts it again using the third device's public key. Device B then transmits the encrypted random number and the hash encrypted by device A to the third device. The third device, which has access to device A's public key, will be able to verify that the hash is indeed from device A, as long as device B has not modified the hash encrypted by device A. Therefore, a given data set can be verified as authentic by many users. However, this option compromises the security of the authentication; a fraudulent device could decrypt the random number and potentially modify the message to have the same random hash as the original. Therefore, this embodiment is preferably used to authenticate communications between computer systems formed by components that are protected from such fraudulent use.
[0170] Figure 4 Schematically depicts the data and functions required to implement the invention according to its third variant to verify that a file 401A present on device A is identical to a file 401B present on device B.
[0171] Device A and device B communicate via a transmission channel 409 (eg, a Wi-Fi network).
[0172] Device A possesses a random number generator 404 .
[0173] Device A and device B have in common a mixing function 405 , a hash function 406 , and a symmetric encryption key 410 .
[0174] Device B has an encryption function 407 available to it.
[0175] Device A has a decryption function 408 available to it.
[0176] Figure 5 A third implementation example of the method according to the third variant of the invention is shown.
[0177] In step 501 , a random number is generated in device A using random number generator 404 .
[0178] In step 502, a modified copy of file 401A is created using mixing function 405 and a random number.
[0179] In step 503 , the modified copy of file 401A is hashed using hash function 406 .
[0180] In step 504 , the random number is encrypted using a symmetric encryption algorithm and a symmetric encryption key 410 , and is sent to device B via the transmission channel 409 .
[0181] In step 505, upon receiving the encrypted random number, device B decrypts it and uses it in mixing function 405 to create a modified copy of file 401 B. By decrypting the random number, device B can verify the identity of device A.
[0182] In step 506 , the modified copy of file 401B is hashed using the same hash function 406 .
[0183] In step 507 , the hash of the modified copy is encrypted using encryption function 407 and encryption key 410 .
[0184] In step 508, the encrypted hash is sent to device A.
[0185] In step 509 , upon receiving the encrypted hash, device A decrypts it using decryption function 408 and key 410 .
[0186] In step 510, device A compares the decrypted hash with the hash it calculated in step 503, thereby being able to verify whether the two files 401A and 401B are identical.
[0187] Figure 6A fourth implementation example of a method according to a fourth variant of the invention is shown for verifying that a file has not been modified between two times d1 and d2 while maintaining complete security of a smaller set of data between the two times, the set comprising a number that remains intact and secret and a hash that remains intact and preferably secret.
[0188] In step 601, a random number is generated.
[0189] In step 602 , at time d1 , a modified copy of the file is created using the generated random number and a mixing function, the function consisting, for example, in adding the random number to the end of the file.
[0190] In step 603, a hash of the modified copy is created, for example using a SHA2 function.
[0191] In step 604, the random number and hash are stored securely and secretly so that they cannot be modified and so that the random number is not revealed to a third party.
[0192] In step 605, at time d2, a person or device with access to the information stored in step 604 wishes to compare the file at time d2 with the file used in steps 601 to 604. To do this, the saved random number is used to create a second modified copy of the file at time d2 using the same mixing function as in step 602.
[0193] In step 606 , a hash of the second modified copy is created using the same hash function as in step 603 .
[0194] In step 607, the hash created in the previous step is compared to the stored hash to ensure that the file has not been modified between times d1 and d2.
[0195] Figure 7 A fifth example of implementing the method according to the invention applied to the verification of a software package is schematically shown. Figure 8 The required key is shown).
[0196] In the remainder of the description, the operation of mixing reference data with a random mixing number and then performing a hashing operation will be referred to as "random hashing" of the reference data.
[0197] Figure 8 The example shown in FIG is implemented between two devices: device A is called a software distributor and device B is called a client device.
[0198] Device A possesses two keys 701 and 702 .
[0199] 701 is the key used to encrypt the hash and is preferably private.
[0200] 702 is a key used to encrypt the random number, and is preferably public.
[0201] Device B possesses two keys 703 and 704 .
[0202] 703 is the key used to decrypt the hash encrypted using key 701 and is preferably public.
[0203] 704 is a key for decrypting the random number encrypted using the key 702, and is preferably private.
[0204] The key pair (701, 703) may be referred to as a key pair of a software distributor, and the software distributor can use the key pair to communicate with all devices that have installed one of the software packages distributed by the key pair.
[0205] The key pair (704, 702) may be referred to as a client's key pair, which the client can use for all software packages authenticated during downloading of the software packages.
[0206] In step 801, software distributor A refers to the Figure 3 In steps 301 to 305 described above, random hashing is performed on the software package to be transmitted to client B.
[0207] Software distributor A uses key 702 to encrypt the random number and uses key 701 to encrypt the random hash of the software package.
[0208] In step 802, software distributor A sends a data set including a software package, an encrypted hash of the software package, and an encrypted random number to client B via a transmission line that may be secure or insecure.
[0209] In step 803, after receiving the data set, client B decrypts the hash using key 703 and decrypts the random number using key 704. Client B then performs random hashing on the received software package using the random number.
[0210] In step 804, if the calculated hash is the same as the received hash, then client B allows the received software package to be executed, or replaces the previous version of the software package with the version it has just received.
[0211] In step 805, for higher security, steps 803 and 804 are re-executed at pre-programmed time intervals to verify the authenticity of the software package.
[0212] Figure 9 Another possible implementation of random hashing is described for verifying that a software package being downloaded is permitted by the software package being executed on a device.
[0213] In step 901, the device uses Figure 2 The method shown is to verify that a received software package originates from a trusted source.
[0214] In step 902, execute Figure 6 Steps 601 to 604 are performed to create a security signature of the software package in the device.
[0215] In step 903, before using the software package, execute Figure 6 Steps 605 to 607 are performed to verify that the software package has not been modified since step 902.
[0216] Figure 10 Shows the implementation Figure 11 Object required for the examples shown in , thereby allowing increased security of data displayed by a web browser.
[0217] The web browser 1001 has available thereto an asymmetric key pair consisting of a private key 1002p and a public key 1002u.
[0218] The server 1003s, which possesses an asymmetric key pair 1003 consisting of a private key 1003p and a public key 1003u, passes the public key of the secure Internet site 1004s to the browser.
[0219] The Internet site 1004s possesses an asymmetric key pair 1004 consisting of a private key 1004p and a public key 1004u.
[0220] In step 1101 , the user enters the URL address of the site he wants to search in the address bar of the browser 1001 .
[0221] In step 1102, browser 1001 uses key pair 1002 and sends the following information to server 1003s:
[0222] -The URL of the site that the user wishes to query,
[0223] - the browser's public key 1002u, and
[0224] -The URL address of the browser 1001 so that the server can respond to it.
[0225] In step 1103, the server 1003s uses Figure 2 The method according to the present invention is shown to securely send the public key 1004u of the site 1004s to the browser.
[0226] The server will use the public key 1002u to decrypt the second number sent to it by the navigator during the exchange.
[0227] In step 1104, browser 1001 sends the following information to site 1004s:
[0228] - the name of the page on the site that the user wishes to query,
[0229] - the browser's public key 1002u, and
[0230] -The URL address of the browser so that the site can respond to it.
[0231] In step 1105, the server 1004s uses Figure 2 The method according to the invention shown securely sends the requested page to the browser.
[0232] Figure 12 Shows the implementation Figure 13 Objects required for the examples shown in , which allow for improved security of emails.
[0233] The first electronic device A, which may be a computer or a smart phone, allows sending, receiving, archiving, editing and displaying emails 1200 in the form of electronic files.
[0234] The first device A has access to an asymmetric key pair 1201c consisting of a public key 1201u and a private key 1201p.
[0235] The second electronic device B allows sending, receiving, archiving, editing, and displaying of email 1200 .
[0236] The second device B has access to an asymmetric key pair 1202c consisting of a public key 1202u and a private key 1202p.
[0237] The server 1203 collects identification numbers and public keys of electronic devices such as A and B that are certified to protect the integrity of received emails and the confidentiality of random numbers associated with the random hashing method according to the present invention.
[0238] The server 1203 has access to a key pair 1203c consisting of a public key 1203u and a private key 1203p. It should be noted that the server may have multiple key pairs, each dedicated to communicating with a well-defined electronic device.
[0239] The server 1204 associates one or more electronic devices with a destination address 1205 for the email.
[0240] The server 1204 has access to a key pair 1204c consisting of a public key 1204u and a private key 1204p. It should be noted that the server may have multiple key pairs, each dedicated to communicating with a well-defined electronic device.
[0241] In step 1301 , a user requests the first device A to send an email 1200 to a destination address 1205 .
[0242] In step 1302, the first device A uses Figure 2 The method according to the present invention shown communicates with a server 1204, whose public key the first device A knows, to determine the identifier and public key of device B associated with address 1205. After the server 1204 authenticates the first device A, the server 1204 sends the identifier and public key of device B to the first device A. This is also done using Figure 2 The method shown is complete, with server 1204 knowing device A's public key and device A knowing the public key of server 1204. This method allows device A to receive unmodified data from server 1204. Server 1204 itself will be able to obtain device B's public key from server 1203 and simultaneously verify device A's public key.
[0243] In step 1303 , the first device A transmits its identifier to device B.
[0244] In step 1304, device B, after receiving the identifier transmitted in step 1303, communicates with server 1203 to determine the public key of first device A. Figure 2 This allows device B to receive the information unmodified. Device B notifies device A of the receipt of the information by sending a receipt confirmation to device A.
[0245] In step 1305, after receiving the confirmation sent in step 1304, the first device A uses Figure 2 The method according to the present invention shown in FIG sends an email 1200 to device B, which can then be sure that the information was sent by device A and received unchanged. In addition, device A is sure that the information was authenticated only by device B.
[0246] Because encryption methods using asymmetric and symmetric keys may be vulnerable to attacks by quantum computers, in the above examples, these encryption methods can be replaced with encryption methods using one-time keys.
[0247] The invention is not limited to the examples of embodiment described above, nor to the applications illustrated. The invention can be used in particular to increase the security of financial transactions.
Claims
1. A method for verifying the integrity of a message (101) originating from a sender (A) by means of a device (B), the method comprising: i. the device (B) receives the message (101) and an identifier of the message, the message forming a first data set, ii. Generate numbers called mixed numbers, iii. using a mixing function (105) to mix the mixed digital data with the first data set to obtain mixed data, iv. hashing the mixed data using a hash function (106), v. said means (B) sending said message identifier and said mixed number to said sender (A) of said message, vi. the device (B) receives an encrypted second data set originating from the sender (A), the encryption using a one-time key, vii. decrypting the second data set using the one-time key, and viii. comparing the hash obtained in step iv with the second data set decrypted in step vii, the decrypted second data set being assumed to be the hash of the message mixed with the same mixing function (105) and the same mixing number used in step iii, if the second data set decrypted in step vii is identical to the hash obtained in step iv, the integrity of the message is ensured.
2. The method according to claim 1, comprising between steps v and vi: - said sender (A) receives said message identifier and said mixed number, - identifying said message (101) sent to said device (B) using an identifier of said message, - mixing said message with said mixing number using said mixing function (105), - hashing the data generated in the previous step using said hash function (106), - encrypt the hash produced in the previous step using the one-time key, and - sending said hash encrypted to said device (B), In the method, the mixed number is kept secret.
3. The method according to claim 2, comprising encrypting the mixed number between steps iv and v, and decrypting the mixed number between steps v and vi.
4. The method according to claim 3, wherein the decryption in step vii is performed using a symmetric key and the encryption of the mixed number is performed using a one-time key. The method of claim 3 , wherein the encryption of the mixed number is performed using a symmetric key.
6. A method for verifying that a data set present in a device (A; B) has not been modified between two times d1 and d2, said data set forming a first data set at time d1 and a second data set at time d2, said method comprising: i. mixing a number, called a mixing number, with said first data set using a mixing function (105) to obtain mixed data, ii. hashing the mixed data using a hash function (106), iii. the device (A; B) securely stores the mixed number and the hash obtained in step ii, iv. creating a modified copy of the second data set using the mixing number and the mixing function, v. hashing the modified copy using the hash function, and vi. Compare the hash obtained in step ii with the hash obtained in step v. If the two hashes are the same, then the data set has not been modified between the two times d1 and d2, In the method, the mixed number is kept secret.
7. A method for verifying, by means of a device (B), the integrity of a message (101) originating from a sender (A) and forming a first data set, the method comprising: i. said device (B) receives said message (101), a second data set encrypted using a one-time key, and an encrypted number called a mixing number, ii. decrypting the mixed number and the second data set using the one-time key, and iii. mixing the message (101) with the mixing number using a mixing function (105) to obtain mixed data, iv. hashing the mixed data using a hash function (106), and v. comparing the hash obtained in step iv with the second data set decrypted in step ii, the decrypted second data set being assumed to be the hash of the first data set mixed with the same mixing function (105) and the same mixing number used in step iii, if the hash obtained in step iv is identical to the second data set decrypted in step ii, the integrity of the message is ensured.
8. The method according to claim 7, comprising before step i: - said sender (A) generates said mixed number, - mixing said mixing number with said message (101) using said mixing function (105), - hashing the data generated in the previous step using said hash function (106), - using the one-time key to encrypt the hash generated in the previous step and form a second data set, - encrypting said mixed number, and - sending said message (101), said second encrypted data set and said encrypted mixed number to said device (B), In the method, the mixed number is kept secret.
9. A method implemented by a first device (A) and a second device (B) for comparing a first data set (401A) present in the first device (A) and a second data set (401B) present in the second device (B), in particular for determining whether the two data sets are identical, the method comprising: i. said first means (A) mixing a number, called a mixing number, with said first data set (401A) using a mixing function (405) to obtain mixed data, ii. the first device (A) hashes the mixed data using a hash function (406), iii. the first device (A) encrypts the mixed number, the encryption using a one-time key, iv. the first device (A) sends the encrypted mixed number to the second device (B), v. the first device (A) receives an encrypted hash of the second data set (401B), vi. decrypting the encrypted hash using the one-time key, and vii. Compare the hash obtained in step ii with the decrypted hash in step vi.
10. The method according to claim 9, comprising between steps iv and v: - said second device (B) receives said mixed number encrypted, - decrypting said mixed number, - creating a modified copy of said second data set (401B) using said mixing number and said mixing function (405), - hashing said modified copy of said second data set using said hash function (406), - encrypt the hash produced in the previous step using the one-time key, and - the second device (B) sends an encrypted hash of the second data set (401B) to the first device (A), In the method, the mixed number is kept secret.
11. The method according to any one of claims 1 to 10, the mixing function (105; 405) being an XOR logic function.
12. Method according to any one of claims 1 to 10, said mixing function (105; 405) consisting in adding said mixed number to the end of said first data set.
13. The method according to any one of claims 1 to 10, the mixing function (105; 405) being an encryption function for encrypting the first data set using the mixing number as an encryption key.
14. The method according to any one of claims 1 to 10, wherein the mixed number is randomly generated.
15. The method according to any one of claims 1 to 10, wherein the hash function (106; 406) is selected from SHA1, SHA2, SHA256, MD5 and Jenkins function.
16. A computer program product comprising instructions readable by a processor of an apparatus for implementing the method according to any one of claims 1 to 15.
Citation Information
Patent Citations
Encryption protocol
EP1421548A1
Random number based data integrity verification method and system for distributed cloud storage
US20110246433A1
Tag generation apparatus, tag verification apparatus, communication system, tag generation method, tag verification method, and recording medium
US20120057702A1