# Patent

## Title
Method for authenticated encryption and decryption

## Abstract

In this invention, a new authenticated encryption and decryption technique has been proposed. In general, conventional encryption modes like (CTR, CBC, and CFB etc.) cannot provide integrity support and in order to ensure both the privacy and integrity, they require two passes and additional support like MAC, CRC etc. However, this new authenticated encryption technique can ensure both the privacy and integrity in single pass without any MAC or CRC support. Most importantly, this new technique can easy be incorporated with the existing encryption modes. As a consequence of the integration, the existing encryption modes can resolve several security issues related to integrity, without impairing their existing security properties.

## Background
CROSS-REFERENCE TO RELATED APPLICATION
This application claims the benefit of Taiwan Patent Application No. 102123966, filed on Jul. 4, 2013, in the Taiwan Intellectual Property Office, the disclosure of which is incorporated herein in its entirety by reference.
BACKGROUND OF THE INVENTION
1. Field of the Invention
The present disclosure is related to a method for authenticated encryption and decryption, particularly, to method for authenticated encryption and decryption capable of being integrated with other encryption and decryption algorithms.
2. Description of the Related Art
Due to the growing popularity of computer systems and the Internet, using the Internet to transmitting computer data becomes one of the indispensable parts of people's lives. Therefore, how to ensure that others are not being spied on or changed the computer data during data transmission becomes an extremely important area of research.
In general, the privacy and the authentication are two most important issues in the field of data transmission. The privacy can be achieved by encrypting data blocks of the data to be transmitted. The authentication can utilize the message authentication code or the checksum verification inserted in the data to ensure the correctness of data. For integrating the two issues, in the prior art, attaching the message authentication code or utilizing the hashing function is employed to achieve the purpose of the authentication. However, such method requires additional transmission space or additional computation cost to transmit data.
Accordingly, the inventor of this invention designs a method for authenticated encryption and decryption capable of encrypting a binary plain text block and being integrated with both of the privacy and the authentication. The drawbacks of the current studies can be improved by integrating the method into these studies, so as to enhance the usage of the encryption and decryption for the data transmission.
SUMMARY OF THE INVENTION
Based on the purpose of the present invention, a method for authenticated encryption and decryption is proposed. The method comprises following steps: receiving a binary plain text at an encryption end; performing an encryption process according to the binary plain text data, the encryption process comprising following steps: providing n encryption paths, wherein n is a positive integer; providing a first input encryption parameter At to the t-th path of the n encryption paths correspondingly, wherein t is an integer, 1≦t≦n, 0≦r<t, r is an integer, and At+r is a function f(Mt) with an input parameter of a binary plain text Mt; performing a first encryption logic computation for the first input encryption parameter At of the t-th path correspondingly so as to generate a first middle encryption value Bt; performing an encryption computation for the first middle encryption value Bt of the t-th path and an encryption kernel correspondingly so as to generate a second middle encryption value Ft; providing a second input encryption parameter Gt to the t-th path of the n encryption paths correspondingly, wherein 0≦s<t, s is an integer, and Gt+s is a function f(Mt) with an input parameter of the binary plain text Mn; performing a second encryption logic computation for the second middle encryption value Ft in the t-th path and the second input encryption parameter Gt so as to generate a cipher text Ct; providing p encryption/authentication paths, wherein p is a positive integer; providing a first encryption/authentication parameter AVj to a j-th path of p encryption/authentication paths correspondingly, wherein 1≦j≦p; performing a first encryption/authentication logic computation for the first encryption/authentication parameter AVj of the j-th encryption/authentication path correspondingly so as to generate a first middle encryption/authentication value BVj; performing an encryption computation for the first middle encryption/authentication value BVj of the j-th encryption/authentication path and the encryption kernel correspondingly so as to generate a second middle encryption/authentication value FVj of the j-th encryption/authentication path; providing a second encryption/authentication data GVj to the j-th path; performing a second encryption/authentication logic computation for the second middle encryption/authentication value FVj of the j-th encryption/authentication path and the second encryption/authentication data GVj correspondingly so as to generate a cipher text Cn+j; receiving the cipher text Cn+j at a decryption end and performing a decryption process, the decryption process comprising following steps: providing n decryption paths; providing a first input decryption parameter Jt to a t-th path of the n decryption paths correspondingly, wherein 1≦t≦n; performing a first decryption logic computation for the first input decryption parameter Jt of the t-th path correspondingly so as to generate a first middle decryption value Kt; performing a decryption computation for the first middle decryption value Kt of the t-th path and a decryption kernel correspondingly so as to generate a second middle decryption value Lt; performing a second logic decryption computation for the second middle decryption value Lt of the t-th path and a second input decryption parameter Nt so as to generate a decrypted binary plain text Mt′; providing p decryption/authentication paths, wherein p is a positive integer; providing a first decryption-authentication parameter JVj to a j-th decryption/authentication path of the p decryption/authentication paths correspondingly, wherein 1≦j≦p; performing a first logic decryption/authentication computation for the first decryption-authentication parameter JVj of the j-th decryption/authentication path correspondingly so as to generate a first middle decryption/authentication value KVj; performing a decryption computation for the first middle decryption value KVj of the j-th decryption/authentication path and the decryption kernel correspondingly so as to generate a second middle decryption/authentication value LVj of the j-th decryption/authentication path; and performing a second logic decryption/authentication computation for the second middle decryption/authentication value LVj of the j-th decryption/authentication path and second decryption/authentication data NVj so as to generate a plain text of decryption an authentication MVj.
Preferably, in the encryption process, r=0 and s=1; the first input encryption parameter At of the t-th path of the n encryption paths further comprises a t-th output ctrt of a counter, 1≦t≦n; the first encryption logic computation is an Exclusive OR logic computation and it is performed for the first input encryption parameter At so as to generate the first middle encryption value Bt; the encryption kernel is a block encryption EK controlled by a positive integer K; the second input encryption parameter G1 of the first path of the n encryption paths is a first output ctr1 of the counter; the second encryption logic computation is another Exclusive OR logic computation; p=1; the first encryption/authentication logic computation and the second encryption/authentication logic computation are an Exclusive OR logic computation correspondingly; the first encryption/authentication parameter AVp is a default EV (Ending Vector) and a (n+1)-th output ctrn+1 of the counter; the second encryption/authentication data GVp comprises the function f(Mn) with an input parameter of the binary plain text Mn; in the decryption process, s=1; the first input decryption parameter J1 of the first path of the n decryption paths comprises the first output ctr1 of the counter; the first input decryption parameter Jt+s comprises the function f(Mt′) with an input parameter of the decrypted binary plain text Mt′, 1≦t≦n; the first decryption logic computation is an Exclusive OR logic computation and it is performed for the cipher text Ct and the first input decryption parameter Jt so as to generate the first middle decryption value Kt; the decryption kernel is a block decryption DK controlled by a positive integer K; the second logic decryption computation is an Exclusive OR logic computation; the second input decryption parameter Nt of the t-th path of the n decryption paths is a t-th output ctrt of the counter; p=1; the first logic decryption/authentication computation is an Exclusive OR logic computation; the cipher text Cn+p and the first decryption-authentication parameter JVp comprises the function f(Mn′) with an input parameter of the decrypted binary plain text Mn′ so as to perform the first logic decryption/authentication computation, the second logic decryption/authentication computation is an Exclusive OR logic computation, and the second decryption/authentication data NVp is a (n+p)-th output ctrn+p of the counter.
Preferably, in the encryption process, r=0 and s=1; the first input encryption parameter At of the t-th path of the n encryption paths further comprises an incrementing function Δt, 1≦t≦n and Δ1≠Δ2≠ . . . ≠Δn; the first encryption logic computation is an Exclusive OR logic computation and it is performed for the first input encryption parameter At so as to generate the first middle encryption value Bt; the encryption kernel is a block encryption EK controlled by a positive integer K; the second input encryption parameter G1 of a first path of the n encryption paths is the incrementing function Δ1; the second encryption logic computation is an Exclusive OR logic computation; an Exclusive OR logic computation is performed for the cipher text Ch and the incrementing function Δh so as to generate a cipher text Ch′, s<h≦n; p=1; the first encryption/authentication logic computation and the second encryption/authentication logic computation are an Exclusive OR logic computation correspondingly; the first encryption/authentication parameter AVp comprises a default EV (Ending Vector) and the incrementing function Δn+p; the second encryption/authentication data GVp comprises a function f(Mn) with an input parameter of the binary plain text Mn; an Exclusive OR logic computation is further performed for the cipher text Cn+p and an incrementing function Δn+p so as to generate a cipher text Cn+p′; in the decryption process, s=1; the first input decryption parameter J1 of the first path of the n decryption paths comprises the incrementing function Δ1; the first input decryption parameter Jt+s is a result of an Exclusive OR logic computation performed for the function f(Mt) with an input parameter of the binary plain text Mt and an incrementing function Δt+s, 1≦t≦n; the first decryption logic computation is an Exclusive OR logic computation and it is performed for the cipher text Ct′ and the first input decryption parameter Jt so as to generate the first middle decryption value Kt; the decryption kernel is a block decryption DK controlled by a positive integer K; the second input decryption parameter Nt of the t-th path of the n decryption paths is the incrementing function Δt; p=1; the first logic decryption/authentication computation is an Exclusive OR logic computation; the first decryption-authentication parameter JVp is a result of an Exclusive OR logic computation performed for the function f(Mn′) with an input parameter of the binary plain text Mn′ and the incrementing function Δn+p; the second logic decryption/authentication computation is an Exclusive OR logic computation; the second decryption/authentication data NVp is the incrementing function Δn+p.
Preferably, in the encryption process, s=0, r=p, and 2≦p; the first encryption logic computation is not provided to the top p paths of the n encryption paths; in the last (n−p) paths of the n encryption paths and the p encryption/authentication paths, the first encryption logic computation and the first encryption/authentication logic computation comprises an Exclusive OR logic computation; the encryption kernel is a block encryption EK controlled by a positive integer K; the second encryption logic computation of the n encryption paths comprises a computation of shift register and an Exclusive OR logic computation sequentially, the computation of shift register outputs an input value after shifting the input value by g bits, and g is a positive integer; the second encryption logic computation of the p encryption paths comprises a computation of shift register, and the computation of shift register outputs an input value after shifting the input value by g bits; from the first encryption path to the top p encryption paths, the first input encryption parameter Ac of a c-th path comprises a c-th output ctrc of the counter, 1≦c≦p; the first input encryption parameter Ad of the d-th path of the last (n−p) encryption paths further comprises a d-th output ctrd, wherein p+1≦d≦n; the first encryption/authentication parameter AVj of the p encryption/authentication paths comprises the function f(Mn+j−p) with the input parameter of the binary plain text Mn+j−p and the (n+j)-th output ctrn+j of the counter, wherein 1≦j≦p; the second encryption/authentication data GVj is not provided to the p encryption/authentication paths; in the decryption process, s=0; the first decryption logic computation is not provided to the top p paths of the n decryption paths; in the last (n−p) paths of the n encryption paths and the p encryption/authentication paths, the first decryption logic computation and the first logic decryption/authentication computation comprises an Exclusive OR logic computation; the decryption kernel is the block encryption EK, K is a positive integer; the second logic decryption computation of the n decryption paths comprises a computation of shift register and an Exclusive OR logic computation sequentially, and the computation of shift register outputs an input value after shifting the input value by g bits; the second logic decryption computation of the p encryption paths comprises a computation of shift register, and the computation of shift register outputs an input value after shifting the input value by g bits; from the first decryption path to the top p decryption paths, the first input decryption parameter Jc of a c-th path comprises a c-th output ctrc of the counter, wherein 1≦c≦p; the first input decryption parameter Jd of a d-th path in the last (n−p) decryption paths further comprises a d-th output ctrd of the counter and the function f(Md−p′) with an input parameter of the decrypted binary plain text Md−p′, wherein p+1≦d≦n; the second input decryption parameter Nt of the n decryption paths is the cipher text Ct, 1≦t≦n; the first decryption-authentication parameter JVj of the p decryption/authentication paths comprises the (n+j) output ctrn+j of the counter and the function f(Mn+j−p′) with an input parameter of the decrypted binary plain text Mn+j−p′, 1≦j≦p; and the second decryption/authentication data NVj is not provided to the p decryption/authentication paths.
Preferably, in the encryption process, s=0, r=p, and 2≦p; the first encryption logic computation is not provided to the top p paths of the n encryption paths; in the last (n−p) paths of the n encryption paths and the p encryption/authentication paths, the first encryption logic computation and the first encryption/authentication logic computation comprise an Exclusive OR logic computation; the encryption kernel is a block encryption EK controlled by a positive integer K; the second encryption logic computation of the n decryption paths comprises a computation of shift register and an Exclusive OR logic computation sequentially, wherein the computation of shift register outputs an input value after shifting g bits of the input value; the second encryption/authentication logic computation of the p encryption/authentication paths comprises an Exclusive OR logic computation and a computation of shift register, wherein the computation of shift register outputs an input value after shifting the input value by g bits; from the first encryption path to the top p encryption paths, the first input encryption parameter Ac of a c-th path comprises an incrementing function Δc, 1≦c≦p, and Δ1≠Δ2≠ . . . ≠Δp; the first input encryption parameter Ad of a d-th encryption path within the last (n−p) encryption paths further comprises the incrementing function Δd, p+1≦d≦n, and Δp+1≠Δp+2≠ . . . ≠Δn; an Exclusive OR logic computation is performed for the second middle encryption value Ft and an incrementing function Δt so as to generate another second middle encryption value Ft′, wherein Δ1≠Δ2≠ . . . ≠Δn; the first encryption/authentication parameter AVj of the p encryption/authentication paths comprises the function f(Mn+j−p′) with the input parameter of the binary plain text Mn+j−p′ and the incrementing function Δn+j, wherein 1≦j≦p; the second encryption/authentication data GVj of the p encryption/authentication paths comprises an incrementing function Δn+j; in the decryption process, s=0; the first decryption logic computation is not provided to the top p paths of the n decryption paths; in the last (n−p) paths of the n encryption paths and the p encryption/authentication paths, the first decryption logic computation and the first logic decryption/authentication computation comprise an Exclusive OR logic computation; the decryption kernel is the block encryption EK, K is a positive integer; the second logic decryption computation of the n decryption paths comprises a computation of shift register and an Exclusive OR logic computation sequentially, wherein the computation of shift register outputs an input value after shifting g bits of the input value; the second encryption/authentication logic computation of the p encryption/authentication paths comprises an Exclusive OR logic computation and a computation of shift register, wherein the computation of shift register outputs an input value after shifting the input value by g bits; from the first decryption path to the top p decryption paths, the first input decryption parameter Jc of a c-th path comprises the incrementing function Δc, wherein 1≦c≦p; the first input decryption parameter Jd of a d-th path in last (n−p) decryption paths further comprises the incrementing function Δd and the function f(Md−p′) with the input parameter of the decrypted binary plain text Md−p′, wherein p+1≦d≦n; an Exclusive OR logic computation is performed for the second middle decryption value Lt and the incrementing function Δt so as to generate another second middle decryption value Lt′, 1≦t≦n; the second input decryption parameter Nt of the n decryption paths comprises the cipher text Ct; the first decryption-authentication parameter JVj of the p decryption/authentication paths comprises the incrementing function Δn+j and the function f(Mn+j−p′) with the input parameter of the decrypted binary plain text Mn+j−p′, wherein 1≦j≦p; and the second decryption/authentication data NVj of the p decryption/authentication paths comprises an incrementing function Δn+j.
According to the above description, the method for authenticated encryption and decryption in the invention can be integrated into the existing prior arts to achieve a good privacy. Furthermore, the method for authenticated encryption and decryption is simple and in wide use by using the Exclusion OR logic computation to lower the cost of authenticating the correctness of encryption and decryption.



