In this research a proposed algorithm to generate secret keys was accomplished, the proposed key generation algorithm will be called (Roty_Shift algorithm) and it will generate a series (list) of subkeys may be used for data encryption. Roty_Shift needs two secret seeds as secret keys, seed1 will be generated by true random number generator (TRNG) while seed1and seed2 will be used in pseudorandom number generator (PRNG), also this research utilizes the mechanism of the key derivation function (KDF) to generate the subkeys, on other hand Roty_Shift can be considered as PRNG. The proposed algorithm consists of five levels, and according to these five levels the subkeys will be generated and the size of each one is (N*N), each one of these subkeys is possible to use it in any encryption strategy of block cipher type. The proposed algorithm (Roty_Shift) was tested using different key sizes and obtained good results. In this research, the proposed algorithm proved the concept of diffusion on the key itself. Also according to some tests with 256 bits key and 5000 iteration there is no repetition in the generated subkeys, but in small key size a problem of repetition will be encountered.
Roty_Shift: A Proposed Method for Generating Secret Keys
1. Roty_Shift: a Proposed Method for
Generating Secret Keys
Qusay Mohammed Jafar
Department of Computer Communication Engineering – AL-Rafidain University College
Iraq-Baghdad
qusay_mj@coalrafidain.edu.iq
Abstract:-
In this research a proposed algorithm to generate secret keys was accomplished, the
proposed key generation algorithm will be called (Roty_Shift algorithm) and it will
generate a series (list) of subkeys may be used for data encryption. Roty_Shift needs two
secret seeds as secret keys, seed1 will be generated by true random number generator
(TRNG) while seed1and seed2 will be used in pseudorandom number generator (PRNG),
also this research utilizes the mechanism of the key derivation function (KDF) to
generate the subkeys, on other hand Roty_Shift can be considered as PRNG. The
proposed algorithm consists of five levels, and according to these five levels the subkeys
will be generated and the size of each one is (N*N), each one of these subkeys is possible
to use it in any encryption strategy of block cipher type. The proposed algorithm
(Roty_Shift) was tested using different key sizes and obtained good results. In this
research, the proposed algorithm proved the concept of diffusion on the key itself. Also
according to some tests with 256 bits key and 5000 iteration there is no repetition in the
generated subkeys, but in small key size a problem of repetition will be encountered.
Keywords:-
Secret keys, Seed, Subkeys generation, TRNG, PRNG, KDF, Rotation, Shift, Five
Levels, Diffusion, and Encryption.
1- Introduction
Encryption is used to protect data that belong to a level of sensitivity, there are two
main parameters in the encryption: the encryption algorithm and the secret key [1]. This
research focused on the secret key(s) generation. There are two strategies of encryption:
Symmetric and Asymmetric, in the symmetric encryption there is one key for encryption
and decryption, whereas in the asymmetric encryption there are two keys; the first for
encryption (public key) and the second for decryption (private key) [2].
The proposed secret key generation algorithm in this research work is suitable for
symmetric encryption. Also this research solves the problem of selecting the keys for the
encryption process, and the aim is for generating a series of secret keys without applying
the encryption process itself.
2- Key Generation
The procedure of the key management must to be in secure form; because of without
security in the key management the benefits of any level of encryption will be not useful.
In firm institutions there is a life cycle for the key, the key lifecycle is as follow: key
International Journal of Computer Science and Information Security (IJCSIS),
Vol. 15, No. 8, August 2017
40 https://sites.google.com/site/ijcsis/
ISSN 1947-5500
2. generation, key establishment, key storage, key usage, key distortion, key change, and
back to key generation and so on [3]. “Key generation is the process of generating keys for
cryptography”[1]. This research focused on the key generation to generate a series of
subkeys of size n bits.
To increase the complexity and difficulty of the cryptanalysis the algorithm of the
subkey generation must be complex [4].
There are three types of random key generation (True Random Number Generators
(TRNG), Pseudo Random Number Generators (PRNG), and Cryptographically Secure
Pseudorandom Number Generators (CSPRNG)) [5], and each one of these three types
needs a seed to complete its function. TRNG needs a nondeterministic source to generate
the random numbers, whereas PRNG is a deterministic algorithm to produce sequences
of random numbers, if the algorithm is excellent, the sequence of the random numbers
will pass the tests of good randomness [4].
According to our works in this research the Roty_Shift will needs two primary secret
keys (KEY1, KEY2), to make KEY1 as true random number generator (TRNG) we need
a strategy to select KEY1 randomly, so that; the seed generation (seed1) of the KEY1 is
as follow: suppose the key size is 256 bit (32 bytes), it is possible to go out to the high
way and monitor the street at 7:13 AM and capture the cars plate numbers for 64
consecutive cars one after the other and apply the following procedure:-
For car=0 to 63
KEY1[car]=CarPlateNo[car] MOD 16
Next car
The loop in the above will create an array of 64 hexadecimal digits and then rearrange
the KEY1 as a two dimension array of binary data. This procedure with assuming the key
size is 256 bits. This mechanism will give a randomness of type TRNG to generate the
secret key (seed1). The proposed procedure in the above is possible to make it as
automated by using some equipment (camera with image processing) with secure timing.
KEY1 in the proposed method will be called (TKEY), while KEY2 will be called
(InitiKEY).
PRNG needs a seed to generate sequences of random number [5]. It is possible to
follow the manner in [5] with some modification to generate random numbers (secret
keys) as shown below:-
z= input(“enter how many number of subkeys you like to generate”)
i = 0
Si= seed1, (and seed2)
loop
Si+1 = f (Si)
i=i+1
Until ((i=z) or (end of the plaintext))
In this research and as shown in the procedure above, we mixed seed1 and seed2 to
complete the task of the PRNG. f is a function (algorithm) its input is the initiate seeds
and the output of the previous step to produce a new secret key linearly. In this research
we applied the PRNG concept to generate a series of secret keys, whereas the proposed
algorithm (Roty_Shift) represents the (f), and according to this tacit concept of the TRNG
and PRNG this research applied the TRNG and PRNG to generate a series of random
secret keys.
International Journal of Computer Science and Information Security (IJCSIS),
Vol. 15, No. 8, Augus 2017
41 https://sites.google.com/site/ijcsis/
ISSN 1947-5500
3. KEY1
KEY2
Roty_Shift proposed
method
Generating a series of secret subkeys
Figure (1) First view of the proposed keys generation method
3- Key Derivation Function (KDF)
Key distribution in one of its concepts deal with the mechanism of exchanging the key
between the sender and the receiver in a manner that not make any threat on the
generated keys [6]. There are two procedures to establishment the keys between parties
(key transport and key agreement), key transport used for generating the key and
distribute this key to other parties, whereas key agreement used for generating the secret
key in a manner of joint [5] where each party have its parameter.
Key Derivation Function needs two parameters the first is not secret parameter (NSP),
it is shared between the two parties, the second is secret parameter as a secret key (SKey),
it is keep secret between the two parties (sender and receiver), these two parameters will
be as input to the function to generate the secret key (Ksec), and then it will be used for
encryption and decryption if the encryption is in mode of symmetric [5].
In this research we try to utilize the concept of the KDF to generate the secret keys but
in manner differ in its essence; instead of making NSP not secret we make it secret with
name KEY1 and it is shared between the sender and the receiver, where the sender will
send this key frequently to the receiver using a secure channel, KEY1 needs to
communicate between sender and receiver each time when the coordinator decide to
update KEY1. KEY2 will be secret also but it is not need to exchange between sender
and receiver each time. There are two secret keys and this will give more security to the
key management and key generation, for example if we assume KEY1 will be updated
every week and KEY2 will be updated every year using a very secure channel for keys
transportation. In this research the function that will exploit these two keys is the
proposed key generation method (Roty_shift). Figure (1) shows an overview of the
proposed key generation method.
4- Previous works:-
The researchers in [7] proposed a novel method for image encryption using dynamic
secret key generation, where they are used the sunflower to create a random seed with the
piecewise chaotic map methods and then applied the encryption algorithm.
The researchers in [8] proposed a new method for generating secret keys using the
memristor device, whereas the master key is the initial profile of the memristor, and the
session keys will be generated using the master key and other parameters that can be
extracted from the memristor itself.
The researchers in [9] proposed a mechanism for key generation using the genetic
algorithm, they used the random function to generate the initial population of 128 bits,
and then by a fitness function to select individuals of maximum fitness for next
processing. According to this it must to select the best two individuals and then apply the
International Journal of Computer Science and Information Security (IJCSIS),
Vol. 15, No. 8, Augus 2017
42 https://sites.google.com/site/ijcsis/
ISSN 1947-5500
4. one point crossover to produce the random number, and then a children and again fitness
function and so on, and then a mutation to get the key.
The researcher in [10] gave an overview about the random number generator (methods,
applications, theoretical concepts, practical implementation, studying three mechanisms
of random number generating, comparisons, probabilities, and statistics).
5- The proposed method (Roty_Shift)
The aim of the proposed method is to design and implement a system to generate a
series of secret keys in attempt to apply the concept of the PRNG with two secret seeds,
the first seed will be called as TKEY, this seed will be selected randomly according to
TRNG mechanism, and it will be selected as shown above in section 2, whereas the
second seed will be called as InitiKEY to be as an initial secret key, TKEY and InitiKEY
will be two arrays of size (N*N) of binary values, the keys in the proposed algorithm will
need to be of two dimensions array because there is a level of rotation process as shown
in the next sections. The seed (InitiKEY) will be selected according to agreement
between the two parties (sender and receiver), of course the TKEY and InitiKEY will be
secret, and by these two seeds (keys) it is possible to apply the KDF, and the function
itself will consider the proposed algorithm (Roty_Shift algorithm).
After detecting (selecting) the two secret seeds (TKEY, InitiKEY), these two seeds
will be the inputs to the Roty_Shift algorithm.
TKEY aims to increase the secrecy of the generated keys; TKEY will be XORed with
the primary generated key (PKEYi) to produce a new GenKEYi, i=0,1,2…M, M is the
number of the generated subkeys or the number of the blocks in the plain text, the block
size of the plain text is equal to the array size of the InitiKey and TKEY. The XOR
operation will be done after the InitiKEY process by the Roty_Shift algorithm to produce
the GenKEY and the XOR operation will be applied between TKEY and PKEYi in each
iteration of the Roty_Shift. TKEY itself will be modified in each iteration of the
Roty_Shift algorithm by shifting process to produce a new linear TKEY. Roty_Shift will
be repeated many times (1..M) to generates a list of GenKEYs (subkeys) ready for
encryption operation.
To generate a list of GenKEYs, in each iteration of the Roty_Shift algorithm there are
five levels (stages) as shown in the following:-
The first level (Rotate Columns by Rows Values (RCRV level)):-
As shown in the above the TKEY and InitiKEY will be arrays of two dimensions of
size (N*N) of binary values, in this level each column of the InitiKEY it will be rotated
down by the decimal value of the bits in each row after grouping them (row bits)
according to the row number that is equivalent to the column number (t=0, Rotate
Columnt by the value of the rowt, t=t+1), figure (2) in below shows an example of the
RCRV with assuming the secret key size (InitiKEY) is 4*4 (16 bits), the keys size (the
two dimension array) in the proposed method is optional and in form of square array.
There is a direct correlation between the key size and execution time of the program. In
the Roty_Shift program we tested three types (sizes) of the key (4*4 (16 bits), 6*6 (36
bits) and 16*16 (256 bits)). The output of the first level is called RCRV_KEYi, and it will
be the input to the next level (XX level).
In some methods of key generation the generated key called as subkey, so that the
GenKEY is the subkey that will be ready to be used in encryption.
International Journal of Computer Science and Information Security (IJCSIS),
Vol. 15, No. 8, Augus 2017
43 https://sites.google.com/site/ijcsis/
ISSN 1947-5500
5. Note:- After finishing the iteration (i) of the Roty_Shift, the InitiKEY will be
GenKEYi and the Roty_Shift will take GenKEYi as a new input (new InitiKEY) to
generate GenKEYi+1, and so on.
InitiKEYi The first level RCRV_KEYi
The second level (XOR-XNOR (XX level))
The output of the first level will be the input to the second level, in this level the
variable RCRV_KEYi will be modified to produce XX_KEYi through a process of
applying (XOR) or (XNOR) operations by detecting the decimal value of each row in
RCRV_KEY. Let no1 contains the value of the Rowr, and no2 contains the value of the
Rowr+1, r=0...(Nr-1), Nr is the number of rows in RCRV_KEY, and then it must to
examine the value of no1, if it is even (no1 MOD 2=0) the operation (XOR) will be
implemented between no1 and no2, otherwise (no1 MOD 2=1) the operation (XNOR) will
be implemented between no1 and no2. The result of the logical operation will be assigned
in Rowr+1, and so on for the next row, whereas the last row (RowNr-1) will be processed
with Row0 and the result will be assigned in Row0. In briefly; (XX) level is responsible
for the task of:- The bits of each row will be (XORed or XNORed) with the next row
after detecting the decimal values of the Rowr. After finishing the (XX) level the
XX_KEYi will be ready for the third level. Figure (3) shows an example of the (XX
level). The output of this level will be an input to the third level (ROTAT level).
-Rotate column0 down by the value
of the Row0 = (0110)b = 6 steps.
-Rotate column1 down by the value
of the Row1 = (1101)b = 13 steps.
-Rotate column2 down by the value
of the Row2 = (0101)b = 5 steps.
-Rotate column3 down by the value
of the Row3 = (1110)b = 14 steps.
0 1 1 0
1 1 0 1
0 1 0 1
1 1 1 0
0 1 1 1
1 1 1 0
0 1 0 0
1 1 0 1
Figure(2): An example to explain the first level (RCRV)
0 1 1 1
1 1 1 0
0 1 0 0
1 1 0 1
Row0=7
7 MOD 2=1 (odd)
XX_Row1=Row0 XNOR Row1=0110
Row1=14
14 MOD 2=0 (even)
XX_Row2= Row1 XOR Row2=1010
Row2=4
4 MOD 2=0 (even)
XX_Row3= Row2 XOR Row3=1001
Row3=13
13 MOD 2=1 (odd)
XX_Row0= Row0 XNOR Row3=0101
0 1 0 1
0 1 1 0
1 0 1 0
1 0 0 1
RCRV_KEYi XX_KEYi
The second level
Figure (3): An example to explain the second level (XX level)
International Journal of Computer Science and Information Security (IJCSIS),
Vol. 15, No. 8, Augus 2017
44 https://sites.google.com/site/ijcsis/
ISSN 1947-5500
6. The third level (Rotate level)
In this level the rotation operation will be accomplished to generate (RotateKEYi), the
output of the second level will be processed by a rotation operation according to the
summation of the binary values of each row with the next rows to get a decimal value
(Sum), and then the Sum will be modulated by four to obtain a value ranging between
(0..3), 0 to rotate the XX_KEYi by 0 degree, 1 to rotate the XX_KEYi by 90 degrees to
the right, 2 to rotate the XX_KEYi by 180 degrees to the right, 3 to rotate the XX_KEYi
by 270 to the right. In this level the XX_KEYi will be treated as an image to make the
idea a closer. After applying the Rotate level of course the values of the (RotateKEYi)
keeps its values as binary. Figure (4) shows an example of the (Rotate) level.
Figure (4) An example to explain the third level (Rotate level)
The fourth level (One Bit Mutation (OBM level))
After testing the proposed algorithm (Roty_Shift) a problem of some repetitions in the
generated keys was encountered, and this led us to propose this level to perfection the job
of the Rroty_Shift, so that it is possible to consider this level as an intermediate level to
increase the entropy and the confusion after applying any encryption method.
OBM make one bit of the (RotateKEYi) to be complemented (01)(10) in each
iteration of the (Roty_Shift). Note:- in each iteration of the Roty_Shift proposed
algorithm there is one secret generated key (secret sukey), Roty_Shift will be looped to
generate a list of M subkeys according to the number of blocks in the plain text and there
is a conforming between the block size and the secret keys size.
The output of the OBM level is (OBM_KEYi). Figure (5) shows an example of the
OBM level for (OBM_R=0, OBM_C=0) (the first iteration only (i=0)):-
Figure (5) An example to explain the fourth level (OBM level)
0 1 0 1
0 1 1 0
1 0 1 0
1 0 0 1
Degree=Sum MOD 4 30 MOD 4= 2
Therefor rotate the XX_KEYi into a
180 degree angle to generate the
RotateKEYi
First row (0101)=5
+
Second row (0110)=6
+
Third row (1010)=10
+
Fourth row (1001)=9
Sum=30
1 0 0 1
0 1 0 1
0 1 1 0
1 0 1 0
1 0 0 1
0 1 0 1
0 1 1 0
1 0 1 0
0 0 0 1
0 1 0 1
0 1 1 0
1 0 1 0
The Fourth Level (OBM)
RotateKEYi=0(0,0)=1 RotateKEYi=0(0,0)=0
OBM_KEYi=0 = RotateKEYi=0
XX_KEYi
RotateKEYi
RotateKEYi OBM_KEYi
International Journal of Computer Science and Information Security (IJCSIS),
Vol. 15, No. 8, Augus 2017
45 https://sites.google.com/site/ijcsis/
ISSN 1947-5500
7. In the next iteration (i=1) this level will modify (make a mutation) on the
RotateKEYi=1(1,0) and so on for the next iteration (i=2) on the RotateKEYi=2(2,0), and so
on. The mechanism of this level will be explained in more details in the section 5 (the
algorithm)
The fifth level (XORing between OBM_KEYi and TKEY with shift (XS level))
In this level the role of the TKEY will be started to make its action on the Roty_Shift
proposed algorithm. TKEY itself is generated by the TRNG. X refers to XOR logical
operation, while S refers to shift operation on the TKEY by one location to the left in
each iteration of the Roty_Shift proposed algorithm. This level will complete the KDF by
corresponding the TKEY as a first key, while InitiKEYi after four levels to produce
OBM_KEYi as a second key. Figure (6) shows an example of the XS level.
OBM_KEYi=0 TKEYi=0 GenKEYi=0
Figure (6) An example to explain the fifth level (XS level)
After applying this level the output will be GenKEYi that will be saved in a file for
preparing a list of secret generated subkeys, or it is used directly by the encryption
process. Before finishing the iteration i=0 a shift operation on the TKEYi=0 will be
applied to produce TKEYi=1 that it will be used by the iteration i=1, and so on for each
iteration as shown in figure (7).
TKEYi=1 used with the next iteration (i=1) of the Roty_Shift
Figure (7) the shift operation on the TKEY
1 1 0 1
1 1 1 1
1 0 1 1
1 0 0 1
1 1 0 0
1 0 1 0
1 1 0 1
0 0 1 1
0 0 0 1
0 1 0 1
0 1 1 0
1 0 1 0
1 1 0 1
1 1 1 1
1 0 1 1
1 0 0 1
1 1 0 1 1 1 1 1 1 0 1 1 1 0 0 1
1 0 1 1 1 1 1 1 0 1 1 1 0 0 1 1
1 0 1 1
1 1 1 1
0 1 1 1
0 0 1 1
TKEYi=0 as a one dimension array
TKEYi=0 as a one dimension array after one bit shift to left
TKEYi=0
International Journal of Computer Science and Information Security (IJCSIS),
Vol. 15, No. 8, Augus 2017
46 https://sites.google.com/site/ijcsis/
ISSN 1947-5500
8. In some cases the shift operation that was accomplished as shown in figure (7) is called
rotation but we used shift expression to distinguish between the operation that was
applied with rotate level and the operation that was applied on TKEY in the fifth level.
In the second iteration of the Roty_Shift i will be 1, in the third iteration i will be 2,
and so on. Figure (8) summarize the Roty_Shift proposed method.
Figure (8) Block diagram of the Roty_Shift proposed method.
TKEYi=0: generated by
proposed true random
number generation (Car
Plate No.)
InitiKEYi=0: selected
by authorized person
Level 1
(RCRV level)
Level 2
(XX level)
Level 3
(Rotate level)
Level 4
(OBM level)
Level 5
(XS level)
SubKeyi
i=i+1
Shift TKEYi
one location
to left
Save SubKeyi
to a list
Until i=M
International Journal of Computer Science and Information Security (IJCSIS),
Vol. 15, No. 8, Augus 2017
47 https://sites.google.com/site/ijcsis/
ISSN 1947-5500
9. 6- Roty_Shift Algorithm
Steps in below shows the proposed algorithm for secret keys generation (Roty_Shift
algorithm):-
INPUT:- InitiKEY seed array of size (N*N) bits, TKEY seed array of size (N*N) bits,
and M, where M is the number of blocks in the plain text or input directly by
the user.
OUTPUT:- Series of generated secret keys (GenKEYi), i=0,1,2,…M
1- Start
2- Initializations:- InitiKEY0 = InitiKEY seed; OBM_R=0; OBM_C=0;k=0;
3- Loop i=0 to M
4- The first level (RCRV level):- its input is the two dimensions array (InitiKEYi), its
output is the two dimensions array (RCRV_KEYi).
4-1 Grouping the binary bits of each row of the InitiKEYi and convert them to decimal
value (R_value), where R_value between (0...2N
-1), and then apply the rotation
process on each equivalent column by R_value as follow:-
Rotate the bits of the columnc by (R_value), where (R_value) is the value of the
Rowr , c=r, r=0…N-1.
4-2 Save the result of the step 4-1 in a variable of two dimension array (RCRV_KEYi)
5- The second level (XX level):- its input is the two dimensions array (RCRV_KEYi), its
output is the two dimensions array (XX_KEYi).
5-1 Loop Rn=0 to N-1 Rn is the row number in RCRV_KEYi
IF Rn != N-1 then
No1= decimal value of the binary bits of the rowRn
No2= decimal value of the binary bits of the rowRn+1
IF No1 MOD 2=0 then
XX_Row= No1 XOR No2
ELSE
XX_Row= No1 XNOR No2
END IF
The rowRn+1 of the XX_KEYi=XX_Row (each bit in one cell)
ELSE IF
No1= decimal value of the binary bits of the row0
No2= decimal value of the binary bits of the rowN-1
IF No1 MOD 2=0 then
XX_Row= No1 XOR No2
ELSE
XX_Row= No1 XNOR No2
END IF
The row0 of the XX_KEYi=XX_ROW (each bit in one cell)
END IF
5-2 Next Rn
6- The third level (Rotate level):- its input is the two dimensions array (XX_KEYi), its
output is the two dimensions array (RotateKEYi)
6-1 sum=0
6-2 Loop For r=0 to N-1 (N is the number of rows in XX_KEYi, while r will
represent the row number in XX_KEYi)
International Journal of Computer Science and Information Security (IJCSIS),
Vol. 15, No. 8, Augus 2017
48 https://sites.google.com/site/ijcsis/
ISSN 1947-5500
10. Convert the group of bits in rowr of the XX_KEYi to decimal value (RowVal)
sum=sum+ RowVal
Next r
6-3 Make the rotation process on XX_KEYi as follow:-
IF sum MOD 4=0 then
Rotate XX_KEYi clockwise by 0 degree
RotateKEYi= XX_KEYi
Else IF sum MOD 4=1 then
Rotate XX_KEYi clockwise by 90 degree
RotateKEYi= XX_KEYi
Else IF sum MOD 4=2 then
Rotate XX_KEYi clockwise by 180 degree
RotateKEYi= XX_KEYi
Else IF sum MOD 4=3 then
Rotate XX_KEYi clockwise by 270 degree
RotateKEYi= XX_KEYi
END IF
7- The fourth level (OBM):- its input is the two dimensions array (RotateKEYi), its
output is the two dimensions array (OBM_KEYi):-
IF RotateKEYi [OBM_R,OBM_C]=”0” THEN
RotateKEYi [OBM_R,OBM_C]=”1”;
ELSE
RotateKEYi [OBM_R,OBM_C]=”0”;
END IF
OBM_C= OBM_C+1;
IF OBM_C= N THEN
OBM_C=0;
OBM_R= OBM_R+1;
IF OBM_R=N THEN
OBM_R=0;
END IF
END IF
OBM_KEYi= RotateKEYi;
8- The fifth level (XS level):- its input is the two dimensions array (OBM_KEYi), its
output is the two dimensions array (GenKEYi):-
8-1 Apply the XOR operation between OBM_KEYi and TKEY bit by bit to generate
the secret key (GenKEYi).
8-2 Apply the shift operation on the TKEY to generate the new TKEY.
To explain this level follows the following:-
For a = 0 To N-1
For b = 0 To N-1
GenKEYi[a, b] = (OBM_KEYi[a, b]) XOR (TKEY[a, b])
Shiftarray[k] = TKEY[a, b]
k = k + 1
Next b
Next a
International Journal of Computer Science and Information Security (IJCSIS),
Vol. 15, No. 8, Augus 2017
49 https://sites.google.com/site/ijcsis/
ISSN 1947-5500
11. k = 0
To shift TKEY one location to the left:-
temp = shiftarray[0]
For d = 0 To ((N*N)-2)
Shiftarray[d] = shiftarray[d + 1]
Next d
shiftarray((N*N)-1) = temp
For a = 0 To N-1
For b = 0 To N-1
TKEY[a, b] = shiftarray[k]
k = k + 1
Next b
Next a
k = 0
9- Save GenKEYi (the new generated subkey) in a file as string of hexadecimal values for
using later or apply any encryption method directly with this generated secret subkey.
10- Go to step 3 (Next i).
11- End algorithm
7-The Experimental Results:-
In below will show some results of applying the Roty_Shift algorithm:-
The proposed algorithm accepts any key size, and for testing let the key size is 256 bits
(16*16), and after applying this proposed algorithm there is a list of M secret subkeys.
Table 1 shows a list of 40 secret generated subkeys without any repetition, and each one
of these subkeys is considered as a PRNG.
Let InitiKEY and TKEY as follow:-
InitiKEY:- (E78102DA3C917CBCEA370AEF4390CAF62782A1DFC65290ABCE4D7143A8327D4A)h
TKEY:- (857369A3AC754457F495BCA9A6AE1DDBFDD3EEABA6AA55539CD3EEABA6AA5553)h
Table 1: Generating 40 secret subkeys of size 256 bits (64 digits in hexadecimal)
E78102DA3C917CBCEA370AEF4390CAF62782A1DFC65290ABCE4D7143A8327D4A
B165EDDB4EFF694C403975C8B98FFFECD647109D30D7DCE98B4E5AB91B4162E2
F05BE7E7CBC136387F5B92F64732EF40DF826318149D3CCCC0DD099F487817FA
C5FA23D7372CE2668E26D0F033142AA5538BDB18C8F44B718F8125CF80083941
F278169EBBB2AFD9AED253651542B154221CEF448D2B6CC8402BAD45F489ED0F
0D34F589C1E6E2DE75E963448BEE9A550480EE1AE53B000FD8DE87DA67521572
B821178362B53ED1F821C23D16CDF393FC121B86E1A583240E54AD43FA8F9838
7825B9DEE8868ED2CCE4FAC70894DB340F3D382C0B994D7C40250145C61E2B85
D491DFC9CC7166EC3A7BD8A770FBC662FA733636A3117CCC4145FEBCED5B8DF4
63A62E53027DE52DDC72275019AC4AA22967264BC524200E48A3374855E4A18D
48320EC6D1E51F35466E5DFC6EDEADEDA2B6260115CF8783FCD321932D38227F
D93A17F1E3BD6FDD9430F61FE1E347B57BCF6B0834506D329FB77BF7EBCD733D
2726EDC8A54165442330BD9BCBA88341BD1967EDFBBF279A48299BC507A54216
6E323746A4F95B7CD659C69041DD0DCFA1DD244A8A78A871A2CE2766E4E5BD4D
05724C9DD6C0D189AC420208F8C1399CF2E0CD97C656E1433B8CD4315BA0E369
F0C3B20134AF10AE0E44C5FC88DD4C0F801B6A41A37C31BBBA1B540FEDCEF408
184E32C9F3B6D977B0280FFB90E870BE1D24732C1F92F01F4B916ADFE58EBB8C
AAA7005F9C09C30CCC7FABF4D9D1426E5356F6890FE3F7DD7747DCB10167A5B0
6C96C270B15AD15433AC923D86845E4289C09DE9385B3EF8F34D62C833FD011B
B93F7E83C04F0C5E931163E19E2D32E80B96BE8C1B513C35C11C2651B05C3663
International Journal of Computer Science and Information Security (IJCSIS),
Vol. 15, No. 8, Augus 2017
50 https://sites.google.com/site/ijcsis/
ISSN 1947-5500
15. 999C9ED567BD9CDE691CCEFE15275C40265A7A2A2D39582192882A4E6104EC5F
74A5A433BC4EF8DF2DDFA89E91CC280F8A9796F1A7BD5B5D36A72CEAAD457D0A
95ABB0565B866F30F2B322F8BF915D52A5A43C4F428F737861AB703323DAB716
64138D39D94C4FB896B3925CE40BE9DEAB54C9E88347B0FD44DECA6FCA4D209C
97D668C0C87C31819A5FEC7E0871ED323F6A10FC395C6197B21BC26E6C47AC7F
6CDC32225A01103FCDB683D7E4FD95627F15C859BBB58A59ABC15E6B3BBABF6B
60124D54C62AAE191ED285F15C2F8AEFC380DB9B161364822797CB63C5F6C505
4A5244116226BF7112F99DC978E1456C6345A4DD565424B4290D9BF65EFDD289
7D08F9FCC4904DE545750B499F9137F8281EA07BA255C34E94448699960BA067
3D4DE39866D0C569DA910C8FA88CA0C735ABAF0C159A378C6F428C7FC8FB13B8
2F00F411BF4D9E09EE49A874681E93A9B2D0E8858DD5812CD7BED56A33CCEF76
If we change the bit 40 in the InitiKEY this will not make any changing on the list of
the subkeys if we compare them with table (1), but if we change the bit 41 the changing
will begin from the subkey number 6, also if we change the bit 42 the changing will begin
from the subkey number 6.
If we change the bits 3 and 20 simultaneous on the InitiKey this will not make any
changing on the series of the subkeys if they are compared with table 1, this test decrease
the chance of diffusion.
If we change the bits 17 or 18 on the TKEY the action of changing on the series of the
subkeys will begin from the subkey number 4 and forth if they are compared with table 1.
Any way according to the tests in the above with changing only one bit on TKEY or
InitiKEY we conclude the subkeys will be different from the subkey number 6 and forth,
so that the Roty_Shift proved the concept of the diffusion. Also there is no repetition so
that there are M unique secret subkeys using Roty_Shift with any TKEY and InitiKEY,
with some tests the system generated 5000 subkeys of size 256 bits and all of them were
unique. The role of TKEY is more effect to give a fully diffusion than InitiKEY, so that
Roty_Shift with InitiKEY is partially diffusion, while with TKEY is fully diffusion.
8- Conclusions:-
After preparing and testing Roty_Shift as a proposed algorithm is possible to conclude
the following:-
1- Roty_Shift is good proposed method for generating a series of subkeys using two
seeds; so that, it is possible to consider it as a KDF where the first seed is the first
secret key, while the second seed is the second secret key.
2- This research applied the TRNG using the car plate number to give the first seed.
3- Roty_Shift algorithm applied the PRNG principle using the two seeds of n bits, the
first seed selected randomly by the TRNG concept, while the second seed selected by
the authorized person.
4- Roty_Shift proposed algorithm mixed the TRNG and PRNG to generate a series of
subkeys.
5- Multi levels in Roty_Shift algorithm to increase the complexity of the subkeys
generation process to create strong subkeys.
6- This research depends on the concept of rotation with other process to get a series of
secret subkeys.
7- There are M unique subkeys generated by the Roty_Shift, this research tested with 16,
36, and 256 bits key size, and we concluded; if we maximize the key size then the
probability of uniqueness will be greater (series of M unique subkeys).
International Journal of Computer Science and Information Security (IJCSIS),
Vol. 15, No. 8, Augus 2017
54 https://sites.google.com/site/ijcsis/
ISSN 1947-5500
16. 8- Roty_Shift method it near to be as fully diffusion (for the generated subkeys).
9-In diffusion the TKEY (seed1) is more effect than InitiKEY (seed2).
10-This research gives a chance for the researchers for more testing and may modify and
apply it with any encryption method; especially this research generates all the required
secret subkeys for the encryption process.
11-Just by applying XOR operation between one block of the plaintext with one subkey
an encryption method will be proposed, and it is good to make some confusion by
systematic unordering the generated list of the subkeys.
12- The main problem of the proposed method is the runtime, it is take long time to
generate a list of M unique subkeys, where as it is take 517 seconds to generate 2000
unique subkeys of size 256 bits using Microsoft visual studio ultimate (VB) with
Celeron CPU of 2.0 GHz, 4GB RAM, and windows 7 operating system.
References:-
[1] E. Barker, A. Roginsky, “Recommendation for Cryptographic Key Generation”,
NIST Special Publication 800-133, December 2012.
[2] A. Menezes, P. Oorschot and S. Vanstone, “Handbook of Applied Cryptography”,
CRC press, 1997.
[3] K. M. MARTIN, “Everyday Cryptography: Fundamental Principles and
Applications”, OXFORD university press, 2012.
[4] W. Stallings, “Cryptography and Network Security”, 4th Edition, Prentice Hall,
2006.
[5] C. Paar, J. Pelzl, “Understanding Cryptography”, Springer-Verlag Berlin Heidelberg,
2010.
[6] D. E. Denning ,”Cryptography and Data Security”, Addison-Wesley, 1982.
[7] L. M. Jawad, G. Sulong, “ A Novel Dynamic Secret Key Generation for an Efficient
Image Encryption Algorithm”, Modern Applied Science; Vol. 9, No. 13; 2015.
[8] H. Abunahla, D. Shehada, C. Y. Yeun, B. Mohammad, and M. Jaoude, “Novel Secret
Key Generation Techniques Using Memristor Devices” API advances, volume 6,
issue 2, 6112.
[9] A. Soni1, S. Agrawal, “Key Generation Using Genetic Algorithm for Image
Encryption”, IJCSMC, Vol. 2, Issue. 6, June 2013.
[10] P. R. Gurubilli, “Random Number Generation and its Better Technique”, A thesis
submitted in partial fulfillment of the requirements for the award of degree of Master
of Engineering in Computer Science and Engineering, 2010.
[11] W. Trappe, L. C. Washington, “Introduction to Cryptography with its Coding
Theory”, Second Edition, Person Prentice Hall, 2006.
International Journal of Computer Science and Information Security (IJCSIS),
Vol. 15, No. 8, Augus 2017
55 https://sites.google.com/site/ijcsis/
ISSN 1947-5500