Algorithm 2: ECC with Hill Cipher |
Input: The image of size 256 ×256 to be encrypted or decrypted. |
Elliptic curve parameters: . |
Output: The corresponding cipher image or original image of size 256 × 256. |
1. Key Generation for ECC (The ECC keys are generated as shown in Section 3.1, Algorithm 1; |
2. Computing the self-invertible matrix |
(a) Compute: and ; |
(b) Compute: ; and ; |
(c) The self-invertible matrix is derived as:
|
where,
|
3. Encryption process: |
(a) Read the image to be encrypted and collect the image pixels separately for the |
channels R, G, and B. |
(b) Group every channel of pixels into 4 × 4 matrices and perform matrix multiplication |
with computed self-invertible matrix. |
(c) The encryption is done using the subsequent formula:
|
where, is the self-invertible matrix and is the current input image block to be encrypted; |
(d) Allocate the cipher pixels exactly to the same position as of the corresponding input |
image pixels. A cipher image is formed of size identical to the size of input image. |
(e) Send the cipher image and ECC public key to the receiver. The encryption process |
can be visualized as in Figure 1. |
4. Decryption process |
(a) Compute the shared secret key from the public key of sender as: |
|
(b) Compute the self-invertible matrix exactly as described above using the shared |
secret key. |
(c) Group the cipher pixels into matrices and perform matrix multiplication with |
self-invertible matrix from Step 2. |
(d) Allocate the plain text pixels to the same position as of the corresponding cipher |
pixels. The original image is formed back and retrieved as without any intensity loss. |