ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Stream ciphers based on the mathematical
structure underlying the 3 body problem.
Author : Samir Bouftass , Independant crypto researcher
E-mail : crypticator@gmail.com
Stream cipher ?
1 - Key Stream Generation :
2 - Encryption :
3 ¨C Decryption :
A KeyStream K should fulfill this condition :
The three body problem :
If we perform measurements after a time intervall T :
A mod¨¦lisation of three body problem could be useful to crypto
algorithmes design.
A General Stream cipher algorithm :
Input Data :
Secret Key : Sk.
Plain Text : M = [ m_0¡­.m_n] .
Intermediate Data :
Internal State : S = [s_0¡­..s_n] .
KeyStream : K = [k_0¡­.k_n].
Output Data :
Cipher Text : C = [c_0¡­..c_n] .
State Initialization :
s_0 = Initialize( Sk ).
Encryption/Decryption loop :
For i = 0 to n do
s_(i+1) = F ( s_i )
k_i = G ( s_(i+1) )
c_i = k_i xor p_i
The mathematical structure underlying the three body problem.
The mathematical structure :
Set S ={ [(p1_0,f1_0),(p2_0,f2_0),(p3_0,f3_0)] ¡­
[(p1_i,f1_i),(p2_i,f2_i),(p3_i,f3_i)] ¡­
[(p1_n,f1_n),(p2_n,f2_n),(pi_n,fi_n)] }
Caracterized by following rules :
f1_i+1 = F1(p2_i , p3_i )
f2_i+1 = F2(p3_i , p1_i )
f3_i+1 = F3(p1_i , p2_i )
p1_i+1 = G1(f1_i+1 )
p2_i+1 = G2(f2_i+1 )
p3_i+1 = G3(f3_i+1 )
A General Stream cipher algorithm based on the mathematical
structure underlying the three body problem :
Input Data :
Secret Key : Sk.
Plain Text : M = [ m_0¡­.m_n] .
Intermediate Data :
Internal State : S = { [(p1_0,f1_0),(p2_0,f2_0),(p3_0,f3_0)] ¡­..
[(p1_n,f1_n),(p2_n,f2_n),(p3_n,f3_n)] }
Key Stream : K = [k_0¡­.k_n].
Output Data :
Cipher Text: C = [c_0¡­..c_n].
State Initialization :
s_0 =[(p1_0,f1_0),(p2_0,f2_0),(p3_0,f3_0)] = Initialize(Cs ).
Encryption/Decryption loop :
For i = 0 to n do
f1_i+1 = F1(p2_i , p3_i )
f2_i+1 = F2(p3_i , p1_i )
f3_i+1 = F3(p1_i , p2_i )
p1_i+1 = G1(f1_i+1 )
p2_i+1 = G2(f2_i+1 )
p3_i+1 = G3(f3_i+1 )
k_i = p1_i+1
c_i = k_i xor m_i
3XRC4 : A RC4 variant based on the mathematical structure
underlying The 3 body probl¨¨me .
RC4 Algorithm:
Secret key Sk, a componed of L bytes : K[0], ¡­, K[L-1].
Initialization :
for i : 0 to 255
S[i] : i.
j : 0
for i : 0 to 255
j : ( j + S[i] + K[i mod L ] ) mod 256
swap S[i] and S[j]
Encryption / Decryption Loop :
i : 0 , j : 0
for i : 0 to n
i : ( i+1 ) mod 256
j : ( j+S[i] ) mod 256
swap S[i] and S[j].
k_i+1 = S[( S[i] + S[j] ) mod 256 ]
c_i = k_i+1 xor m_i.
3XRC4
L¡¯algorithme 3XRC4 :
Secret Key Sk =[K1, K2, K3] , Ki=1..3 a componed of L bytes : ki[0], ¡­, ki[L-1].
Initialization :
for i : 0 to 255
S1[i] : S2[i] : S3[i] : i .
u : v : w : 0
for i : 0 to 255
u : ( u + S2[S3[i]] + K1[ i mod L ] ) mod 256
swap S1[i] and S1[u]
v : ( v + S3[S1[i]] + K2[ i mod L ] ) mod 256
swap S2[i] and S2[v]
w : ( w + S3[S1[i]] + K3[ i mod L ] ) mod 256
swap S3[i] and S3[v]
Encryption / Decryption Loop :
i : u : v : w :0
for i = 0 to n
i : ( i+1 ) mod 256
u : ( u+S2[S3[i]] ) mod 256
swap S1[i] and S1[u]
v : ( v+S3[S1[i]] ) mod 256
swap S2[i] and S2[v]
w : ( w+S1[S2[i]] ) mod 256
swap S3[i] and S3[w]
k_i+1 = S2[S3[( S1[i] + S1[u] ) mod 256 ]]
c_i = k_i+1 xor m_i.

