System to secure encoding and mapping on elliptic curve cryptography (ECC)

A system in Elliptic Curve Cryptography (ECC) that offers secure encoding and mapping of a message to the curve E against encryption attacks, such as Chosen Plaintext Attack (CPA) and Ciphertext Only Attack (COA). The system includes, a method to convert the text message to numerical values with manipulation using Initial Vector IV. In addition, the system provides, a method to revert the manipulated values to their original value.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present application claims priority to provisional patent application No. 62/951,220, filed on Dec. 20, 2019, disclosure of which is incorporated herein at least by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention in the field of Elliptic Curve Cryptography and pertains particularly to encoding and mapping steps on ECC.

2. Description of Related Art

Elliptic curve cryptography (ECC) is an approach to asymmetric cryptography used widely in low computation devices due to its effectiveness in generating small keys with a strong encryption mechanism. Currently, the main usage of ECC is to exchange a shared key between two parties to symmetric encrypt and decrypt the ciphertext. However, many models and schemes use ECC to encrypt messages directly using several methods and approaches.

These methods and approaches suffer from weak implementation resulting to many encryption flaws and weaknesses. The main phase in the ECC phases that need to strong implementation is the encoding and mapping phase where the message converted to numerical values to be mapped to the curve used in the encryption. While these methods and approaches actually create ciphertexts, however these ciphertext are not resisting some encryption attacks, such as Chosen Plaintext Attack (CPA) and Ciphertext only Attack (COA).

Therefore, what is clearly needed is a method to securely encoding and mapping in ECC, that solves the weaknesses mentioned above.

BRIEF SUMMARY OF THE INVENTION

In an embodiment of the present invention a system for securing the encoding and mapping in ECC against several encryption attacks, including steps to secure a message using ECC, and a method for converting the message to set of blocks of binary value. Also, a method to encode the set of blocks of binary value using IV to secure the message blocks. In addition, a method to map the encoded set of blocks to elliptic curve E. Also, including a method for decoding the mapped points using IV to retrieve the message to its original value.

DETAILED DESCRIPTION OF THE INVENTION

The inventor provides a secure encoding and mapping step in the ECC to enable the ciphertext to resist encryption attacks such as CPA and COA attacks. The present invention is described in enabling detail in the following examples, which may represent more than one embodiment of the present invention.

FIG. 1is a flowchart100describes the steps to secure messages by encrypting the plaintext using ECC according to an embodiment of the invention. Flowchart100is in this example a flowchart to enhance the ciphertext resistance to encryption attacks produced by ECC. Flowchart100has 7 steps, they are step102,104,106,108,110,112and114. These steps described as following, Step102: System obtains a plaintext message M, and divide it to set of blocks {B1, B2, . . . , Bn}, each size of block is based on the size of p. The detail process of this step depicted onFIG. 2. Step104: The process of encoding and manipulating each block {B1, B2, . . . , Bn} that produced from step102, with Initial Vector IV and it result with set of manipulated blocks {B′1, B′2, . . . , B′n}. These blocks are secured and resisted the encryption attacks such as CPA and COA. These steps are described in details inFIG. 3.

Step106: The process of converting the blocks {B′1, B′2, . . . , B′n} to numerical values as ECC deals only with numbers. Thus, these blocks converted to numerical values to map them to ECC and secure them. Each numerical value is assigned to xiand then mapped to EC by finding the value of yithat satisfy the EC equation. The mapping to EC may need more than one rounds, therefore xiis multiplied by 31 to increase the number of rounds to 32. These steps are described in details inFIG. 4. Step108: shows the encryption process by the addition+operation between the mapped points (xi, yi) from step106and the shared key Skeywhich known only by the sender and the recipient. The addition operation results the encrypted points (Cxi, Cyi). These steps are described in details inFIG. 5.

Step110: shows the decryption process which is the reverse way of encryption. The step to decrypt the received points (Cxi, Cyi) is by subtract it from the shared Skey. The result is the mapped points (xi, yi) that used to decode the message. These steps are described in details inFIG. 6. Step112: shows the decoding process to convert the mapped points (xi, yi) to plaintext. This done by dividing the xiand converting it to its binary value. Following that, the first binary block is XORed ⊕ with the IV, while the rest of blocks are ⊕ with its previous xivalue. These steps are described in details inFIG. 7. Step114: shows the converting process of the binary values from previous step and group each 8 bits of these values to convert it to its corresponding character where the plaintext is all characters grouped in one set. These steps are described in details inFIG. 8.

FIG. 2is a diagram200describes the step102inFIG. 1, an encoding and a converting of a plaintext to set of binary values and grouping them in a set of blocks Bn. Step202: Obtain a plaintext message M. Step204: Divide the M to set of {c1, c2, . . . , cs}. The value of s is the represented as the number of characters in the message M. Step206: Obtain the size of the prime number p and obtain the block size Bsby the equation

