This document outlines a presentation on using continued fractions for stream ciphers. It introduces continued fractions and describes a continued fraction cipher. It also discusses Khinchin's attack, which can analyze the cipher text to determine properties of the plaintext by calculating the geometric mean of the partial quotients. The goals of finding new cryptographic techniques using continued fractions and cryptanalysis methods were partially achieved by designing a new pseudo-random generator and demonstrating a weakness that can be exploited with the Khinchin constant.
Nearest Prime Cipher for Data Confidentiality and Integrity
On the use of continued fraction for stream ciphers ver1
1. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Presentation: On the use of continued fractions
for stream cipher
Amadou Moctar Kane
KSecurity
amadou1@gmail.com
May 4, 2015
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
2. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
1 Introduction
2 Continued Fractions
3 On the use of continued fractions for stream cipher
Continued fraction cipher
Khinchin’s Attack
Applications
4 Questions
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
3. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Goals
After Diffie-Hellman: Fermat’s little theorem, Linearization
XL, graph theory. . .
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
4. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Goals
After Diffie-Hellman: Fermat’s little theorem, Linearization
XL, graph theory. . .
Continued Fraction
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
5. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Goals
After Diffie-Hellman: Fermat’s little theorem, Linearization
XL, graph theory. . .
Continued Fraction
How to use?
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
6. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Goals
After Diffie-Hellman: Fermat’s little theorem, Linearization
XL, graph theory. . .
Continued Fraction
How to use?
Quadratic irrational?
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
7. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Goals
After Diffie-Hellman: Fermat’s little theorem, Linearization
XL, graph theory. . .
Continued Fraction
How to use?
Quadratic irrational?
Γ?
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
8. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued Fractions
An expression of the form
α := a0 +
b0
a1 +
b1
a2 +
b2
...
is called a generalized continued fraction. Typically, the numbers
a1, . . . , b1, . . . may be real or complex, and the expansion may be
finite or infinite.
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
9. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Preliminaries
It is not possible to find an irrational number α simply on the
basis of knowledge of the partial quotients [am+1, . . . , am+n].
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
10. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Preliminaries
It is not possible to find an irrational number α simply on the
basis of knowledge of the partial quotients [am+1, . . . , am+n].
The knowledge of a = [am+1, . . . , am+n] does not allow to
know any other partial quotients of continued fraction
expansion.
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
11. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Preliminaries
It is not possible to find an irrational number α simply on the
basis of knowledge of the partial quotients [am+1, . . . , am+n].
The knowledge of a = [am+1, . . . , am+n] does not allow to
know any other partial quotients of continued fraction
expansion.
r
log(A) is transcendental.
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
12. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued fraction cipher
Khinchin’s Attack
Applications
Stream Ciphers
First Algorithm:Stream Cipher
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
13. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued fraction cipher
Khinchin’s Attack
Applications
Stream Ciphers
One time pad.
random key ⊕ plaintext
Unbreakable system.
Easy to implement.
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
14. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued fraction cipher
Khinchin’s Attack
Applications
Stream Ciphers
One time pad.
random key ⊕ plaintext
Unbreakable system.
Easy to implement.
Stream Ciphers.
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
15. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued fraction cipher
Khinchin’s Attack
Applications
Continued fraction cipher
We suppose that z ∈R N, and m is the secret message.
Table: Continued fraction cipher.
Alice Bob
computes t ≡ ze mod n
t
=⇒ computes z ≡ td mod n.
Computes X = e
log(z) Computes X = e
log(z)
Computes the CFE of X Computes the CFE of X.
Concatenates some PQ’s Concatenates some PQ’s.
Produces the keystream k1 Produces the keystream k1.
Computes m1 := m ⊕ k1
m1
=⇒ receives m1.
Computes m := m1 ⊕ k1
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
16. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued fraction cipher
Khinchin’s Attack
Applications
Efficiency analysis
Table: Comparison with Blum-Blum-Shub.
Number of bits producted Computing time in seconds
BBS 150000 2.358
Our algorithm 150000 0.007
We worked with an irrational X ∈ Γ, and the number of digits of
the partial numerator (bi ’s) was around 5000. For BBS, n had 949
digits, the results are listed below.
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
17. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued fraction cipher
Khinchin’s Attack
Applications
Khinchin
Aleksandr Khinchin proved in 1935 that for almost all real numbers
x, the infinitely many partial quotients ai of the continued fraction
expansion of x have an astonishing property: their geometric mean
is a constant, known as Khinchin’s constant, which is independent
of the value of x. That is, for
x = a1 +
1
a2 +
1
...
lim
n→∞
n
i=1
ai
1/n
= K ≈ 2, 6854520010 . . .
where K is Khinchin’s constant.
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
18. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued fraction cipher
Khinchin’s Attack
Applications
Khinchin’s Attack
The attacker Eve needs the cipher only to find a part of the
message in these following steps:
Eve eavesdrops a long cipher text Tn, splits it in bytes and
computes
K1 = lim
n→∞
n
i=1
di
1/n
.
where di is the integer corresponding to the byte i.
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
19. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued fraction cipher
Khinchin’s Attack
Applications
Example of Khinchin’s Attack on π
The first partial quotients of π are :
[3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 2, 1, 1, 2, 2...]
17
i=1
ai
1/17
≈ 2.6929721 . . .
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
20. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued fraction cipher
Khinchin’s Attack
Applications
Example of Khinchin’s Attack on π
The first partial quotients of π are :
[3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 2, 1, 1, 2, 2...]
17
i=1
ai
1/17
≈ 2.6929721 . . .
let’s suppose that the plaintext is 11111111111111111.
keystream : 0111 1111 0001 100100100 .....0010 0010
plaintext : 0001 0001 0001 0001 .....0001 0001
cipher : 0110 1110 0000 100100101 ....0011 0011
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
21. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued fraction cipher
Khinchin’s Attack
Applications
Example of Khinchin’s Attack on π
The first partial quotients of π are :
[3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 2, 1, 1, 2, 2...]
17
i=1
ai
1/17
≈ 2.6929721 . . .
let’s suppose that the plaintext is 11111111111111111.
keystream : 0111 1111 0001 100100100 .....0010 0010
plaintext : 0001 0001 0001 0001 .....0001 0001
cipher : 0110 1110 0000 100100101 ....0011 0011
In base 10, the cipher will be: 6 14 1 293 1 1 1 3 1 2 1 15 3 1
1 3 3.
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
22. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued fraction cipher
Khinchin’s Attack
Applications
Khinchin’s Attack
Eve computes the geometric mean of the cipher:
(6∗14∗1∗293∗1∗1∗1∗3∗1∗2∗1∗15∗3∗1∗1∗3∗3)(1/17)
= 2.867
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
23. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued fraction cipher
Khinchin’s Attack
Applications
Khinchin’s Attack
Eve computes the geometric mean of the cipher:
(6∗14∗1∗293∗1∗1∗1∗3∗1∗2∗1∗15∗3∗1∗1∗3∗3)(1/17)
= 2.867
Eve Makes a conclusion, for example there are a lot of zeros
in the plain text.
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
24. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued fraction cipher
Khinchin’s Attack
Applications
Khinchin’s Attack
Eve computes the geometric mean of the cipher:
(6∗14∗1∗293∗1∗1∗1∗3∗1∗2∗1∗15∗3∗1∗1∗3∗3)(1/17)
= 2.867
Eve Makes a conclusion, for example there are a lot of zeros
in the plain text.
She modifies the cipher and computes the geometric mean of
the new cipher
K2 = (6 ∗ 14 ∗ 1 ∗ 292 ∗ · · · ∗ 2)(1/17)
= 2.595
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
25. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued fraction cipher
Khinchin’s Attack
Applications
Khinchin’s Attack
Eve computes the geometric mean of the cipher:
(6∗14∗1∗293∗1∗1∗1∗3∗1∗2∗1∗15∗3∗1∗1∗3∗3)(1/17)
= 2.867
Eve Makes a conclusion, for example there are a lot of zeros
in the plain text.
She modifies the cipher and computes the geometric mean of
the new cipher
K2 = (6 ∗ 14 ∗ 1 ∗ 292 ∗ · · · ∗ 2)(1/17)
= 2.595
. . .
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
26. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued fraction cipher
Khinchin’s Attack
Applications
Applications
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
27. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued fraction cipher
Khinchin’s Attack
Applications
Applications
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
28. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued fraction cipher
Khinchin’s Attack
Applications
Conclusion
1 Goal 1: I tried to find new techniques using continued
fraction in cryptography.
2 Goal 2: I was interested in finding new methods of
cryptanalysis.
3 Goal 3: I tried to create a renewal of interest around
continued fractions.
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
29. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued fraction cipher
Khinchin’s Attack
Applications
Conclusion
1 Goal 1: I tried to find new techniques using continued
fraction in cryptography.
Result: I designed a new pseudo random generator
statistically tested.
2 Goal 2: I was interested in finding new methods of
cryptanalysis.
3 Goal 3: I tried to create a renewal of interest around
continued fractions.
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
30. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued fraction cipher
Khinchin’s Attack
Applications
Conclusion
1 Goal 1: I tried to find new techniques using continued
fraction in cryptography.
Result: I designed a new pseudo random generator
statistically tested.
2 Goal 2: I was interested in finding new methods of
cryptanalysis.
Result: I designed a weak version which can be attacked by
the Khinchin constant.
3 Goal 3: I tried to create a renewal of interest around
continued fractions.
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
31. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
Continued fraction cipher
Khinchin’s Attack
Applications
Conclusion
1 Goal 1: I tried to find new techniques using continued
fraction in cryptography.
Result: I designed a new pseudo random generator
statistically tested.
2 Goal 2: I was interested in finding new methods of
cryptanalysis.
Result: I designed a weak version which can be attacked by
the Khinchin constant.
3 Goal 3: I tried to create a renewal of interest around
continued fractions.
Result: I introduced the works of Khinchin, Kuzmin, Levy, and
Lochs in cryptology.
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph
32. Outline
Introduction
Continued Fractions
On the use of continued fractions for stream cipher
Questions
For your attention
Thank you!
Amadou Moctar Kane Presentation: On the use of continued fractions for stream ciph