BRIEF DESCRIPTION OF THE DRAWINGS 
The detailed structure, operating principle and effects of the present disclosure will now be described in more details hereinafter with reference to the accompanying drawings that show various embodiments of the present disclosure as follows.
FIG. 1 is a schematic view of the method for authenticated encryption and decryption according to a first embodiment of the present application.
FIG. 2 is a schematic view of the method for authenticated encryption and decryption according to a second embodiment of the present application.
FIG. 3 is a schematic view of the method for authenticated encryption and decryption according to a third embodiment of the present application.
FIG. 4 is a schematic view of the method for authenticated encryption and decryption according to a fourth embodiment of the present application.



DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
Reference will now be made in detail to the exemplary embodiments of the present disclosure, examples of which are illustrated in the accompanying drawings. Therefore, it is to be understood that the foregoing is illustrative of exemplary embodiments and is not to be construed as limited to the specific embodiments disclosed, and that modifications to the disclosed exemplary embodiments, as well as other exemplary embodiments, are intended to be included within the scope of the appended claims. These embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the inventive concept to those skilled in the art. The relative proportions and ratios of elements in the drawings may be exaggerated or diminished in size for the sake of clarity and convenience in the drawings, and such arbitrary proportions are only illustrative and not limiting in any way. The same reference numbers are used in the drawings and the description to refer to the same or like parts.
It will be understood that, although the terms ‘first’, ‘second’, ‘third’, etc., may be used herein to describe various elements, these elements should not be limited by these terms. The terms are used only for the purpose of distinguishing one component from another component. Thus, a first element discussed below could be termed a second element without departing from the teachings of embodiments. As used herein, the term “or” includes any and all combinations of one or more of the associated listed items.
Referring to FIG. 1, it is a schematic view of the method for authenticated encryption and decryption according to a first embodiment of the present application. As shown in part (a) of the FIG. 1, the first input encryption parameter of the t-th path of the n encryption paths comprises a t-th output ctrt of a counter, 1≦t≦n. An Exclusive OR logic computation is performed for the first input encryption parameter ctrt and a t-th plain text Mt so as to generate a first middle encryption value Bt. Using a block encryption EK to encrypt the first middle encryption value Bt so as to generate a second middle encryption value Ft. Next, the second input encryption parameter Gt is proved to the t-th path of the n encryption paths, wherein G1 is the first output ctr1 of the counter, G2 ̃Gn are the function f(M1) ̃f(Mn−1) with an input parameter of binary plain text M1 ̃Mn−1, respectively. The function f(M1) ̃f(Mn−1) may include the original binary plain text M1 ̃Mn−1. Performing an Exclusive OR logic computation for the second middle encryption value Ft and Gt so as to generate a cipher text Ct. In addition, further providing an encryption/authentication path to n encryption paths. The Exclusive OR logic computation is performed for the (n+1)-th output ctrn+1 of the counter in the encryption/authentication path and an ending vector EV, so as to generate a first middle encryption/authentication value BV. Using an encryption kernel EK to encrypt the first middle encryption/authentication value BV, so as to generate second middle encryption/authentication value FV. Next, the Exclusive OR logic computation is performed for the second middle encryption/authentication value FV and the function f(Mn) with the input parameter of the plain text Mn, so as to generate a cipher text Cn+1.
As shown in part (b) of the FIG. 1, a first input decryption parameter Jt is proved to a t-th path of n decryption paths, J1 is a first output ctr1 of a counter and J2 ̃Jn indicate the function f(M1) ̃f(Mn−1) with the input parameter of decrypted plain text M1 ̃Mn−1, wherein f(M1) ̃f(Mn−1) may comprise the decrypted plain text M1 ̃Mn−1. The Exclusive OR logic computation is performed for the first input decryption parameter Jt and the t-th cipher text Ct, so as to generate first middle decryption value Kt. Next, the first middle decryption value Kt is decrypted by a decryption kernel DK, so as to generate a second middle decryption value Lt. Next, the Exclusive OR logic computation is performed for the second middle decryption value Lt and a second input decryption parameter ctrt, so as to generate a decrypted plain text Mt. Besides, further providing a decryption/authentication path to the n encryption paths. The function f(Mn) with the input parameter of the decrypted plain text Mn is provided to the decryption/authentication path. The Exclusive OR logic computation is performed for the function f(Mn) and a cipher text Cn+1, so as to generate a first middle decryption/authentication value KV. Using a decryption kernel DK to decrypt the first middle decryption/authentication value KV, so as to generate second middle decryption/authentication value LV. The Exclusive OR logic computation is performed for the second middle decryption/authentication value LV and the (n+1)-th output ctrn+1 of a counter, so as to generate a second ending vector EV′. The process of the encryption and the decryption is correct if the second ending vector EV′ is equal to the first ending vector EV. The method can be used in the Counter Mode (CTR) of the traditional Block cipher mode.
Referring to FIG. 2, it is a schematic view of the method for authenticated encryption and decryption according to a second embodiment of the present application. As shown in part (a) of the FIG. 2, a first input encryption parameter At of the t-th path of the n encryption paths comprises an incrementing function Δt. The Exclusive OR logic computation is performed for the first input encryption parameter At and the t-th plain text Mt, so as to generate a first middle encryption value Bt. Next, using a block encryption EK to encrypt Bt so as to generate a second middle encryption value Ft. Next, a second input encryption parameter Gt is provided to the t-th path of the n encryption paths correspondingly, G1 comprises an incrementing function Δ1, G2 ̃Gn are the results of performing the Exclusive OR logic computation for the function f(M1) ̃f(Mn−1) with the input parameter of binary plain text M1 ̃Mn−1 and the incrementing function Δ2 ̃Δn, correspondingly, wherein the function f(M1) ̃f(Mn−1) may include the binary plain text M1 ̃Mn−1. The Exclusive OR logic computation is performed for the second middle encryption value Bt and the second input encryption parameter Gt, so as to generate the cipher text Ct. The incrementing function Δn+1 is provided to an encryption/authentication path. The Exclusive OR logic computation is performed for the incrementing function Δn+1 and a first ending vector EV, so as to generate a first middle encryption/authentication value BV. Using an encryption kernel EK to encrypt the first middle encryption/authentication value BV so as to generate a second middle encryption/authentication value FV. Next, the Exclusive OR logic computation is performed for the second middle encryption/authentication value FV, the function f(Mn) with the input parameter of the plain text Mn, and an incrementing function Δn+1, so as to generate a cipher text Cn+1.
As shown in part (b) of the FIG. 2, providing an input data of decryption Jt of the t-th path of the n encryption paths. J1 is an incrementing function Δ1, J2 ̃Jn indicate the function f(M1) ̃f(Mn−1) with the input parameter of decrypted plain text M1 ̃Mn−1, respectively, wherein f(M1) ̃f(Mn−1) may comprise decrypted plain text M1 ̃Mn−1. The Exclusive OR logic computation is performed for the first input decryption parameter Jt and the t-th cipher text Ct, so as to generate first middle decryption value Kt. Next, the Exclusive OR logic computation is performed for the first middle decryption value Kr and the incrementing function Δr, so as to generate a second middle decryption value Lr, 2≦r≦n. Next, decrypting the first middle decryption value K1 and the second middle decryption value Lr by a decryption kernel DK, so as to generate a third middle decryption value St. The Exclusive OR logic computation is performed for third middle decryption value St and an incrementing function Δt, so as to generate a decrypted plain text Mt, 1≦t≦n. Besides, providing the function f(Mn) with the input parameter of the decrypted plain text Mn to the decryption/authentication path. The Exclusive OR logic computation is performed for the function f(Mn) and a cipher text Cn+1, so as to generate a first middle decryption/authentication value KV. The Exclusive OR logic computation is performed for the first middle decryption/authentication value KV and an incrementing function Δn+1, so as to generate a second middle decryption/authentication value LV. Using a decryption kernel DK to decrypt the second middle decryption/authentication value LV so as to generate a third middle decryption/authentication value TV. The Exclusive OR logic computation is performed for the third middle decryption/authentication value TV and the incrementing function Δn+1 so as to generate a second ending vector EV′. The process of the encryption and the decryption is correct if the first ending vector EV is equal to the second ending vector EV′.
Referring to FIG. 3, it is a schematic view of the method for authenticated encryption and decryption according to a third embodiment of the present application. As shown in part (a) of the FIG. 3, the first input encryption parameter Ai of the i-th path of the n encryption paths and the p encryption/authentication paths comprises the i-th output ctri of a counter, 1≦i≦n+p, and 2≦p. In the last (n−p) paths of the n encryption paths, the Exclusive OR logic computation is performed for the first input encryption parameter Ap+d and the function f(Md) with the input parameter of the plain text Md, so as to generate a first middle encryption value Bp+d, wherein f(Md) may comprise the plain text Md and 1≦d≦(n−p). Using a block encryption EK to encrypt Bt so as to generate a second middle encryption value Ft, 1≦t≦n. The computation of shift register is performed for the second middle encryption value Ft of the n encryption paths, so as to generate a third middle encryption value Ot. The Exclusive OR logic computation is performed for the third middle encryption value Ot of the n encryption paths and the binary plain text Mt, so as to generate the cipher text Ct. In the p encryption/authentication paths, the Exclusive OR logic computation is performed for the first encryption/authentication parameter An+j and the function f(Mn−p+j) with the input parameter of the plain text Mn−p+j, so as to generate the first middle encryption/authentication value BVj, wherein f(Mn−p+j) may comprise the plain text Mn−p+j, 1≦j≦p. Using a block encryption EK to encrypt the first middle encryption/authentication value BVj so as to generate a second middle encryption/authentication value FVj. A shift logic computation is performed for the second middle encryption/authentication value FVj so as to generate the cipher text Cn+j.
As shown in part (b) of the FIG. 3, the t-th output of a counter is provided to the t-th path of the n decryption paths, 1≦t≦n. In the last (n−p) paths of the n decryption paths, the Exclusive OR logic computation is performed for the first input decryption parameter ctrp+d and the function f(Md) with the input parameter of decrypted plain text Md, so as to generate a first middle decryption value Kp+d, wherein f(Md) may comprise the decrypted plain text Md, 1≦d≦(n−p). Next, using a block encryption EK to decrypt a first middle decryption value Kt so as to generate a second middle decryption value Lt. The computation of shift register is performed for the second middle decryption value Lt so as to generate the third middle decryption value St. The Exclusive OR logic computation is performed for the third middle decryption value St and the cipher text Ct so as to generate the decrypted plain text Mt. The (n+j)-th output ctrn+j of the counter is provided to the j-th path of the p decryption/authentication paths, 1≦j≦p. The Exclusive OR logic computation is performed for the ctrn+j and the function f(Mn−p+j) with the input parameter of the decrypted plain text Mn−p+j, so as to generate the first middle decryption/authentication value KVj, wherein f(Mn−p+j) may comprise the plain text Mn−p+j. Next, using a block encryption EK to decrypt the first middle decryption value KVj so as to generate a second middle decryption/authentication value LVj. A computation of shift register is perform for the second middle decryption/authentication value LVj so as to generate the authenticated cipher text Cn+j′, 1≦j≦p. The process of the encryption and the decryption is correct if the cipher text Cn+j is equal to the authenticated cipher text Cn+j′. In the method for authenticated encryption and decryption, the value p may determine the maximum scale of parallel processing of a processor to achieve the effect for authenticated encryption and decryption in real-time streams.
Referring to FIG. 4, it is a schematic view of the method for authenticated encryption and decryption according to a fourth embodiment of the present application. As shown in part (a) of the FIG. 4, the first input encryption parameter of the n encryption paths and the i-th path of the p encryption/authentication paths comprises an incrementing function Δi, 1≦i≦n+p and 2≦p. In the last (n−p) paths of the n decryption paths, the Exclusive OR logic computation is performed for the incrementing function Δp+d and the function f(Md) with the input parameter of the plain text Md so as to generate a first middle encryption value Bp+d, wherein f(Md) may comprise the plain text Md, 1≦d≦(n−p). Using a block encryption EK to encrypt Bt so as to generate a second middle encryption value Ft, 1≦t≦n. The Exclusive OR logic computation is performed for the second middle encryption value Ft and the incrementing function Δt so as to generate a third middle encryption value Ot. The computation of shift register is performed for the third middle encryption value Ot so as to generate the fourth middle encryption value Et. The Exclusive OR logic computation is performed for the fourth middle encryption value Et and a plain text Mt so as to generate the cipher text Ct. In the p encryption/authentication paths, the Exclusive OR logic computation is performed for the incrementing function Δn+j and the function f(Mn−p+j) with the input parameter of the plain text Mn−p+j so as to generate the first middle encryption/authentication value BVj, wherein f(Mn−p+j) may comprise the plain text Mn−p+j, 1≦j≦p. Using a block encryption EK to encrypt the first middle encryption/authentication value BVj so as to generate a second middle encryption/authentication value FVj. The Exclusive OR logic computation is performed for the second middle encryption/authentication value FVj and an incrementing function Δn+j, so as to generate a third middle encryption/authentication value UVj. A computation of shift register is performed for the third middle encryption/authentication value UVj so as to generate the cipher text Cn+j.
As shown in part (b) of the FIG. 4, an incrementing function Δt is provided to the t-th path of the n decryption paths, 1≦t≦n. In the last (n−p) paths of the n decryption paths, the Exclusive OR logic computation is performed for the incrementing function Δp+d and the function f(Md) with the input parameter of the plain text Md so as to generate a first middle decryption value Kp+d, wherein f(Md) may comprise the plain text Md, 1≦d≦(n−p). Using a block encryption EK to decrypt Kt so as to generate a second middle decryption value Lt. The Exclusive OR logic computation is performed for the second middle decryption value Lt and the incrementing function Δt so as to generate a third middle decryption value St. Performing the computation of shift register for the third middle decryption value St so as to generate the fourth middle decryption value Ft. The Exclusive OR logic computation is performed for the fourth middle decryption value Ft and the cipher text Ct so as to generate the decrypted plain text Mt. In the p encryption/authentication paths, the Exclusive OR logic computation is performed for the incrementing function Δn+j of a first input decryption/authentication parameter and the function f(Mn−p+j) with the input parameter of the decrypted plain text Mn−p+j so as to generate the first middle decryption/authentication value KVj, wherein f(Mn−p+j) may comprise the decrypted plain text Mn−p+j. Next, using a block encryption EK to decrypt KVj so as to generate a second middle decryption/authentication value LVj. The Exclusive OR logic computation is performed for the second middle decryption/authentication value LVj and an incrementing function Δn+j, so as to generate a third middle encryption/authentication value MVn+j, 1≦j≦p. The computation of shift register is perform for the third middle decryption/authentication value MVn+j, so as to generate the authenticated cipher text Cn+j′. The process of the encryption and the decryption is correct if the cipher text Cn+j is equal to the authenticated cipher text Cn+j′, 1≦j≦p. In the method for authenticated encryption and decryption the value p may determine the maximum scale of parallel processing of a processor to achieve the effect for authenticated encryption and decryption in real-time streams.
The above-mentioned descriptions represent merely the exemplary embodiment of the present disclosure, without any intention to limit the scope of the present disclosure thereto. Various equivalent changes, alternations or modifications based on the claims of present disclosure are all consequently viewed as being embraced by the scope of the present disclosure.