More Related Content

3XRC4

  • 1. Stream ciphers based on the mathematical structure underlying the 3 body problem.
  • 2. Author : Samir Bouftass , Independant crypto researcher E-mail : crypticator@gmail.com
  • 4. 1 - Key Stream Generation :
  • 7. A KeyStream K should fulfill this condition :
  • 8. The three body problem :
  • 9. If we perform measurements after a time intervall T :
  • 10. A mod¨¦lisation of three body problem could be useful to crypto algorithmes design.
  • 11. A General Stream cipher algorithm : Input Data : Secret Key : Sk. Plain Text : M = [ m_0¡­.m_n] . Intermediate Data : Internal State : S = [s_0¡­..s_n] . KeyStream : K = [k_0¡­.k_n]. Output Data : Cipher Text : C = [c_0¡­..c_n] .
  • 12. State Initialization : s_0 = Initialize( Sk ). Encryption/Decryption loop : For i = 0 to n do s_(i+1) = F ( s_i ) k_i = G ( s_(i+1) ) c_i = k_i xor p_i
  • 13. The mathematical structure underlying the three body problem.
  • 14. The mathematical structure : Set S ={ [(p1_0,f1_0),(p2_0,f2_0),(p3_0,f3_0)] ¡­ [(p1_i,f1_i),(p2_i,f2_i),(p3_i,f3_i)] ¡­ [(p1_n,f1_n),(p2_n,f2_n),(pi_n,fi_n)] } Caracterized by following rules : f1_i+1 = F1(p2_i , p3_i ) f2_i+1 = F2(p3_i , p1_i ) f3_i+1 = F3(p1_i , p2_i ) p1_i+1 = G1(f1_i+1 ) p2_i+1 = G2(f2_i+1 ) p3_i+1 = G3(f3_i+1 )
  • 15. A General Stream cipher algorithm based on the mathematical structure underlying the three body problem : Input Data : Secret Key : Sk. Plain Text : M = [ m_0¡­.m_n] . Intermediate Data : Internal State : S = { [(p1_0,f1_0),(p2_0,f2_0),(p3_0,f3_0)] ¡­.. [(p1_n,f1_n),(p2_n,f2_n),(p3_n,f3_n)] } Key Stream : K = [k_0¡­.k_n]. Output Data : Cipher Text: C = [c_0¡­..c_n].
  • 16. State Initialization : s_0 =[(p1_0,f1_0),(p2_0,f2_0),(p3_0,f3_0)] = Initialize(Cs ). Encryption/Decryption loop : For i = 0 to n do f1_i+1 = F1(p2_i , p3_i ) f2_i+1 = F2(p3_i , p1_i ) f3_i+1 = F3(p1_i , p2_i ) p1_i+1 = G1(f1_i+1 ) p2_i+1 = G2(f2_i+1 ) p3_i+1 = G3(f3_i+1 ) k_i = p1_i+1 c_i = k_i xor m_i
  • 17. 3XRC4 : A RC4 variant based on the mathematical structure underlying The 3 body probl¨¨me .
  • 18. RC4 Algorithm: Secret key Sk, a componed of L bytes : K[0], ¡­, K[L-1]. Initialization : for i : 0 to 255 S[i] : i. j : 0 for i : 0 to 255 j : ( j + S[i] + K[i mod L ] ) mod 256 swap S[i] and S[j]
  • 19. Encryption / Decryption Loop : i : 0 , j : 0 for i : 0 to n i : ( i+1 ) mod 256 j : ( j+S[i] ) mod 256 swap S[i] and S[j]. k_i+1 = S[( S[i] + S[j] ) mod 256 ] c_i = k_i+1 xor m_i.
  • 22. Secret Key Sk =[K1, K2, K3] , Ki=1..3 a componed of L bytes : ki[0], ¡­, ki[L-1]. Initialization : for i : 0 to 255 S1[i] : S2[i] : S3[i] : i . u : v : w : 0 for i : 0 to 255 u : ( u + S2[S3[i]] + K1[ i mod L ] ) mod 256 swap S1[i] and S1[u] v : ( v + S3[S1[i]] + K2[ i mod L ] ) mod 256 swap S2[i] and S2[v] w : ( w + S3[S1[i]] + K3[ i mod L ] ) mod 256 swap S3[i] and S3[v]
  • 23. Encryption / Decryption Loop : i : u : v : w :0 for i = 0 to n i : ( i+1 ) mod 256 u : ( u+S2[S3[i]] ) mod 256 swap S1[i] and S1[u] v : ( v+S3[S1[i]] ) mod 256 swap S2[i] and S2[v] w : ( w+S1[S2[i]] ) mod 256 swap S3[i] and S3[w] k_i+1 = S2[S3[( S1[i] + S1[u] ) mod 256 ]] c_i = k_i+1 xor m_i.