Bs=⌊p-88⌋
and the number of blocks n that used to group the set of characters Bsis calculated by

n=⌈sBS⌉.
Step208: Group each set of characters (presented in binary values) {c1, c2, . . . , cBs}. to one group, the result is a set of blocks {B1, B2, . . . , Bn}. The number of characters in one group is equal to Bs.

FIG. 3is a diagram300describes the step104inFIG. 1, the process of securing the set of blocks BnfromFIG. 2, which results to set of secured blocks B′n. Step208: Obtain the set of blocks {B1, B2, . . . , Bn} from the previous step (FIG. 2step208). Step304: Obtain the random IV with same size of p and for each i={1, 2, . . . , n} obtain Biand ⊕ it with IV which results B′i. Then, map the B′ito the elliptic curve E which results Bim. Afterward, assign IV=Bin. Step306: Each {B′1, B′2, . . . , B′n} are the secured encoded blocks that against several encryption attacks. The process of securing these blocks is described on algorithm1. Step308: is the mapping point process depicted inFIG. 4.

Algorithm 1: Encoding message with IV algorithmInput: Blocks retrieved (Bi) from message M and IVOutput: Encoded blocks (B′i) with IV1for i = 0; i < no of blocks; i + +;2let B′i= Bi⊕ IV;3let Bim= map(B′i);4let IV = Bim;5Encoded message ← the set of B′i;

FIG. 4is a diagram400describes the step106inFIG. 1, the process of mapping phase which is the steps to convert the secured blocks values B′nfromFIG. 3to decimal values and map it to EC E which results to set of (xi, yi). Step404: For each i={1, 2, . . . , n} obtain the B′iand convert it to the corresponding decimal value then assign it to xito be used with mapping step. Step406: Multiply each xiby 31 to limit the mapping rounds to 32 rounds. Step408: Map each xito EC using EC equation y2≡x3+a. x+b mod p and find yi. Step409: If yifound then the point (xi, yi) is mapped, otherwise increase xiby1and repeat the process 32 times. Step410: Each mapped points {(xi, yi), (x2, y2), . . . , (xi, yi)} are secure against encryption attacks such as CPA and COA.

FIG. 5is a diagram500describes the step108inFIG. 1, the encryption mechanism to convert the mapped points (xi, yi) fromFIG. 4to cipher text. Step410: For each i={1, 2, . . . , n} retrieve the mapped points (xi, yi) from previous step. Step504: Construct the secret key SkeyElliptic Curve Diffie Helman (ECDH). Step506: Perform the addition+operation between the mapped point (xi, yi) and the secret key Skey. Step508: The output is the ciphertext represented as points (Cxi, Cyi).

FIG. 6is a diagram600describes the step110inFIG. 1, the reverse process of encryption step which is the decryption step to convert the cipher text fromFIG. 5to plain mapped points (xi, yi). Step508: For each i={1, 2, . . . , n} retrieve the ciphertext (Cxi, Cyi) of the mapped points from previous step. Step504: Construct the secret key Skeyusing ECDH. Step606: Perform the subtract process between the ciphertext of the mapped points and secret key Skey. Step608: The output is the mapped points (xi, yi).

FIG. 7is a diagram700describes the step112inFIG. 1, the decoding step to decode the xivalue fromFIG. 6to set of binary values. This figure described in algorithm2. Step702: For each i={1, 2, . . . , n} retrieve the xifrom the mapped points (xi, yi) and assign the result to ti. Step704: Divide the decimal value of xiby 31. Step706: Convert the tito binary value. Step708: Retrieve the Initial Vector IV. Step710: Perform the ⊕ process between the binary bits from step706and IV, then let IV=xifrom step702. Step712: The output of step710is a group of bits represent the binary value of the message M.

Algorithm 2: Decoding mapped points to message algorithmInput: Mapped points (Bim) and IVOutput: Binary blocks of message1for i = 0; i < no of blocks; i + +;2let B′i= Bi⊕ IV;3let Bim= map(B′i);4let IV = Bim;5Encoded message ← the set of B′i;

FIG. 8is a diagram800describes the step114inFIG. 1, the steps needed to convert the binary value fromFIG. 7to the original message. Step712: Retrieve the group of bits from previous step. Step804: Convert each 8 bits to its corresponding ASCII code. Step806: Aggregate each n characters to one block. Step808: The output of step806is the original message M.

It will be apparent to one with skill in the art that the securing method of the encoding and the mapping on ECC of the invention may be provided using some or all of the mentioned features and components without departing from the spirit and scope of the present invention. It will also be apparent to the skilled artisan that the embodiments described above are specific examples of a single broader invention which may have greater scope than any of the singular descriptions taught. There may be many alterations made in the descriptions without departing from the spirit and scope of the present invention.