## Claims

1. A method for authenticated encryption and decryption, comprising:
receiving a binary plain text at an encryption end;
performing an encryption process according to the binary plain text data, the encryption process comprising following steps:
providing n encryption paths, wherein n is a positive integer;
providing a first input encryption parameter At to the t-th path of the n encryption paths correspondingly, wherein t is an integer, 1≦t≦n, 0≦r<t, r is an integer, and At+r is a function f(Mt) with an input parameter of a binary plain text Mt;
performing a first encryption logic computation for the first input encryption parameter At of the t-th path correspondingly, to generate a first middle encryption value Bt;
performing an encryption computation for the first middle encryption value Bt of the t-th path and an encryption kernel correspondingly so as to generate a second middle encryption value Ft;
providing a second input encryption parameter Gt to the t-th path of the n encryption paths correspondingly, wherein 0≦s<t, s is an integer, and Gt+s is a function f(Mt) with an input parameter of the binary plain text Mn;
performing a second encryption logic computation for the second middle encryption value Ft of the t-th path and the second input encryption parameter Gt, to generate a cipher text Ct;
providing p encryption/authentication paths, wherein p is a positive integer;
providing a first encryption/authentication parameter AVj to a j-th path of p encryption/authentication paths correspondingly, wherein 1≦j≦p;
performing a first encryption/authentication logic computation for the first encryption/authentication parameter AVj of the j-th encryption/authentication path correspondingly, to generate a first middle encryption/authentication value BVj;
performing an encryption computation for the first middle encryption/authentication value BVj of the j-th encryption/authentication path and the encryption kernel correspondingly, to generate a second middle encryption/authentication value FVj of the j-th encryption/authentication path;
providing a second encryption/authentication data GVj to the j-th path;
performing a second encryption/authentication logic computation for the second middle encryption/authentication value FVj of the j-th encryption/authentication path and the second encryption/authentication data GVj correspondingly, to generate a cipher text Cn+j;
receiving the cipher text Cn+j at a decryption end and performing a decryption process, the decryption process comprising following steps:
providing n decryption paths;
providing a first input decryption parameter Jt to a t-th path of the n decryption paths correspondingly, wherein 1≦t≦n;
performing a first decryption logic computation for the first input decryption parameter Jt of the t-th path correspondingly so as to generate a first middle decryption value Kt;
performing a decryption computation for the first middle decryption value Kt of the t-th path and a decryption kernel correspondingly, to generate a second middle decryption value Lt;
performing a second logic decryption computation for the second middle decryption value Lt of the t-th path and a second input decryption parameter Nt, to generate a decrypted binary plain text Mt′;
providing p decryption/authentication paths, wherein p is a positive integer;
providing a first decryption-authentication parameter JVj to a j-th decryption/authentication path of the p decryption/authentication paths correspondingly, wherein 1≦j≦p;
performing a first logic decryption/authentication computation for the first decryption-authentication parameter JVj of the j-th decryption/authentication path correspondingly so as to generate a first middle decryption/authentication value KVj;
performing a decryption computation for the first middle decryption value KVj of the j-th decryption/authentication path and the decryption kernel correspondingly so as to generate a second middle decryption/authentication value LVj of the j-th decryption/authentication path; and
performing a second logic decryption/authentication computation for the second middle decryption/authentication value LVj of the j-th decryption/authentication path and second decryption/authentication data NVj so as to generate a decryption/authentication plain text MVj.

