Research Paper
Statistics
E-ISSN : 2454-9916 | Volume : 1 | Issue : 5 | Dec 2015
NUMBER GENERATOR IMPROVEMENT BASED ON ARTIFICIAL INTELLIGENT AND NONPARAMETRIC STATISTIC METHODS Estabraq Abdul Redaa Kadhim Asst.Instr, Computer Engineering Techniques Department, AL-Israa University College, Iraq ABSTRACT Random numbers are a fundamental tool in many cryptographic applications like key generation, encryption or masking protocols. This paper proposed new improvement on Blum-Blum-Shub (BBS) based on Iterated Local Search (ILS) metaheuristic technique and nonparametric statistic test (Run, Sign and Wilcoxon Signed Rank Tests) to generate strong BBS- integer numbers for encryption purpose. Evaluations function of ILS will be based on passing BBS-cryptokey through that nonparametric statistic methods to check the weather of their randomness and distribution(i.e. frequency and magnitude).The experimental results shown that improvement ratio of Enhanced BBS-cryptokey numbers are ranging from [40%-90%] ,reality this due to two reasons; first is the existence of high perturbation on solution that is using in ILS ,so it’s lead to reach to the optimization ;second is selected of value that determine the ranging of critical values KEYWORDS: Cryptography, Key generation ,Artificial Intelligent ,Metaheuristic search, Blum-Blum-Shup PSNR, Nonparametric statistic methods
1. Introduction Blum-Blum-Shub (BBS) is a well-known cryptographically secure pseudo random number generator. BBS is completely unpredictable even when a long sequence of bits has been generated. The underlying theory is based on quadratic residues, and cracking is equivalent to integer factorization [1]. Iterated Local Search (ILS) is a simple but powerful metaheuristic algorithm .It applies local search to an initial solution until it finds a local optimum, then it perturbs the solution and it restarts local search.. On the other side, too strong perturbation would make the algorithm similar to a random restart local search [2]. Nonparametric statistics uses data that is often ordinal, meaning it does not rely on numbers, but rather a ranking or order of sorts [3]. This approach will enhance BBS-integer values generated using Iterated Local Search (ILS) metaheuristic to create strong cryptokey passing through some nonparametric statistic test (Run, Sign and Wilcoxon Signed Rank tests) 2. Blum-Blum-Shub(BBS) Generator The cryptographically secure pseudorandom number generator BBS is a simple algorithm with a strong security proof, however it requires very large numbers to be secure, which makes it computationally heavy [4]. BBS, given a truly random binary sequence of length n. Security of a pseudorandom generator is a characteristic that shows how hard it is to tell the difference between the pseudorandom sequences and truly random sequences. The BBS also regarded as being secure when the log2(log2(n)) least significant bits of (s02 mod n) are used (instead of just the least significant bit) [5]. BBS pseudo random number generator shows in following steps: Step1: Generate p and q ,two big Blum prime numbers Step2: n:=p*q
Where : parity(xi)is define as R2(xi) 3. The Sign Test The sign test is probably the simplest of all the nonparametric methods. It is used to compare a single sample with some hypothesized value, and it is therefore of use in those situations in which the one-sample or paired t-test might traditionally. Figure (2) shows basic steps of sign test [6]. 4. The Wilcoxon Signed Rank Test The sign test is intuitive and extremely simple to perform. However, one immediately obvious disadvantage is that it simply allocates a sign to each observation, according to whether it lies above or below some hypothesized value, and does not take the magnitude of the observation into account. Omitting information on the magnitude of the observations is rather inefficient and may reduce the statistical power of the test. An alternative that does account for the magnitude of the observations is the Wilcoxon signed rank test. Figure (3) shows basic steps of sign test [6]. 5. Iterated Local Search (ILS) Iterated Local Search (ILS) aims to search over the space of local optima. A random solution S0 is generated and then local search is applied to reach a local optimum S*.This local optimum is then perturbed in some way to obtain S' and local search is then applied to reach another local optimum S*' .Some criterion is applied to determine whether the 'move' from S*to S*' is accepted. Thus the high level moves are seen to be between local optima[2]. The strength of a perturbation is a measure of how much it changes the solution. This may be fixed or may vary dynamically. A variety of acceptance criteria can be adopted (always accept, accept only improving moves, accept probabilistically in an annealing-like manner etc) [7]. Figure (4) shows the mains steps of ILS metaheuristic.
Step3:Choose s∈R[1,n-1],the random seed Step4: x0 :=s2(mod n) Step5: The sequance is define as xi :=x2i-1(mod n) and z:=parity(xi)
International Education & Research Journal [IERJ]
5. Proposed Approach Blum-Blum- Shub (BBS) is given a truly random binary sequence. In this approach, we are investigating from integer numbers that generated from traditional BBS and enhanced them by using
28
Research Paper Iterated local search (ILS) technique to be more suitable for using as cryptokey in cryptography algorithms . Enhancement decision will be based on passing BBS-cryptokey through some of nonparametric statistic methods (Run , Sign ,Wilcoxon Signed Rank Tests ) to check the weather of their randomness and distribution(frequency and magnitude). Iterated local search (ILS) will be done when Blum–Blum key numbers doesn't passed via statistic test, (i.e. distribution and randomness are unacceptable or rejected null hypothesis). These three statistic methods are more suitable for this approach requirements because they are applying on one sample (independent key list) and able to measure large sample with not normally distribution , see table(40-13) in [3] . Figure (5) shows the main steps of the proposed approach. Algorithm (1) shows the main steps of proposed approach.
E-ISSN : 2454-9916 | Volume : 1 | Issue : 5 | Dec 2015 H1= otherwise (Note): The null hypothesis specifies that the state will remain unchanged, and the alternative hypothesis states that it will be different. The following example explains Sign test for large sample size: Cryptokey = [27759 , 46817, 82702, 105826, 89125, 68588 ,…., 49243 40977 ] , key length= 659 Sign list = [+ + - + + + + - + + + + + + - - - + + + +,……, + +] Apply Sign Test equation for large sample size length=659 , a=0.09, for two tailed test
when key
5.1 Implementation The proposed approach has been implemented using c#.net , the following steps illustrate the main steps of this approach with explaining each step in details a) BBS- integer number generator This step is producing an initial BBS- cryptokey that unknown of distribution and randomness as in the following example:
Where: X=smaller number of (+) or ( –) signs n= sample length
Let p = 199 ,q=599 nBlum= p*q ® nBlum = 199*599 ® nBlum =119201 Z= -5.492 s=69958 Critical value when a=0.09 for two tailed test = x1=(s2 mod n), x1= (4894121764 ) mod 119201 ® x1= 27759 -1.7 ≤ Z ≤ 1.7 Cryptokey = [27759, 46817, 82702, 105826, 89125, 68588,…., 49243 40977 ] According to above key sequence, it must find a powerful relation among numbers within BBS-cryptokey that consider sober relation when measured by nonparametric methods. This relation is represented by Greatest Common divisor, GCD (a, b) to (signing and ranking) BBS-cryptokey sequence. GCD (a, b) of two positive integers a and b is the largest divisor common to a and b .Two or more positive integers that have greatest common divisor 1 are said to be relatively prime to one another (i.e. Two integers are relatively prime if they share no common positive factors except 1) b) Measure BBS- cryptokey using Sign test In sign test there is very important to find the median on BBScryptokey that used as threshold (if the values of BBS-cryptokey is greater than median then signing with (+) else signing with (-). In this approach , median is representing by getting GCD between a and b for all neighbors values in BBS-cryptokey until reach to end of key length as in equation (1)
-1.7 ≤ -5.492 ≤ 1.7 ® So, Null hypothesis is rejected ! c) Measure BBS cryptokey using Wilcoxon Signed Rank test Wilcoxon Signed Rank is a method for one sample basically based on the concept of Signing and then ranking all values in BBScryptokey . Signing will apply using equation (1) but the ranking will be computed by rating (weighted) all values in key sequence. The best way for getting an authorized rating is computed GCD between each value with another all values in BBS-cryptokey sequence that shows in equation (3).
From above equation, rating list was obtained. Now Ranking will apply on BBS-cryptokey sequence by given 1 to high rate, 2 for after one,……. and so. The following example shows how Wilcoxon signed rank the cryptokey sequence: Aftet getting to Sign list that contain BBS-cryptokey in the form of (+,-), hypothesis must state for two tailed test . The hypothesis of this situation are: H0= BBS-cryptokey is random and distributon
29
International Education & Research Journal [IERJ]
Research Paper
E-ISSN : 2454-9916 | Volume : 1 | Issue : 5 | Dec 2015 ∂r= 12.22
Critical value when a=0.09 for two tailed test = -1.7 ≤ Z ≤ 1.7 -1.7 ≤ -6.32≤ 1.7 ® So, Null hypothesis is rejected! From above implemented of nonparametric measurements on traditional BBS-cryptokey,we can be seen that BBS-cryptokeyis not able to passing through of them , so we must resort to improved BBS-cryptokey ,even if not passing through only one measurement .
Find the sum of positive Rank and sum of negative Ranks separately Positive Rank sum= +157365 Negative Rank sum= -50325 Ws= Smaller of absolute value Ws= (|-50325 |) Ws= 50325 Critical value when a=0.09 for two tailed test = -1.7 ≤ Z ≤ 1.7 -1.7 ≤ -11.946 ≤ 1.7 So, Null hypothesis is rejected! d) Measure BBS-cryptokey using Run test Run test is using for checking the weather of randomness of BBScryptokey numbers. It is based on the Sign list that generated from equation (1), and computing run test value. The following example explain sign test for large sample:
Where: n1=number of (+) n2= number of (-)
Where: n1=number of (+) n2= number of (-)
1.1.3. ImprovedBBS-cryptokey list (using ILS) From above statistic measurements, we can see that null hypothesis is rejected (i.e. unacceptable randomness or distribution or both).Iterated Local Search (ILS) is using in this approach to be responsible for enhancing the generating BBScryptokey. ILS is a simple but powerful metaheuristic algorithm. The basic reason of select ILS in this approach because have high perturbation that allow BBS-cryptokey to escape from local minimum (i.e. passing through statistic measurements ). Following example shows the main steps of intelligent enhance algorithm: Let p= 19 , q= 23, nBlum=437 ,s= 13 1. Cryptokey list (initial solution)= [156,301,142,62,348,55,403,282,427,100,386,416,4,16,256 ,423,196,397,289,54,294,347,234,131,118,377,104,328,82] 2. Initial objective function Sign test=-0.928 Wilcoxon test=-1.708 Run test=-1.61 3. Apply local search on cryptokey list Cryptokey list*=[156,294,234,196,348,416,104,54,286,62,282, 386,142,65,16,118,256328,82,423,403,377,301,427,55,347,397,13 1,289 ] Sign*= -0.928 Wilcoxon*= -2.324 Run*=-0.161 4. Apply perturbed and local search on cryptokey list Cryptokeylist*’=[156,144,234,196,348,416,104,54,100,294,282,38 6,142,4,16,118,256,328,82,318,403,377,301,427,55,347,397,131,2 89] Sign *’= -0.928 Wilcoxon *’=-1.924 Run *’=-0.805 5. Acceptance criteria=[Choose better from (Cryptokey list*’, Cryptokey list* ] 6. Select Cryptokey list*’to be an initial solution for next iteration 7. After applying 100 iteration we getting to final enhanced solution Final, Improved cryptokey =[282,196,96,54,348,206,58,142, 4,256,92,16,369,423,259,301,301,403,235,55,397,353,289, 248,294,62,328,82,416] SignImproved= -0.928
Accepting Null hypothesis
WilcoxImproved= -0.854 Accepting Null hypothesis RunImproved= -0.402
International Education & Research Journal [IERJ]
Accepting Null hypothesis
30
Research Paper 6. Experimental Results There are some criterion must be considered when applying this proposed approach listed as in the following:
E-ISSN : 2454-9916 | Volume : 1 | Issue : 5 | Dec 2015 [7] John Andrew Clark, “Metaheuristic Search as a Cryptological Tool” , University of YorkDepartment of Computer Science, December, 2001.
1. Improvement ratios are differenced from one state to another, this based on the value of a that determine the range of critical values. Table (1) shows the improvement ratios of some key numbers for 100 iterations with a ranging [0.01 , 0.09] values using two tailed tests. From table (1) , obviously the ratios are affected by the a value, and can be seen that when a decreased, the boundary of critical value is increased so the finding of good or optimal solution will be more flexible than elsewhere state. 2. Not all traditional BBS-integer number may be need to enhance ,some of them are passing via statistic tests without improving , figure (6) shows the percentage of cryptokey that needed to improved or not.
Figure(1): Main steps of Blum-Blum-Shub (BBS)
3. Improved BBS- cryptokey does not affected by nBlum or length of key number, it only affected by how numbers are distributed within key sequence, this based on seed and mathematical transmission from xi to xi+1 . 7. Conclusion 1. Traditional BBS classified as one of best and strong method for random bit sequence but Improved-BBS proved to be generating strong integer numbers and bit sequence forcryptokey purpose. 2. The existence of some nonparametric statistic test as a means for evaluate the frequency, magnitude and randomness of improved BBS-cryptokey had given sober BBS-cryptokey. 3. Enhancement of cryptokey basically dependent on seed number (i.e. size, randomness and distribution of BBScryptokey are different from one sequence to another that have same nBlum) .
Figure(2): Basic steps of sign test
4. The reaching to the best or (near to optimal solution) takes time consuming. This feature considered as main disadvantage of this approach. REFERENCES [1] David Bishop, “Introduction to Cryptography with Java Applets” ,ISBN 0-7637-2207-3, Grinnell College, London,2003 available at : “http://cdn.preterhuman.net/texts/ cryptography/ Cryptography,%20Java%20%20Introduction %20To%20Cryptography%20With%20Java%20Applets.pdf”. [2] C h r i s t i a n B l u m , A n d r e a R o l i , " M e t a h e u r i s t i c s i n Combinatorial Optimization: Overview and Conceptual Comparison”, ACM Computing Surveys (CSUR), Volume 35 Issue 3, September2003, Available athttp://www.lia.deis. unibo.it/~aro/pubs/blum_roli_ metaheuristics-preprint.pdf. [3] A l l a n G . B l u m a n , “ E l e m e n t a r y S t a t i s t i c s ” , I S B N 978–0–07–353497–8 Community College of Allegheny County, Americas, New York,2009.
Figure (3): Basic steps of sign test
[4] Mikael Olsson, NiklasGullberg,”A performance comparison between a CPU bound and a GPU bound Blum BlumShub generator”, School of Computing ,Blekinge Institute of Technology, Sweden, January 2012. [5] Adam Young ,Moti Yung“Exposing Cryptovirology”, ISBN: 07645-4975-8, Wiley Publishing ,Canada,2004. [6] Elise Whitley and Jonathan Ball,“Statistics review : Nonparametric methods”, ISSN 1466-609X, London September 2002.
31
Figure (4): Main Steps of ILS
International Education & Research Journal [IERJ]
Research Paper
E-ISSN : 2454-9916 | Volume : 1 | Issue : 5 | Dec 2015 3. Compute sign test (z) value for large sample as following equation
4. Test Acceptance of null hypothesis Step3: Measure BBS-cryptokey using Wilcoxon signed Rank test 1. State hypothesis as in the following H0= High distribution H1= Otherwise 2. Signing the cryptokey list by find GCD between each two neighbors value in sequence based on the equation (1) Figure (5): Improved -BBS cryptokey diagram
Figure (6): percentage of improvement cryptokey via different values of nBlum .It's clear that most of cryptokey numbers need to improve
3. Rating the absolute cryptokey list by find GCD between specific value with all another values in cryptokey list as in the following equation:
4. Ranking the absolute cryptokey list, by given first ranked to high rate and second ranked next high rate and so ….. 5. Compute Wilcoxon test value (z) for large sample as in following equation
Input: p ,q Output: Improved BBS-cryptokey Process Step1: Generate BBS integer number sequence(cryptokey ) e) Select two Blum-Prime number p,q f) find modular value (nBlum) by nBlum=p*q g) Select a random integer seed (s) h) Compute x0 = (s2 mod n.) i) Repeat until reach to key length 2 Ÿ Compute xi =( (xi-1 ) mod n) Ÿ Add xi into cryptokey list Ÿ End loop
6. Test Acceptance of null hypothesis Step4: Measure BBS-cryptokey using Run test 1. State hypothesis as in the following H0= High distribution H1= Otherwise
Step2: Measure BBS-cryptokey using Sign test 1. State hypothesis as in the following H0= High distribution H1= Otherwise
2. Signing cryptokey list based on equation(1)
2. Signing the cryptokey list by find GCD between each two neighbors value in cryptokey list as in the following equation
3. Compute Run test value (z) for large sample as in following equations
International Education & Research Journal [IERJ]
32
Research Paper
E-ISSN : 2454-9916 | Volume : 1 | Issue : 5 | Dec 2015
4. Test Acceptance of null hypothesis 5. If null hypothesis is rejected in step(2),4 OR step (3),6 ,OR Step(4),4 step then go to step(5), elsego to step (6) Step 5: Enhanced BBS-cryptokey (Apply ILS ) cryptokey list *= Local Search(cryptokey list) Repeat cryptokey list ′= Perturbation(cryptokey list*, history) Evaluate (cryptokey list ′) by go to step2,3,4 cryptokey list *′= Local Search (cryptokey list ′ ) Evalute (cryptokey list *′)by go to step2,3,4 cryptokeylistnew= best of (cryptokey list*′,cryptokey list ′ ) Until find best solution Step 6: Generate improved BBS-cryptokey list Step 7: End Improved BBS–cryptokey Algorithm Table(1): Ratio of enhancement for cryptokey generation
33
(a) value
Critical value
Improvement ratios
a=0.01
(-2.58, 2.58)
86.66%
a=0.02
(-2.33,2.33)
91.65%
a=0.03
(-2.17 , 2.17)
59.98
a=0.04
(-2.06,2.06)
83.32%
a=0.05
(1.96,1.96)
66.64
a=0.06
(-1.98,1.98)
57%
a=0.07
(-1.82,1.82)
41.62
a=0.08
(-1.76 ,1.76)
49.97 %
a=0.09
(-1.07,1.07)
58.3%
International Education & Research Journal [IERJ]