Figure 8 shows the experimental setup, in which the proposed key stream was implemented.
The hardware setup consists of a popular Arduino nano-board with a built-in reset and operating power circuit. The 16 x 2 liquid crystal display is provided to display the progress of the key stream generator process starting from basic seed generation to the main key stream bit generation. The Arduino integrated development environment (IDE) is utilized to implement the key stream generator. The compiled code was ported on to the Arduino nano development board. The experimental setup also has a current sensor to estimate the current consumption as it is one of the prime parameters to decide the resource constraint of the algorithm. The power consumption is also an important parameter to be considered in hardware design. Screen shots of the experimental process of key stream generation are shown in Figure 9.
The experimental setup was used to generate three keystreams of 1MB each. The summary of hardware resource utilization is shown in Table-5.
Table-5: Resources Utilization-Results
Attribute
|
Specifications
|
Utilization
|
Remark
|
Microcontroller
|
ATmega 328
|
|
8-bit
|
Frequency
|
16Mhz
|
|
|
Flash memory
|
32KB
|
8.2KB
|
25%
|
SRAM
|
2KB
|
235 Bytes
|
11.45%
|
EEPROM
|
1KB
|
Nil
|
|
Power
|
5V
|
155mA@5V
|
0.775mW
|
Digital I/O
|
16
|
8
|
50%
|
Analog I/O
|
6
|
2
|
33.33%
|
Time of execution
|
|
<5sec (approx.)
|
1 MB
|
The amount of effort involved in terms of code execution; resource utilization has been great as can be understood from the Table-5.
The suitability of the proposed key stream generator for the security of smart meters and autonomous vehicles requires an in-depth analysis. The objective of the proposed key stream generator is to be lightweight in terms of cost, complexity, ease of implementation, time of execution and so on. Therefore, the analysis of the proposed key stream generator is divided into various phases as follows:
A. MATHEMATICAL ANALYSIS
The mathematical analysis of the proposed key stream generator is to determine the values of some of the attributes like length of the LFSR, its period and linear complexity. These parameters are required to understand the generator’s capability to provide the secrecy of the information. The attributes of the key stream generator are as follows:
i. MAXIMUM LENGTH OF LFSR
The properties of the key stream generator can only be revealed if it satisfies certain conditions of algebra. The definitions of algebra, which indicate the necessary conditions to consider the key stream generator for the cryptographic applications are as follows.
Definition 1: A prime number is a positive integer with exactly two positive divisors. If p is a prime then its only two divisors are necessarily 1 and p itself, since every number is divisible by 1 and itself.
The first ten primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29.
Definition 2: The LFSR is maximal-length if and only if the corresponding feedback polynomial is primitive. This means that the following conditions are necessary (but not sufficient):
- The number of taps is even.
- The set of taps is set wise co-prime; i.e., there must be no divisor other than 1 common to all taps.
Definition 3: Let a and n be integers greater than one. If an-1 is prime, then a is 2 and n is prime.
Theorem 1: Let LFSR-1, LFSR-2 and LFSR-3 have a primitive feedback polynomial and a nonzero initial state.
If 229-1, 223-1 and 219-1 are prime (Definition-3) then the length of each LFSR is 229-1, 223-1 and 219-1 respectively.
ii. PERIOD OF KEY STREAM GENERATOR
The key stream generator must have a large period to be considered for cryptographic applications. The proposed key stream generator is designed using linear feedback shift registers with a nonlinear output function represented by a 2:1 multiplexer as shown in Figure 3 & 4. The clock to the shift registers is controlled by means of feedback bit generated using selective polynomials which would introduce higher confusion & diffusion in the bit stream output of the key stream generator.
Theorem 2:
If (l,m,n,)=1, then its period is (2l-1) (2m-1) (2n-1)
Thus, basic generator has a period of:
Period= (2L1-1) x (2L2-1) x (2L3-1) (6)
i.e., Period= (229-1) x (223-1) x (219-1) 271
To increase the level of complexity for attackers on the key stream generator, multiple feedback polynomials have been included in the design. Thus, the period increases by 212 and avoids the issue of being insecure. Therefore, the period of the proposed key stream is approximately = [(229-1) x (223-1) x (219-1)] x 212= 283.
iii. LINEAR COMPLEXITY
This is another important property that the keystream generator has to possess for it to be considered suitable for cryptographic applications. The linear complexity must be large but does not guarantee the randomness properties of the sequence under consideration.
Definition-4: Let Z = z0, z1, z2, z3, . . . be a finite or infinite sequence. Then the linear complexity LC(Z) of Z is the length of the shortest LFSR which generates it.
The proposed key generator has the multiplexer at the output of the key stream generator and forms the nonlinear combining function. The algebraic normal from (ANF) of the multiplexer is:
f (x1, x2, x3) = x1 x2 x2 x3 x3 (7)
Therefore, the LC of the basic element is:
LC= L1x L2 + L2 L3 + L3 (8)
i.e. LC = 29 x 23 + 23 x 19 + 19
LC= 1123= 210 (approximately)
Since the proposed key stream generator has 4 primitive polynomials at the feedback of each LFSR, that increases the LC by a factor of 4 roughly. Overall complexity increases by a factor of 212 approximately.
B. EXPERIMENTAL ANALYSIS
Experimental analysis is an important tool to investigate key stream generator performance in terms of resources utilization, execution time, ease of implementation, and so on. The analysis is divided into categories as follows:
i. IMPLEMENTATION ANALYSIS
The firmware code written in the high language ‘C’ is about 25% of the total programming memory of 32KB.The SRAM is about 11.45%. The code optimization technique was not adopted while writing the firmware. The power consumption of the experimental setup was about 775mW. This is extremely good for any stream generator to run. The resources utilization would have been much better with a code optimization technique in place, which could be a next attempt to improve the performance of the key stream generator for the smart meter and autonomous vehicle security. On the whole, hardware resource utilization is quite satisfactory. The results of the implementation in terms of hardware resources utilization are shown in Figure 10.
ii. STATITSTICAL ANALYSIS
The National Institute of Standards and Technology (NIST) has prescribed certain statistical properties, which would reveal the weakness of the key stream generator. Statistical tests have been formulated to test a specific null hypothesis, denoted by H0. The null hypothesis for conducting tests on the output bit stream of the proposed key stream generator is that it is random. An alternative hypothesis (Ha) to this null hypothesis is the bit stream not being random. The null hypothesis defines a critical value that can be used to compare with the determined statistic value of the bit stream to decide whether the bit stream is random or non-random. If the test statistic value exceeds the critical value, the null hypothesis for randomness is rejected. Otherwise, the null hypothesis is not rejected. The statistical test results are probabilistic and hence there is an attachment of called level of significance. It is denoted by ‘α’ and it is fixed at 0.05 in this paper. It is the probability that the test will indicate that the bitstream is not random, even though really it is. A theoretical reference distribution of the possible probability values for each test varies. The important statistical tests are frequency test (Monobit test), Serial test, Poker test, Runs test, and Autocorrelation tests. Each test mentioned here determines whether the key stream bits possess a certain attribute that a truly random sequence would exhibit; the conclusion of each test is not definite, but rather probabilistic. Based on the outcome of the test attribute, the sequence may be declared as random or non-random. To conduct these tests on the key stream generator, at least each block size must be >10,000 bits. Therefore, the keystream generator output of size 1Mb was chosen for experimental analysis. The whole data file was divided into number blocks of different sizes while conducting the minimum tests as per NIST standard.
To conduct statistical tests, a test suite was developed and the screen shots of the same are shown in Figure 11.
Table-6: Statistical Test Results
Size of the input file
|
1MB (1024kb)
|
Test
|
Block Size
|
No of Blocks
|
Seq1
|
Seq2
|
Seq3
|
Inf
|
Frequency
|
10k
|
100
|
93
|
91
|
90
|
R
|
7
|
8
|
10
|
NR
|
25k
|
50
|
47
|
45
|
49
|
R
|
3
|
5
|
1
|
NR
|
50k
|
20
|
16
|
18
|
19
|
R
|
4
|
2
|
1
|
NR
|
100k
|
10
|
9
|
8
|
8
|
R
|
1
|
2
|
2
|
NR
|
Serial (di-bit)
|
10k
|
100
|
89
|
97
|
94
|
R
|
11
|
3
|
6
|
NR
|
25k
|
50
|
44
|
47
|
49
|
R
|
6
|
3
|
1
|
NR
|
50k
|
20
|
16
|
19
|
16
|
R
|
4
|
1
|
4
|
NR
|
100k
|
10
|
8
|
9
|
6
|
R
|
2
|
1
|
4
|
NR
|
Poker’s
|
10k
|
100
|
92
|
98
|
95
|
R
|
8
|
2
|
5
|
NR
|
25k
|
50
|
48
|
46
|
44
|
R
|
2
|
4
|
6
|
NR
|
50k
|
20
|
19
|
18
|
16
|
R
|
1
|
2
|
4
|
NR
|
100k
|
10
|
8
|
8
|
9
|
R
|
2
|
2
|
1
|
NR
|
Runs
|
10k
|
100
|
89
|
92
|
98
|
R
|
11
|
8
|
2
|
NR
|
25k
|
50
|
47
|
47
|
45
|
R
|
3
|
3
|
5
|
NR
|
50k
|
20
|
17
|
18
|
15
|
R
|
3
|
2
|
5
|
NR
|
100k
|
10
|
9
|
8
|
9
|
R
|
1
|
2
|
1
|
NR
|
Autocorrelation
|
10k
|
100
|
88
|
95
|
96
|
R
|
12
|
5
|
4
|
NR
|
25k
|
50
|
43
|
47
|
49
|
R
|
7
|
3
|
1
|
NR
|
50k
|
20
|
18
|
16
|
19
|
R
|
2
|
4
|
1
|
NR
|
100k
|
10
|
9
|
8
|
6
|
R
|
1
|
2
|
4
|
NR
|
Note 1k=1024 bits
Note: R→ Random, NR→ Non-Random, Inf→ Inference.
Three test sequences of size 1MB each were generated from the hardware setup and subjected to statistical tests. Table-6 above, summarizes the details of the tests carried out on the output of the proposed key stream generator and their results. Graphical representation of the results is shown in Figure 12.
Table-7 shows the significance value, expected probability value for each test along with the result of probability i.e., satisfied or not.
Table-7: Statistical Test Probability Value-Results
Significance value α
|
0.05
|
Name of the test
|
Expected Probability Value
|
Results of all three sequences
|
Frequency
|
3.8415
|
Satisfied
|
Serial (di-bit)
|
5.9915
|
Satisfied
|
Poker’s
|
14.071
|
Satisfied
|
Runs
|
9.4877
|
Satisfied
|
Autocorrelation
|
1.6449
|
Satisfied
|
The statistical test suite was developed with a python programming language and used on Windows platform. The time taken by the suite to complete each test with different block sizes is summarized in Table-8 and graphical representation in Figure 13.
Table-8: Time taken for each test-Results
Size of the input file
|
1MB (1024kb)
|
Name of the test /Block size
|
10k
|
25k
|
50k
|
100k
|
Frequency
|
2.5ms
|
4.8ms
|
7.8ms
|
10.5ms
|
Serial (di-bit)
|
4.3ms
|
9.2ms
|
15.7ms
|
23.5ms
|
Poker’s
|
11.4ms
|
20.6ms
|
34.8ms
|
50.2ms
|
Runs
|
18.7ms
|
37.2ms
|
52.8ms
|
68ms
|
Autocorrelation
|
26.8ms
|
49.5ms
|
67.2ms
|
82.4ms
|
The statistical test results indicate that the proposed key stream generator produces a different key bit stream with different basic key seed. Also, this suggests that the generated key stream bits almost satisfy the statistical criteria for being random. The analysis is pretty simple that the proposed key stream generator produces a random bitstream indeed.
C. SECURITY ANALYSIS
Security analysis is another important step in validating the suitability of the keystream generator for the purpose of information security. Validation attributes are with respect to certain well-known attacks such as Eaves dropping, man-in- the middle, etc. The other attributes, which makes the proposed algorithm are also presented here.
- Resistivity: The key stream generator is designed using LFSRs with primitive polynomials. As seen from the mathematical analysis, these LFSR’s are of maximum length and period. The period of the key stream generator is 283 which is sufficiently large enough to resist attack.
- Berlekamp-Massey attack: The linear complexity of the generator is about 225 (211 x 214). It indicates that the 225 plain text bits are required to perform the Berlekamp-Massey attack.
- Privacy Against Eves dropping: Since the communication is secured with encryption algorithms, it would be difficult to eaves dropping.
- Protection Against Man-in-the Middle Attack: As described earlier, authentication of communication entities involves the dynamically determined digital signature. The hash value (chk =[chk7-chk0] is generated from a unique algorithm as described earlier. This is used to encrypt a unique Id=[Id7-Id0] to create a digital signature ds=[ds7-ds0].
The receiver, performs the decryption of the digital signature to get the ‘Id’ of the sender and compares it with the stored, non-public ‘Id’ to determine the source of the information is legitimate. The MITM is very difficult due to the fact that the digital signature creation procedure is unique and the Ids are not public.
- Forward secrecy: Since session key generation is unique, dynamic and used only once, forward, secrecy of the information is guaranteed.
- Malicious communication: The injection of malicious communication is not possible, as the communication is based on a unique data frame of variable length. Since, data is secured using encryption process and modification in the data frame results in wrong decryption of the information resulting in declaration of invalid data frame. Thus, it is safe against malicious communication injection or modification of data frames.
- Session Key Security: Since session key generation is dynamic and used only once, it would be difficult to capture by any adversary as it is not shared on the link.
- Prior Key Distribution: There is no prior key distribution of any type. This makes the job of the adversary very difficult to hack into the link.
D. COMPARATIVE ANALYSIS
The related work on the security schemes was an opportunity to examine some of the selected works of previous researchers in detail with respect to their ability to perform in the smart grid and autonomous vehicle environments. The comparative study of those selected works and the proposed work is summarized in Table-9.
Table-9: Comparative Study of schemes
Attribute
|
Proposed
|
[1]
|
[7]
|
[8]
|
[9]
|
A1
|
NK
|
Yes
|
No
|
No
|
No
|
A2
|
Yes
|
Yes
|
Yes
|
Yes
|
Yes
|
A3
|
Yes
|
Yes
|
Yes
|
Yes
|
Yes
|
A4
|
Yes
|
Yes
|
Yes
|
Yes
|
Yes
|
A5
|
Yes
|
Yes
|
No
|
Yes
|
Yes
|
A6
|
No
|
Yes
|
Yes
|
Yes
|
Yes
|
A7
|
No
|
No
|
Yes
|
Yes
|
Yes
|
|
|
|
|
|
|
A1
|
Protection against quantum attack
|
A2
|
Privacy against eaves dropper
|
A3
|
Protection against man-in-the middle
|
A4
|
Forward secrecy
|
A5
|
Session Key security
|
A6
|
Prior Key distribution
|
A7
|
Session key sharing
|
NK
|
Not known.
|
The comparative study reveals that, most of the selected work’s dependent on prior distribution of key data, session key sharing and so on. The analysis completed in previous sections indicates that the authentication and encryption process can withstand most of the cryptographic attacks, since no sharing of any kind of information is used to start these processes.
E. COMPARATIVE ANALYSIS OF PROPOSED AND CLASSICAL ALGORITHMS
Since, few of the previous studies recommended the classical algorithms such as data encryption standard (DES) and advanced encryption standard (AES) to use in smart grid applications. The comparative analysis of classical algorithms and proposed work is summarized in Table-10
Table-10: Comparative analysis of classical and proposed algorithms
Parameter
|
DES
|
AES
|
Proposed
|
Key length
|
56
|
128-192-256
|
77
|
Key used
|
same
|
same
|
same
|
Block size
|
64 bits
|
128 bits
|
Single bit
|
Structure
|
Feistel
|
Substitution
|
Multiplexed LFSR
|
Scalability
|
Scalable
|
No
|
Scalable
|
Security
|
Suitable
|
Excellent
|
Suitable
|
Speed of execution
|
Low
|
Low
|
Fast
|
Encryption/decryption
|
Yes
|
Yes
|
Yes
|
Authentication
|
No
|
No
|
Yes
|
The comparative analysis indicates that the classical algorithms are more complex to implement as they have multiple rounds to execute. In summary, proposed work has the lowest cost of time compared to classical algorithms.