2. The method for authenticated encryption and decryption of claim 1, wherein in the encryption process, r=0 and s=1,
the first input encryption parameter At of the t-th path of the n encryption paths further comprises a t-th output ctrt of a counter, 1≦t≦n,
the first encryption logic computation is an Exclusive OR logic computation which is performed for the first input encryption parameter At to generate the first middle encryption value Bt,
the encryption kernel is a block encryption EK controlled by a positive integer K,
the second input encryption parameter G1 of the first path of the n encryption paths is a first output ctr1 of the counter,
the second encryption logic computation is another Exclusive OR logic computation,
p=1,
the first encryption/authentication logic computation and the second encryption/authentication logic computation are an Exclusive OR logic computation correspondingly,
the first encryption/authentication parameter AVp is a default EV (Ending Vector) and a (n+1)-th output ctrn+1 of the counter,
the second encryption/authentication data GVp comprises the function f(Mn) with an input parameter of the binary plain text Mn,
wherein in the decryption process, s=1,
the first input decryption parameter J1 of the first path of the n decryption paths comprises the first output ctr1 of the counter,
the first input decryption parameter Jt+s comprises the function f(Mt′) with an input parameter of the decrypted binary plain text Mt′, 1≦t≦n,
the first decryption logic computation is an Exclusive OR logic computation and it is performed for the cipher text Ct and the first input decryption parameter Jt so as to generate the first middle decryption value Kt,
the decryption kernel is a block decryption DK controlled by a positive integer K,
the second logic decryption computation is an Exclusive OR logic computation,
the second input decryption parameter Nt of the t-th path of the n decryption paths is a t-th output ctrt of the counter,
p=1,
the first logic decryption/authentication computation is an Exclusive OR logic computation,
the cipher text Cn+p and the first decryption/authentication parameter JVp comprises the function f(Mn′) with an input parameter of the decrypted binary plain text Mn′ to perform the first logic decryption/authentication computation,
the second logic decryption/authentication computation is an Exclusive OR logic computation, and
the second decryption/authentication data NVp is a (n+p)-th output ctrn+p of the counter.

