Tuesday, 22 May 2012
  DiceLock improves symmetric ciphers like AES (Advanced Encryption Standard) and others.
  Providing maximum information security privacy with little time.
HC 256

DiceLock cipher incorporates stream cipher HC 256 to produce randomized-encrypted sequences.

As performance execution is an important issue to encryption we need to know time performance relation between stream cipher HC 256 and the random number tests implemented in DiceLock.

In this page we show the test performed to get bit stream length and execution time relation. We all know that real execution performance in computers is altered through system interruptions and third party software.

For this analysis we've stopped any third party software like antivirus or software updaters and disconnected the computer from Internet.

At the end of this page you can find the evaluated relevant DiceLock cipher C++ source code used.

Shortcuts
Execution output
Cipher & decipher plot with RapidMiner
Cipher plot with RapidMiner
Decipher plot with RapidMiner
Cipher linear regression with RapidMiner
Decipher linear regression with RapidMiner
Cipher linear regression with Excel
Cipher line fit plot with Excel
Decipher linear regression with Excel
Decipher line fit plot with Excel
Relevant C++ Source Code used
Execution environment

Summary

with Rapid Miner:

cipherTime = 0.000242867290412546 + 0.000000007318465211 * length, Coefficient = 0.997661007021858000
decipherTime = 0.000225680399914539 + 0.000000007366546312 * length, Coefficient = 0.998343396171505700

The Coefficient values indicate how well the model fits the data, they are close to 1.0, indicating that we have accounted for almost all of the variability of cipherTime (0.999120714183335300) and decipherTime (0.997634806959012200) with bit stream length variable.

with Excel:

cipherTime = 0,000242867290412538 + 0,000000007318465211 * length, Multiple R = 0,99766100702187
decipherTime = 0,000225680399914536 + 0,000000007366546312 * length, Multiple R = 0,998343396171515

Which confirms RapidMiner results with a negligible variation.

With these results we'll be able to establish cipher, decipher algorithm relations with random number tests and hash functions (all components of DiceLock).

Data calculation

We compute "cipherTime" and "decipherTime" in seconds depending of the length of the stream being ciphered and deciphered.

Computing "cipherTime" comprises the stages:
- initializing cipher algorithm,
- setting symmetric key,
- setting initialization vector, and
- cipher plain text stream.

Computing "decipherTime" comprises the stages:
- initializing cipher algorithm,
- setting symmetric key,
- setting initialization vector, and
- decipher cipher text stream.

In order to establish the relation between encrypted and decrypted stream length with execution time in seconds we have performed the following execution:

- 32.219 plain text streams with lengths from 1.024 bits to 1.000.000 bits, each stream 32 bits longer than the previous one,
- computed execution time for encryption and decryption for each stream with CounterTime class,
- comparing that the deciphered text matches plain text that has been encrypted,
- saving to "HC256.csv" file the information: stream length in bits, cipher and decipher time in seconds for all 32.219 tests performed,
- finally, compute stream cipher HC 256 with Known Answer Test (KAT) of ECRYPT Stream Cipher Project, Test vectors -- set 1, where key is set to 0x80 (first byte) and remaining bytes to 0's, initialization vector is set to 0's and plaintext is 512 bytes set to 0. We can see that expected ciphertext and computed ciphertext match, and that the deciphered text matches plain text that has been enciphered.

Execution output:

We can see the last plain streams encrypted and decrypted, the time in seconds it took and the number of correctly ciphered and deciphered text sequences, 31219 sequences.

At the end key is set to 0x80 (first byte) and remaining bytes to 0's, initialization vector is set to 0's and plaintext is 512 bytes set to 0. It's shown that expected ciphertext matches computed ciphertext. Finally, deciphered text sequence matches KAT plain text.

HC256.csv created file with stream length, cipher time and decipher time

RapidMiner plots

With HC256.csv we can analyze if it's possible to establish some strong relationship between stream length and execution time in seconds. We've worked with RapidMiner software to see if we can extract some conclusion.

Cipher & decipher plot

Once loaded HC256.csv with RapidMiner we can see the plot of "cipherTime" and "decipherTime" (on Y axis) regarding stream "length" (on X axis).

It's obvious that cipher and decipher operation execution time has a clear relationship with stream length and that linear regressions can be obtained.

Cipher plot with RapidMiner

The next step performed has been to plot just "cipherTime" (Y axis) against stream "length" (X axis). Although the majority of points are over a line, some points are outliers (they are above the line). We can think about these outliers as system interruptions.

With this information we are able to establish a relationship between "cipherTime" and stream "length". A linear regression equation can be established to get a final relationship between cipher algorithm and random number tests.

Decipher plot with RapidMiner

The plot of "decipherTime" (Y axis) against stream "length" (X axis). Although the majority of points are over a line, some points are outliers (they are above the line). We can think about these outliers as system interruptions too.

With this information we are able to establish a relationship between "decipherTime" and stream "length". A linear regression equation can be established to get a final relationship between decipher algorithm and random number tests.

LINEAR REGRESSION

RapidMiner software allows to get models on data and establish relationaships between them.

