Picture arithmetic cryptosystem module explanation
a detailed module explanation of picture as a key.
lock-10 feature is been added. and ock-5 is been added.
a two-step encrytion technique is done in order to make a multiple encryption technique.
1. Final year project
PICTURE ARITHMETIC CRYPTOSYSTEM USING SYMMETRIC KEY
ENCRYPTION ALGORITHM WITH LEGITIMATE PICTURES.
Document explanation :
1. GENERATION OF PICTURE SORTING KEY:
On the receiver side, the picture sorting
key is generated from the secret code sent by the sender. To generate the picture
sorting key, LOCK-10(LOgical Crypto Key) operation is performed over the secret
code. LOCK-10 consists of ten different logical operations which can be done in
ten factorial (3628800) ways. The ten operations are
1. GCD (Greatest Common Divisor) of the digits
2. LCM (Least Common Multiple) of the digits
3. Sum of the digits
4. Product of the digits
5. Square of the number
6. Sum of square of digits
7. Product of square of digits
8. Sum of cube of digits
9. Product of cube of digits
10.Cube of the number
Let the secret code be 12345. Now the picture sorting key is generated as follows:
GCD of the digits (GCD (1,2,3,4,5) ) is 1.
LCM of the digits (LCM (1,2,3,4,5) ) is 60.
Sum of the digits (1+2+3+4+5) is 15.
Product of the digits (1*2*3*4*5) is 120.
Square of the number (123452) is 152399025.
Sum of square of digits (12+22+32+42+52) is 55.
Product of square of digits (12*22*32*42*52) is 14400.
Sum of cube of digits (13+23+33+43+53) is 225.
2. Product of cube of digits (13*23*33*43*53) is 1728000.
Cube of the number (123453) is 1881365963625.
Now the Picture sorting key can be produced in 3628800 ways (10 factorial).
Anyone of those ways is chosen at random to create the picture sorting key. E.g.
14400152399025115601881365963625225120551728000 is the new picture
sorting key generated in the order 7,5,1,3,2,10,8,4,6,9.
2. SORTING ‘N’ PICTURES:
The ‘N’ pictures in the folder are sorted using picture
sorting key (which is already generated from the secret key). We know that N
pictures can be sorted in ‘N’ factorial ways. Let the picture sorting key be
14400152399025115601881365963625225120551728000. Then the N pictures
are arranged in (14400152399025115601881365963625225120551728000 mod
‘N’ Factorial)th way in the folder. These ‘N’ pictures are sorted and pasted in a
folder by converting each picture into a BYTE array (byte []). Thus the ‘N’ pictures
are sorted in a new folder by using Picture Sorting key. Without knowing the exact
arrangement of pictures in folder, it will take a very long time for the hackers to
crack the key.
3. CONSTRUCTION OF 10X26 TABLE:
It is a table with 26 English alphabets (a-z) and
10 numbers (0-9). It is a 10x26 matrix where the 26 English alphabets are
arranged in different forms as 10 rows. This matrix is stored in a double
dimensional array. We have used four 10x26 matrices to encrypt the message
which are stored in four discrete 2d arrays. Any one of these 2d arrays is chosen
in random to encrypt the message which makes the task very hard for the hackers
to break our system.
A sample 10x26 matrix is shown below:
A B C D E F G H I J K L M N O P Q R S T U V W X Y
Z
0 j r z w y x f h a o m u p d g b e t v n q c i l s k
3. 1 d c t l r a w z j h v b k e s n i x g y o m p f u q
2 p l r x s f y j t c w k q e a v b i g d n m z u o h
3 v e j x r i n k w d u y s b p h o m a c l g f z t q
4 n v z o t i x q f h m b r c g y p a e j u d l w s k
5 a w e f u b r i m g t d c j p n v x o k q s l h z y
6 d b h r k a o z p g t v n u j y m f w q c i x e s l
7 n v z f h w b e l k d g x a m c r o j y s t i q u p
8 p j i n f y e d s l q t w c r x m z u o a b g k h v
9 c z n m k x p e a l w s d r t i f u g v q b h j o y
4. CONVERSION OF PICTURES TO KEY (1st key):
To get the pictures from the key PACK (Picture
Arithmetic Crypto Key) operation is performed over the pictures. N pictures are
spitted in six groups and each group is assigned with certain specific operations.
The first group is assigned with no-operation and so the key digit will be
taken as the position of the picture mod 10. E.g.: if the picture is in 12th
place of the first group then the key digit will be taken as 12%10=2.
The second group is assigned with the operation Addition. The mod
operation is performed with the position of the picture and the result is
added with the previous key digit. If the result of the add operation exceeds
9 then mod 10 operation is performed over the result.
The third group is assigned with the operation Subtraction. The mod
operation is performed with the position of the picture and the result is
subtracted from the previous key digit. If the result of the sub operation
takes a negative value then mod 10 operation is performed over the result.
The fourth group is assigned with the operation Multiplication. The mod
operation is performed with the position of the picture and the result is
multiplied with the previous key digit. If the result of the mul operation
exceeds 9 then mod 10 operation is performed over the result.
The fifth group is assigned with the operation Division. The mod operation
is performed with the position of the picture and the result is used to divide
4. the previous key digit. If the result of the div operation exceeds 9 then mod
10 operation is performed over the result.
The sixth group is assigned with the operation Mod. The mod operation is
performed with the position of the picture and the result is used to perform
mod operation with the previous key digit. If the result of the mod
operation exceeds 9 then mod 10 operation is performed over the result.
The above six operations are continuously applied to get the key from the
pictures. As a result of this process we get the first key. Since the key digits are
continuously changing with every picture, it will be a very tough task for the
hackers to know the key. We will send the picture-key part by part so if a cracker
is not aware of any one of this part then he cannot get even a part of the key.
5. GENERATION OF SECOND KEY:
The second key is generated from the first key by
performing LOCK-5(LOgical Crypto Key) operation. LOCK-5 consists of five
different operations. The five operations are
1. GCD (Greatest Common Divisor) of the digits
2. LCM (Least Common Multiple) of the digits
3. Sum of the digits
4. Product of the digits
5. Square of the number.
Let the 1st key be 12345. Now the second key is generated as follows:
GCD of the digits (1,2,3,4,5) is 1.
LCM of the digits (1,2,3,4,5) is 60.
Sum of the digits (1,2,3,4,5) is 15.
Product of the digits (1,2,3,4,5) is 120.
Square of the number (12345) is 152399025.
Now the second key can be produced in 120 ways (5 factorial). Anyone of those
ways is chosen at random to create the second key. E.g. 12015115239902560 is
the new second key generated in the order 4,3,1,5,2.
5. 6. ENCRYPTION WITH 1ST KEY USING VIGENERE CIPHER:
Encryption with Vigenere cipher is usually
performed by using the key as a string or a group of words. But here we are using
the numeric key to encrypt our message. Let the message be “hello world” and the
key be “454565”. Now encryption with vigenere cipher is done as follows:
The first character of the message is ‘h’ and it is shifted forward by 4 places
of English alphabets, since the first key digit is 4. Therefore, the first
character of the encrypted message is ‘l’.
The second character of the message is ‘e’ and it is shifted forward by 5
places of English alphabets, since the second key digit is 5. Therefore, the
second character of the encrypted message is ‘j’.
Similarly, we get the encrypted message as “ljpqu bswpi”.
Note: The encryption process follows round-robin fashion if the key reaches its
end.
7. ENCRYPTION WITH 2nd KEY USING 10x26 matrix:
Let the message be “hello world” and
the key be 324345. Now the encryption procedure is as follows:
The first letter of the message is ’h’ and first digit of the key is 3. In the
above matrix, the row 3 (i.e., 4th row) corresponding to column H has the
alphabet ‘k’. Therefore the first letter of the encrypted message is ‘k’.
The second letter of the message is ’e’ and first digit of the key is 2. In the
above matrix, the row 2 (i.e., 3rd row) corresponding to column E has the
alphabet ‘s’. Therefore the second letter of the encrypted message is ‘s’.
Similarly, for the message “hello world” we get the encrypted message as “ksbyg
lpibx”.
Note: The encryption process follows round-robin fashion if the key reaches its
end.
8. DECRYPTION WITH SECOND KEY USING 10x26 MATRIX:
6. The decryption process using 10x26 matrix
is just the reverse process of encryption. Let the encrypted message be “ksbyg
lpibx” and the key be 324345. Now the decryption procedure is as follows:
The first letter of the encrypted message is ’k’ and first digit of the key is 3.
In the above matrix, the row 3 (i.e., 4th row) corresponding to column H has
the alphabet ‘k’. Therefore the first letter of the decrypted message is ‘h’.
The second letter of the encrypted message is ’s’ and first digit of the key is
2. In the above matrix, the row 2 (i.e., 3rd row) corresponding to column E
has the alphabet ‘s’. Therefore the second letter of the decrypted message
is ‘s’.
Similarly, for the encrypted message “ksbyg lpibx” we get the decrypted message
as “hello world”.
Note: The decryption process follows round-robin fashion if the key reaches its
end.
9. DECRYPTION WITH 1ST KEY USING VIGENERE CIPHER:
The decryption process using vigenere
cipher is just the reverse process of encryption. Let the encrypted message be
“ljpqu bswpi” and the key be “454565”. Now decryption with vigenere cipher is
done as follows:
The first character of the message is ‘l’ and it is shifted backward by 4
places of English alphabets, since the first key digit is 4. Therefore, the first
character of the decrypted message is ‘h’.
The second character of the encrypted message is ‘j’ and it is shifted
backward by 5 places of English alphabets, since the second key digit is 5.
Therefore, the second character of the decrypted message is ‘e’.
Similarly, we get the decrypted message as “hello world”.
Note: The decryption process follows round-robin fashion if the key reaches its
end.