3. The method for authenticated encryption and decryption of claim 1, wherein in the encryption process, r=0 and s=1,
the first input encryption parameter At of the t-th path of the n encryption paths further comprises an incrementing function Δt, 1≦t≦n and Δ1≠Δ2≠ . . . ≠Δn,
the first encryption logic computation is an Exclusive OR logic computation and it is performed for the first input encryption parameter At so as to generate the first middle encryption value Bt,
the encryption kernel is a block encryption EK controlled by a positive integer K,
the second input encryption parameter G1 of the first path of the n encryption paths is the incrementing function Δ1,
the second encryption logic computation is an Exclusive OR logic computation,
the Exclusive OR logic computation is performed for the cipher text Ch and the incrementing function Δh so as to generate a cipher text Ch′, s<h≦n,
p=1,
the first encryption/authentication logic computation and the second encryption/authentication logic computation are an Exclusive OR logic computation correspondingly,
the first encryption/authentication parameter AVp comprises a default EV (Ending Vector) and the incrementing function Δn+p,
the second encryption/authentication data GVp comprises a function f(Mn) with an input parameter of the binary plain text Mn, and
an Exclusive OR logic computation is further performed for the cipher text Cn+p and an incrementing function Δn+p so as to generate a cipher text Cn+p′;
wherein in the decryption process, s=1,
the first input decryption parameter J1 of the first path of the n decryption paths comprises the incrementing function Δ1,
the first input decryption parameter Jt+s is a result of performing an Exclusive OR logic computation for the function f(Mt) with an input parameter of the binary plain text Mt and an incrementing function Δt+s, 1≦t≦n,
the first decryption logic computation is an Exclusive OR logic computation and it is performed for the cipher text Ct′ and the first input decryption parameter Jt so as to generate the first middle decryption value Kt,
the decryption kernel is a block decryption DK controlled by a positive integer K,
the second logic decryption computation is an Exclusive OR logic computation,
the second input decryption parameter Nt of the t-th path of the n decryption paths is the incrementing function Δt,
p=1,
the first logic decryption/authentication computation is an Exclusive OR logic computation,
the first decryption-authentication parameter JVp is a result of performing an Exclusive OR logic computation for the function f(Mn′) with an input parameter of the binary plain text Mn′ and the incrementing function Δn+p,
the second logic decryption/authentication computation is an Exclusive OR logic computation, and
the second decryption/authentication data NVp is the incrementing function Δn+p.