We have taken a two ways approach, establilsh the linear regression with RapidMiner and verify such linear regression with Microsoft Excel.

RapidMiner linear regression analysis

Cipher linear regression

With the data regarding "cipherTime" and stream "length" we have perfomed the linear regression of "cipherTime" depending on stream "length".

The result obtained is the following one:

Although grid RapidMiner does not show in this format "length" Coefficient, equals 0, the regression formula in text format shows the data provided in the following formula.

That is:

cipherTime = 0.000242867290412546 + 0.000000007318465211 * length

intercept = 0.000242867290412546,

and the slope = 0.000000007318465211,

with a Standard Coefficient of:

Coefficient = 0.997661007021858000

The Coefficient value indicates how well the model fits the data, it's close to 1.0, indicating that we have accounted for almost all of the variability of cipherTime (0.997661007021858000) with stream length variable.

Decipher linear regression

With the data regarding "decipherTime" and stream "length" we have perfomed the linear regression of "decipherTime" depending on stream "length".

The result obtained is the following one:

Although grid RapidMiner does not show in this format "length" Coefficient, equals 0, the regression formula in text format shows the data provided in the following formula.

That is:

decipherTime = 0.000225680399914539 + 0.000000007366546312 * length

intercept = 0.000225680399914539,

and the slope = 0.000000007366546312,

with a Standard Coefficient of:

Coefficient = 0.998343396171505700

The Coefficient value indicates how well the model fits the data, it's close to 1.0, indicating that we have accounted for almost all of the variability of decipherTime (0.998343396171505700) with stream length variable.

Excel linear regression analysis

Microsoft Excel provides for data analysis. We perform the same Linear Regression of the same HC256.csv file in order to check that we get the same results.

Cipher linear regression

In Excel we analyze all 32.219 "cipherTime" and stream "length" data samples with Regression and we get the linear regression and ANOVA:

That is:

cipherTime = 0,000242867290412538 + 0,000000007318465211 * length

intercept = 0,000242867290412538, (Excel result)

intercept = 0.000242867290412546, (RapidMiner result, negligible difference)

slope = 0,000000007318465211, (Excel result)

slope = 0.000000007318465211 (equals RapidMiner result)

And the important statistical information

Multiple R = 0,99766100702187

R Square = 0,995327484931891

Adjusted R Square = 0,995327335253348

Standard Error = 0,000144612097092364

The Coefficient is close to 1.0, indicating that we have accounted for almost all of the variability of cipherTime (0,99766100702187) with stream length variable.

coefficient = 0,99766100702187, (Excel result)

coefficient = 0.997661007021858000, (RapidMiner result, negligible difference)

Cipher fit plot

The fit plot of calculated "estimated values" with the linear regression formula (pink line) and the sample data (blue points) shows us that the linear regression formula adjust quite well to real values.

The linear regression formula can be used to estimate time relationships between stream cipher HC 256 with random number tests.

Decipher linear regression

In Excel we analyze all 32.219 "decipherTime" and stream "length" data samples with Regression and we get the linear regression and ANOVA:

That is:

decipherTime = 0,000225680399914536 + 0,000000007366546312 * length

intercept = 0,000225680399914536, (Excel result)

intercept = 0.000225680399914539, (RapidMiner result, negligible difference)

slope = 0,000000007366546312, (Excel result)

slope = 0.000000007366546312 (equals RapidMiner result)

And the important statistical information

Multiple R = 0,998343396171515

R Square = 0,996689536679276

Adjusted R Square = 0,996689430632464

Standard Error = 0,000122439238160918

The Coefficient is close to 1.0, indicating that we have accounted for almost all of the variability of decipherTime (0,998343396171515) with stream length variable.

coefficient = 0,998343396171515, (Excel result)

coefficient = 0.998343396171505700, (RapidMiner result, negligible difference)

Decipher fit plot

The fit plot of calculated "estimated values" with the linear regression formula (pink line) and the sample data (blue points) shows us that the linear regression formula adjust quite well to real values.

The linear regression formula can be used to estimate time relationships between deciphering stream cipher HC 256 with random number tests.

Relevant C++ Source Code used

baseSymmetricCipher.h
baseSymmetricCipher.cpp
baseSymmetricStreamer.h
baseSymmetricStreamer.cpp
baseStreamCipher.h
baseStreamCipher.cpp
HC256.h
HC256.cpp
counterTime.h
counterTime.cpp

Execution environment:

Hardware:
Dell Precision M65
Intel Core 2 CPU T7200 @ 2.00GHz 2.00 GHZ
2,00 GB RAM

Software:
Windows Vista Ultimate Service Pack 2
32 bits Operating System

Developed with:
Microsoft Visual Studio 2008 Version 9.0.21022.8 RTM
Microsoft .NET Framework Version 3.5 SP1
Installed Edition: Professional Microsoft Visual C++ 2008 91605-130-0262317-60659
DiceLock release version: Optimization: Maximize Speed (/O2), Favor Fast Code (/Ot)

 
Cart
Your Cart is currently empty.

ECB Converter
Customer Login

Newsletter Subscription

Subscribe to our Newsletter. If you want to know the purpose of our Newsletter, click here !!!