4. The method for authenticated encryption and decryption of claim 1, wherein in the encryption process, s=0, r=p, and 2≦p,
the first encryption logic computation is not provided to the top p paths of the n encryption paths,
in the last (n−p) paths of the n encryption paths and the p encryption/authentication paths, the first encryption logic computation and first encryption/authentication logic computation comprises an Exclusive OR logic computation,
the encryption kernel is a block encryption EK controlled by a positive integer K,
the second encryption logic computation of the n encryption paths comprises a computation of shift register and an Exclusive OR logic computation sequentially, the computation of shift register outputs an input value after shifting the input value by g bits, and g is a positive integer,
the second encryption logic computation of the p encryption paths comprises a computation of shift register, and the computation of shift register outputs an input value after shifting the input value by g bits,
from the first encryption path to the top p encryption paths, the first input encryption parameter Ac of a c-th path comprises a c-th output ctrc of the counter, 1≦c≦p,
the first input encryption parameter Ad of the d-th path of the last (n−p) encryption paths further comprises a d-th output ctrd of the counter, wherein p+1≦d≦n,
the first encryption/authentication parameter AVj of the p encryption/authentication paths comprises the function f(Mn+j−p) with the input parameter of the binary plain text Mn+j−p and the (n+j)-th output ctrn+j of the counter, wherein 1≦j≦p, and
the second encryption/authentication data GVj is not provided to the p encryption/authentication paths;
wherein, in the decryption process, s=0,
the first decryption logic computation is not provided to the top p paths of the n decryption paths,
in the last (n−p) paths of the n encryption paths and the p encryption/authentication paths, the first decryption logic computation and the first logic decryption/authentication computation comprises an Exclusive OR logic computation,
the decryption kernel is the block encryption EK, K is a positive integer,
the second logic decryption computation of the n decryption paths comprises a computation of shift register and an Exclusive OR logic computation sequentially, and the computation of shift register outputs an input value after shifting the input value by g bits,
the second logic decryption computation of the p encryption paths comprises a computation of shift register, and the computation of shift register outputs an input value after shifting the input value by g bits,
from the first decryption path to the top p decryption paths, the first input decryption parameter Jc of a c-th path comprises a c-th output ctrc of the counter, wherein 1≦c≦p,
the first input decryption parameter Jd of a d-th path in the last (n−p) decryption paths further comprises a d-th output ctrd of the counter and the function f(Md−p′) with an input parameter of the decrypted binary plain text Md−p′, wherein p+1≦d≦n,
the second input decryption parameter Nt of the n decryption paths is the cipher text Ct, 1≦t≦n,
the first decryption-authentication parameter JVj of the p decryption/authentication paths comprises the (n+j) output ctrn+j of the counter and the function f(Mn+j−p′) with an input parameter of the decrypted binary plain text Mn+j−p′, 1≦j≦p, and
the second decryption/authentication data NVj is not provided to the p decryption/authentication paths.

5. The method for authenticated encryption and decryption of claim 1, wherein in the encryption process, s=0, r=p, and 2≦p,
the first encryption logic computation is not provided to the top p paths of the n encryption paths,
in the last (n−p) paths of the n encryption paths and the p encryption/authentication paths, the first encryption logic computation and first encryption/authentication logic computation comprise an Exclusive OR logic computation,
the encryption kernel is a block encryption EK controlled by a positive integer K,
the second encryption logic computation of the n decryption paths comprises a computation of shift register and an Exclusive OR logic computation sequentially, wherein the computation of shift register outputs an input value after shifting g bits of the input value,
the second encryption/authentication logic computation of the p encryption/authentication paths comprises an Exclusive OR logic computation and a computation of shift register, wherein the computation of shift register outputs an input value after shifting the input value by g bits,
from the first encryption path to the top p encryption paths, the first input encryption parameter Ac of a c-th path comprises an incrementing function Δc, 1≦c≦p, and Δ1≠Δ2≠ . . . ≠Δp,
the first input encryption parameter Ad of a d-th encryption path within the last (n−p) encryption paths further comprises the incrementing function Δd, p+1≦d≦n, and Δp+1≠Δp+2≠ . . . ≠Δn,
an Exclusive OR logic computation is performed for the second middle encryption value Ft and an incrementing function Δt so as to generate another second middle encryption value Ft′, wherein Δ1≠Δ2≠ . . . ≠Δn,
the first encryption/authentication parameter AVj of the p encryption/authentication paths comprises the function f(Mn+j−p′) with the input parameter of the binary plain text Mn+j−p′ and the incrementing function Δn+j, wherein 1≦j≦p, and
the second encryption/authentication data GVj of the p encryption/authentication paths comprises an incrementing function Δn+j;
wherein in the decryption process, s=0,
the first decryption logic computation is not provided to the top p paths of the n decryption paths,
in the last (n−p) paths of the n encryption paths and the p encryption/authentication paths, the first decryption logic computation and the first logic decryption/authentication computation comprise an Exclusive OR logic computation,
the decryption kernel is the block encryption EK, K is a positive integer,
the second logic decryption computation of the n decryption paths comprises a computation of shift register and an Exclusive OR logic computation sequentially, wherein the computation of shift register outputs an input value after shifting g bits of the input value,
the second encryption/authentication logic computation of the p encryption/authentication paths comprises an Exclusive OR logic computation and a computation of shift register, wherein the computation of shift register outputs an input value after shifting the input value by g bits,
from the first decryption path to the top p decryption paths, the first input decryption parameter Jc of a c-th path comprises the incrementing function Δc, wherein 1≦c≦p,
the first input decryption parameter Jd of a d-th path in last (n−p) decryption paths further comprises the incrementing function Δd and the function f(Md−p′) with the input parameter of the decrypted binary plain text Md−p′, wherein p+1≦d≦n,
an Exclusive OR logic computation is performed for the second middle decryption value Lt and the incrementing function Δt so as to generate another second middle decryption value Lt′, 1≦t≦n,
the second input decryption parameter Nt of the n decryption paths comprises the cipher text Ct,
the first decryption-authentication parameter JVj of the p decryption/authentication paths comprises the incrementing function Δn+j and the function f(Mn+j−p′) with the input parameter of the decrypted binary plain text Mn+j−p′, wherein 1≦j≦p; and
the second decryption/authentication data NVj of the p decryption/authentication paths comprises an incrementing function Δn+j.