Numeric Base Recursive Builder Algorithm

This is the Main Base Builder Recursive Generator Algorithm

Algorithm

This is the main Base Table Builder Algorithm. The algorithm is ruled by these following steps :

• Init time : I init Time variable using the time library from Python

• First Step Base Table : This is the first step of the builder, I build the basic table from the tablebase function • First level of recursivity : I build the first level of recursivity in safe mode using recursive_build function

• Full Recursive algorithm : We get the full computation of the table via the recursive_build_sup_lvl method.

• Time calculation : Computation of necessary time for the construction of the full array Returns list of list : A list of list containing all the string values representing the full generateed Base Table array 1.1.2 Source Code def table(): rec_level_h = [6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,4,4,4,4,4,4,4,4,4] rec_level_m = [5,5,5,5,5,4,4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3] rec_level_l = [4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3] table = [] bases = [] tmp = () ok = 0 mini =11 mytime = 0 fini = 0 finalt = 0 initt =time.time() # Construction algorithm using recursivity to build the nearest max_int bound␣ ˓→tables (never equal 4 000 000 000...)

for i in range (mini,37): ind = 1 ok = 0 bases.append(tablebase(i))

Algorithm

This method allow to build the first step Numeric Base Transposition Table . I use the Horner's scheme procedure to build the correct table independantly of the base index. I can build Base from 1->a to 1->z, mean Base11 to Base36.

Parameters Type Description base int

The base index to build

Returns list : The builded first step base table.

Source Code

Algorithm

The variable indeice correspond to the pow index of the current recursive build. The current argument contain the current Base Tale array as list. Using once again the Horner's scheme, we can build each sup level without be limited by internal constraints.

Parameters Type

Algorithm

The recursive_build_sup_lvl method is used to manage recursivity of the algorithm. I mean i have wrote the iterative version of the recursive function. So you can easely use it and control it.

Parameters

Description of Crypter

Welcom to Raptor cryptographic help This following instructions give you the full light on the given cryptographic algorithm "Raptor". In a firts time I will explain the main algorithm rules. Each of the function used can be found on the full source code and have a dedicated help section.

Description of the Main Raptor's Cryptographic Algorithm

Algorithm

This is the main algorithm of the program. It allows from a system argv string to crypt it and get a string,key couple as result. We will use this following variables to make it work :

• table2 : A list of list containing all the necessary Base table from Base 11 to Base 37

• Basemin : 2 as default, it means the minimum base index to generate

• Basemax : 37 as default, it means the maximum base index to generate

• chaine : The string chain to crypt as system argv argument

• choice : A choice variable to manage the main loop (continue or quit)

• Range : Define the range of values generate into the corresponding Numeric Base a the begining

The return of the algorithm is ruled by the fllowing variables:

• testkey : The final half key as key

• raw_txt : The final crypted strin as string.

The alorithm is ruled by the following steps :

• Generating the first step Base • I crypt the string using the crypt_procedure function. The return is a couple (crypt text / key) wich allow to decrypt it.

• The crypt_final method allow us to organise the crypt list into interpretables results. We store results in variables:

-raw_txt : Contains the raw crypted text as string -testkey : Contains the half key as str(int)

This algorithm is stable in his domain and must be used on it. Please not to try bigger data slice and automate it via shell script if necessary. It should be used as a data crypter using a top level slicer and manager (from the shell script as exemple).

See source below to more explanation. for i in range (0,len(table2)):

Source Code

table2[i]=splitTable(table2[i])
for j in range (0,len(table2)): table2 --------------------------------------------------------------------------˓→--------") print("Chaine cryptée : \n") print(raw_txt) print(" --------------------------------------------------------------------------˓→--------") print("Clé unique : \n") print(testkey) print(" --------------------------------------------------------------------------˓→--------") clean_txt = decrypt_procedure(raw_txt,testk,table2) print("Chaine décryptée : \n") print(clean_txt) choice=input("c)ontinuer ou q)uitter?")

10

Chapter 2. Raptor Cryptographic Algorithm v1

Description of De-crypter

Description of the Main Raptor's Cryptographic Algorithm

Algorithm

This is the main solver algorithm program. It allow us to decrypt datas slices crypted with the version 1 of the Raptor Cryptographic Algorithm. To solve I need thse following variables :

• chaine : The input crypted string storage

• Basemin : The minimum Base index

• Basemax : The maximum Base index

• table2 : The list of list containing the Base Table

• finalkey : The key of the algorithm, the decrypting process absolutely need this key.

The solving procedure is ruled by the following steps:

• Generating the Base Table and store it into my table2 variable

• Getting inputs known as crypted string and his associated key.

• Decrypting process using the decrypt_procedure method (see documentation)

• Store and return the results of decrypting process

Source Code

import sys import math as m represent='' table2 = [] dic = {} main_dic={} choice = ' ' chaine='' print("---------------------------------------------------------------------------------- for i in range (0,len(table2)):

table2[i]=splitTable(table2[i])
for j in range (0,len(table2)): table2[j]=rec_table_construct_lvl1(table2[j],j+2,1,0) for k in range(0,j+2):

table2[j][k]=(str(0)+table2[j][k]) table2 = rec_manage(table2)
finalke=[] while(choice!='q'):

finalke[:]=[] finalkey='' decrypt='' chaine=input("Veuillez entrer la chaine cryptée : \n") print("--------------------------------------------------------------------------˓→--------")

finalkey= input("Veuillez saisir la clé : \n") finalke = miam(finalkey) decrypt = decrypt_procedure(chaine,finalke,table2) print("--------------------------------------------------------------------------˓→--------")

print("Chaine decryptée : ") print(decrypt) choice=input("c)ontinuer ou q)uitter ?")

12

Chapter 2. Raptor Cryptographic Algorithm v1 2.3 reverse def reverse(s)

Algorithm

A function to reverse a string as argument.

Parameter Type Description s

String The string to reverse

[i][:] table2=rec_table_construct_lvl1(table2,i+2,1,0) table2=rec_table_construct_final(table2,i+2,1) table2=rec_table_construct_final(table2,i+2,2) if(i<20): table2=rec_table_construct_final(table2,i+2,3) table[i]=table2[:] return table

ascii_to_int

def ascii_to_int(chaine)

Algorithm

Utils method : ascii to integer converter.

Parameters Type Description chaine str

The string to convert Returns list : A list containing all integers values since ASCII.

Source Code

Algorithm

Utils method : integer to ascii converter.

Description Type Description crypt int

The int list to convert

Returns str : The converted ASCII string since int list.

Source Code

Algorithm

The simple method to crypt an ascii string as integer list.

Parameters Type Description to_crypt int list

The converted int list since an ascii string

Algorithm

This is the key builder.

Parameters Type Description int_chaine

int list The base index list as a starting builder for key

Returns int list : the builded key from index base list.

Source Code

res=[] for i in range (0,len(int_chaine

)): tmp=((int_chaine[i]*int_chaine[len(int_chaine)-i-1]+10)%36) if (

Algorithm

Algorithm

Algorithm

A method to transpose an integer list to the corresponding key's base index => The result will be a succession of transposed values from differents integers to differents base

Algorithm

The inverse method to decrypt a str list of base transposed values

Algorithm

The crypter manager to orchestrate the crypting procedure. It works from these steps:

• We convert the given ascii string as integer list

• We compute the Base index list as key from the converted integer list

• We build the second part of the key since the mirror of the Base index list

• We compute the cumulated weight of the integer list

• We compute the point by point multiplication between cumulated weigth list and original integer list

• We transpose the multiplied list into the given specified Base from the key

Algorithm

The layout procedure to organise crypting results.

Parameters

Algorithm

This method allow us to rebuild a str list of crypted terms using separators set.

Parameters

Algorithm

This method compute the chained 2nd order equations to solve the numeric suit. It permit us to get the ASCII values as a list. To solve the system you have to instance the solver with the square root of term 0. Once theorem zero done, you will apply the equation solver with square root of the 0-term as b, a as 1 and c as -following term. The algorithm sort the roots and take only positives ones.

Parameters

Algorithm

This method manage the decrypting procedure. It is ruled by the following steps :

• Build the full key since the key argument

• Split the string since separators via slurp method

• Apply the inv_tranpose_base method to get the uncrypted terms

• Solve the cumulated multiplued weigth with the equation solver

Description of Crypter

Welcome to Raptor cryptographic help This following instructions give you the full light on the given cryptographic algorithm "Raptor". In a firts time I will explain the main algorithm rules. Each of the function used can be found on the full source code and have a dedicated help section.

Description of the Main Raptor's Cryptographic Algorithm

Algorithm

This is the main algorithm of the program. It allows from a system argv string to crypt it and get a string,key couple as result. We will use this following variables to make it work :

• table2 : A list of list containing all the necessary Base table from Base 11 to Base 37

• Basemin : 2 as default, it means the minimum base index to generate • Basemax : 37 as default, it means the maximum base index to generate

• chaine : The string chain to crypt as system argv argument

• choice : A choice variable to manage the main loop (continue or quit)

• Range : Define the range of values generate into the corresponding Numeric Base a the begining The return of the algorithm is ruled by the following variables:

• testkey : The final half key as key

• raw_txt : The final crypted strin as string.

The alorithm is ruled by the following steps : • Split : I crypt the data string as input using slices of the string vector. Using a loop, I will crypt each slices independantly from each others. It permits us to have a full crypted string more complex than the first version of algorithm

• Crypting Slices : Once each slices properly cutted, we have to crypt each of them using the crypt_procedure automated on a loop coursing each of them.

• Manage Slices : The crypted slices are managed via a second level separators set wich define a second level of crypting tree. In fact each term of a slice is using a first level of separators, it give a one-level tree. The second level permit to complexify the full algorithm result.

• Rebuild results : Finally, the crypt_procedure function is used to associate each crypted slice to his key and draw a correct interpretated result as list of couple (crypted string/integer key)

• Return results : The couple full result rebuilded from slices couple is organized from the second level separators to draw a 2-level tree 40 Chapter 3. Raptor Cryptographic Algorithm v2

This algorithm is stable in his domain and must be used on it. Please not to try bigger data slice and automate it via shell script if necessary. It should be used as a data crypter using a top level slicer and manager (from the shell script as exemple).

See source below to more explanation.

Source Code

for i in range (0,len(table2)): table2[i]=splitTable(table2[i])
for j in range (0,len(table2)): table2 #definition of sets sep=['!','"','#','$','%','&','(',')','*','+',',','-','.','/'] sep_lvl2=[":",";","<","=",">","?","@"] long_chaine print("Chaine décryptée : \n") print(clean_txt) choice=input("c)ontinuer ou q)uitter") if(choice!='q'): userchoice+=1

[j]=rec_table_construct_lvl1(table2[j],j+2,1,0) for k in range(0,j+2): table2[j][k]=(str(0)+table2[j][k]) table2=rec_manage(table2)
= [] long_crypt = [] testc = [] testk = [] int_chaine = [] lvl2_key_miam = [] #main algorithm while(choice!='q'): # init_all() current_sep_lvl2 = ":" long_chaine[:] = [] long_crypt[:] = [] testc[:] = [] testk[:] = [] int_chaine[:] = [] lvl2_key_miam[:] = [] testkey='' raw_txt='' clean_txt = '' longi = 0 res = () if(
3.1. Description of Crypter

Description of De-crypter

Description of the Main Raptor's Cryptographic Algorithm

Algorithm

This is the main solver algorithm program. It allow us to decrypt datas slices crypted with the version 1 of the Raptor Cryptographic Algorithm. To solve I need thse following variables :

• raw_txt : The input crypted string storage

• Basemin : The minimum Base index

• Basemax : The maximum Base index

• table2 : The list of list containing the Base Table

• testkey : The key of the algorithm, the decrypting process absolutely need this key.

The solving procedure is ruled by the following steps:

• Generating the Base Table and store it into my table2 variable

• Getting inputs known as crypted string and his associated key.

• Decrypting process using the decrypt_procedure method (see documentation)

• Store and return the results of decrypting process for i in range (0,len(table2)):

Source Code

table2[i]=splitTable(table2[i])
for j in range (0,len(table2)):

table2[j]=rec_table_construct_lvl1(table2[j],j+2,1,0) for k in range(0,j+2): table2[j][k]=(str(0)+table2[j][k]) table2=rec_manage(table2) #second level local declaration long_chaine = [] long_crypt = [] longi=0 seuil = 20 choice = '' userchoice=0
#definition of sets sep=['!','"','#','$','%','&','(',')','*','+',',','-','.','/'] sep_lvl2=[":",";","<","=",">","?","@"] long_chaine

= [] long_crypt = [] testc = [] testk = [] int_chaine = [] lvl2_key_miam = [] #main algorithm while(choice!='q'): # init_all() current_sep_lvl2 = ":" long_chaine[:] = [] long_crypt[:] = [] testc[:] = [] testk[:] = [] int_chaine[:] = [] lvl2_key_miam[:] = [] testkey='' raw_txt='' clean_txt = '' longi = 0 (continues on next page) 3.2. Description of De-crypter res = () raw_txt=input('Chaine cryptée : ') testkey=input('Clé unique : ') if(len(raw_txt)>=120): longi=1 if(not longi): testkey=miam(testkey) clean_txt = decrypt_procedure(raw_txt,testkey,table2) else: lvl2_liste = [] lvl2_key = [] lvl2_liste = slurp2(raw_txt) lvl2_key = slurp2(testkey) lvl2_key_miam = [] for i in range (0,len(lvl2_key)): lvl2_key_miam.append(miam(lvl2_key[i])) for i in range (0,len(lvl2_liste)-1): clean_txt+= decrypt_procedure(lvl2_liste[i],lvl2_key_miam[i], ˓→table2)
print("Chaine décryptée : \n") print(clean_txt) choice=input("c)ontinuer ou q)uitter") if(choice!='q'): userchoice+=1 46 Chapter 3. Raptor Cryptographic Algorithm v2

reverse

def reverse(s)

Algorithm

A function to reverse a string as argument.

Parameter Type Description s

String The string to reverse

Returns str : The reversed string

Source Code

str= "" for i in s: str=i+str return str 3.3. reverse

splitTable

def splitTable(table)

Algorithm

Split a string as array from the given separator.

Parameters

[i][:] table2=rec_table_construct_lvl1(table2,i+2,1,0) table2=rec_table_construct_final(table2,i+2,1) table2=rec_table_construct_final(table2,i+2,2) table[i]=table2[:] for i in range (9,18): j=3 table2=table[i][:] while(len(table2)<1000000): table2=rec_table_construct_final(table2,i+2,j) j+=1 table[i]=table2[:] return table 3.8. rec_manage

ascii_to_int

def ascii_to_int(chaine)

Algorithm

Utils method : ascii to integer converter.

Parameters Type Description chaine str

The string to convert

Returns list : A list containing all integers values since ASCII.

Source Code res = []

for letter in chaine: res.append(ord(letter)) return res

54

Chapter 3. Raptor Cryptographic Algorithm v2

int_to_ascii

def int_to_ascii(crypt)

Algorithm

Utils method : integer to ascii converter.

Description Type Description crypt

int list The int list to convert

Returns str : The converted ASCII string since int list.

Source Code

res = '' for i in range (0,len(crypt)): res+=chr(crypt[i]) return res 3.10. int_to_ascii

cryptChaine

def cryptChaine(to_crypt,table,base)

Algorithm

The simple method to crypt an ascii string as integer list.

Parameters Type Description to_crypt int list

The converted int list since an ascii string

Algorithm

Utils method : A method to limit the Base range

Parameters Type Description Range int

The range as a limit base int The current Base index

Returns int : The limited by range res.

Source Code

Algorithm

This is the key builder.

Parameters Type Description int_chaine

int list The base index list as a starting builder for key

Returns int list : the builded key from index base list.

Source Code

res=[] for i in range (0,len(int_chaine)): tmp=((int_chaine[i]*int_chaine[len(int_chaine)-i-1]+10)%36) if(tmp<10):

vec_1_poids

def vec_1_poids(vec_poids)

Algorithm

Compute the inverse of the vectorial cumulated weigth computation.

Parameters Type Description vec_poids int list The weigth as an integer list

Returns int list : The computed list containing the inverse operation of vec_poids method

Source Code

res=[] for i in range (0,len(vec_poids)): res.append(1/vec_poids[i]) return res 3.16. vec_1_poids 3.17 equa_2_nd def equa_2_nd(a,b,c)

Algorithm

Algorithm

A method to transpose an integer list to the corresponding key's base index => The result will be a succession of transposed values from differents integers to differents base

Algorithm

The inverse method to decrypt a str list of base transposed values

Parameters

Algorithm

The crypter manager to orchestrate the crypting procedure. It works from these steps:

• We convert the given ascii string as integer list

• We compute the Base index list as key from the converted integer list

• We build the second part of the key since the mirror of the Base index list

• We compute the cumulated weight of the integer list

• We compute the point by point multiplication between cumulated weigth list and original integer list

• We transpose the multiplied list into the given specified Base from the key

Algorithm

Compute a cyclik ascii separators into ponctuation signs. Get a second cyclic ascii set modulo length

Parameters Type Description current str

The current poncuation separator

Returns str : The following separator from the defined 'sep' Set.

Source Code

sep=[":",";","<","=",">","?","@"] tmp=((sep.index(current)+1)%6) res =sep[tmp] return res 68 Chapter 3. Raptor Cryptographic Algorithm v2

crypt_final

def crypt_final(tuple)

Algorithm

The layout procedure to organise crypting results.

Parameters

Algorithm

This method allow us to rebuild a str list of crypted terms using separators set.

Parameters Type

Algorithm

This method is similar of the slurp method. It defined a second level of crypting management.

Parameters Type Description chaine str

The raw string crypted message

Returns str list : The list of crypted terms rebuilded from the raw string.

Source Code

tmp='' res = [] sep=[":",";","<","=",">","?","@"] for elem in chaine:

Algorithm

This method compute the chained 2nd order equations to solve the numeric suit. It permit us to get the ASCII values as a list. To solve the system you have to instance the solver with the square root of term 0. Once theorem zero done, you will apply the equation solver with square root of the 0-term as b, a as 1 and c as -following term. The algorithm sort the roots and take only positives ones.

Parameters Type

Description liste int list The computed multiplied list to solve Returns int list : A list containing solved terms.

Source Code

Algorithm

This method manage the decrypting procedure. It is ruled by the following steps :

• Build the full key since the key argument

• Split the string since separators via slurp method

• Apply the inv_tranpose_base method to get the uncrypted terms

• Solve the cumulated multiplied weigth with the equation solver

Algorithm

The reverse method of the split function.

Description of Crypter

Welcom to Raptor cryptographic help This following instructions give you the full light on the given cryptographic algorithm "Raptor". In a firts time I will explain the main algorithm rules. Each of the function used can be found on the full source code and have a dedicated help section.

Description of the Main Raptor's Cryptographic Algorithm

Algorithm

This is the main algorithm of the program. It allows from a system argv string to crypt it and get a string,key couple as result. We will use this following variables to make it work :

• table2 : A list of list containing all the necessary Base table from Base 11 to Base 37

• Basemin : 2 as default, it means the minimum base index to generate • Basemax : 37 as default, it means the maximum base index to generate

• chaine : The string chain to crypt as system argv argument

• choice : A choice variable to manage the main loop (continue or quit)

• Range : Define the range of values generate into the corresponding Numeric Base a the begining The return of the algorithm is ruled by the following variables:

• testkey : The final half key as key

• raw_txt : The final crypted strin as string. This is the main Raptor Cryptographic Algorithm v3. It is ruled by the following steps :

• Initialization of differents variables and of the Base table via the table generator methods

• Splitting part of the given raw string as input. This string will be splitted into differents slices, wiche be crypted one by one and associated to his key via the third level separators wich define the third level of the crypting tree.

• Crypting procedure for each of the slices obtained by the split method above. These crypted results will be stored as a list of list, respectively a list of slices, defined by a list of crypted terms.

• Manage the results via slurp2 and slurp3 methods. The results are properly stored at this time to be correctly interpreted later.

• Give a wrong path for decrypting using some fake values to both of crypted txt and key as strings. It means any Brute force attack will be ignored.

• Returns the couple (crypt txt, key) wich is efficient to be decrypted by the solver.

This algorithm is stable in his domain and must be used on it. Please not to try bigger data slice and automate it via shell script if necessary. It should be used as a data crypter using a top level slicer and manager (from the shell script as exemple).

See source below to more explanation. for i in range (0,len(table2)):

table2[i]=splitTable(table2[i])
for j in range (0,len(table2)): table2 '"','#','$','%','&','(',')','*','+',',','-','.','/'] sep_lvl2=[":",";","<","=",">","?","@"] sep_lvl3=['A','B','C','D','E','F','G','H','I','J','K','L'] mesquin=['M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] (continues on next page)

[j]=rec_table_construct_lvl1(table2[j],j+2,1,0) for k in range(0,j+2): table2[j][k]=(str(0)+table2[j][k]) table2=rec_manage(table2) long_chaine = [] long_crypt = [] longi=0 seuil = 20 seuil_lvl2=70 choice = '' userchoice=1 sep=['!',

Description of Crypter

(continued from previous page) for i in range (0,len(long_crypt)):

long_long_chaine = [] tmp_long_chaine = [] long_chaine = [] long_crypt = [] testc = [] testk = [] int_chaine = [] lvl2_key_miam = [] tmp_crypt = [] while(choice!='q'): # init_all() current_sep_lvl3 = "A" current_sep_lvl2 = ":" long_chaine = [] long_crypt = [] long_long_crypt = [] testc = [] testk = [] int_chaine = [] lvl2_key_miam = [] long_long_chaine = [] tmp_long_chaine = [] tmp_crypt = () testkey='' raw_txt='' clean_txt = '' longi = 0 longii= 0 res = () if(
for j in range(0,len(long_crypt[i][0])): testc.append(str(long_crypt[i][0][j])) for k in range(0,len(long_crypt[i][1])): testk.append(str(long_crypt[i][1][k])) current_sep_lvl2=cyclik_ascii_lvl2(current_sep_lvl2) testc[-1]+=current_sep_lvl2 testk[-1]+=current_sep_lvl2 if(longii):
for l in range (0,len(long_long_crypt)):

for j in range(0,len(long_long_crypt

[l][0])): testc.append(str(long_long_crypt[l][0][j])) for k in range(0,len(long_long_crypt[l][1])): testk.append(str(long_long_crypt[l][1][k])) current_sep_lvl2=cyclik_ascii_lvl2(current_sep_lvl2) testc[-1]+=current_sep_lvl2 testk[-1]+=current_sep_lvl2 if(len(long_long_crypt[l][0])<seuil): current_sep_lvl3=cyclik_ascii_lvl3(current_sep_ ˓→lvl3) testc[-1]+=current_sep_lvl3 testk[-1]+=current_sep_lvl3 int_chaine=(ascii_to_int(chaine)) for i in range(0,len(testk)): testkey+=str(testk[i])
if(not longi and not longii): raw_txt = crypt_final(res,int_chaine) else:

raw_txt += crypt_final_long(testc,int_chaine) raw_txt=mesqui(raw_txt,seuil) testkey=mesqui(testkey,seuil) print("Chaine cryptée : \n") print(raw_txt) print("Clé unique : \n") print(testkey) choice=input("c)ontinuer ou q)uitter") if(choice!='q'): userchoice+=1

4.1. Description of Crypter

Description of De-crypter

Description of the Main Raptor's Cryptographic Algorithm

Algorithm

This is the main solver algorithm program. It allow us to decrypt datas slices crypted with the version 1 of the Raptor Cryptographic Algorithm. To solve I need thse following variables :

• raw_txt : The input crypted string storage

• Basemin : The minimum Base index

• Basemax : The maximum Base index

• table2 : The list of list containing the Base Table

• testkey : The key of the algorithm, the decrypting process absolutely need this key.

The solving procedure is ruled by the following steps:

• Generating the Base Table and store it into my table2 variable

• Getting inputs known as crypted string and his associated key.

• Organize data slice removing separators via the slurps methods

• Decrypting process using the decrypt_procedure method (see documentation) for i in range (0,len(table2)):

table2[i]=splitTable(table2[i])
for j in range (0,len(table2)): '"','#','$','%','&','(',')','*','+',',','-','.','/'] sep_lvl2=[":",";","<","=",">","?","@"] sep_lvl3=['A','B','C','D','E','F','G','H','I','J','K','L'] mesquin=['M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']

table2[j]=rec_table_construct_lvl1(table2[j],j+2,1,0) for k in range(0,j+2): table2[j][k]=(str(0)+table2[j][k]) table2=rec_manage(table2) long_chaine = [] long_crypt = [] longi=0 seuil = 20 seuil_lvl2=70 choice = '' userchoice=0 sep=['!',
long_long_chaine = [] tmp_long_chaine = [] long_chaine = [] long_crypt = [] testc = [] testk = [] int_chaine = [] lvl2_key_miam = [] tmp_crypt = [] while(choice!='q'): # init_all() current_sep_lvl3 = "A" current_sep_lvl2 = ":" long_chaine[:] = [] long_crypt[:] = [] long_long_crypt = [] testc[:] = [] testk[:] = []

Algorithm

A function to reverse a string as argument.

Parameter Type Description s

String The string to reverse

Algorithm

The simple method to crypt an ascii string as integer list.

Parameters Type Description to_crypt int list

The converted int list since an ascii string

Algorithm

Utils : An 2nd order equation solver

Parameters

Algorithm

Algorithm

A method to transpose an integer list to the corresponding key's base index => The result will be a succession of transposed values from differents integers to differents base

Algorithm

The crypter manager to orchestrate the crypting procedure. It works from these steps:

• We convert the given ascii string as integer list

• We compute the Base index list as key from the converted integer list

• We build the second part of the key since the mirror of the Base index list

• We compute the cumulated weight of the integer list

• We compute the point by point multiplication between cumulated weigth list and original integer list

• We transpose the multiplied list into the given specified Base from the key

Algorithm

Compute a cyclik ascii separators into ponctuation signs. Get a second cyclic ascii set modulo length

Parameters Type Description current str

The current poncuation separator

Returns str : The following separator from the defined 'sep' Set.

Source Code

sep=[":",";","<","=",">","?","@"] tmp=(

Algorithm

The layout procedure to organise crypting results.

Parameters Type

Algorithm

This method allow us to rebuild a str list of crypted terms using separators set.

Parameters Type

Algorithm

This method is similar of the slurp method. It defined a second level of crypting management.

Parameters Type Description chaine str

The raw string crypted message

Returns str list:

The list of crypted terms rebuilded from the raw string.

Source Code

tmp='' res = [] sep=[":",";","<","=",">","?","@"] for elem in chaine:

Algorithm

This method is similar of the slurp2 method. It defined a third level of crypting management.

Parameters Type Description chaine str

The raw string crypted message

Returns str list : The list of crypted terms rebuilded from the raw string.

Source Code

Algorithm

This method is similar of the slurp2 method. It defined a third level of crypting management.

Parameters Type Description chaine str

The raw string crypted message

Returns str list : The list of crypted terms rebuilded from the raw string.

Source Code

Algorithm

This method compute the chained 2nd order equations to solve the numeric suit. It permit us to get the ASCII values as a list. To solve the system you have to instance the solver with the square root of term 0. Once theorem zero done, you will apply the equation solver with square root of the 0-term as b, a as 1 and c as -following term. The algorithm sort the roots and take only positives ones.

Parameters Type Description liste

int list The computed multiplied list to solve Returns int list : A list containing solved terms.

Source Code

Algorithm

This method manage the decrypting procedure. It is ruled by the following steps :

• Build the full key since the key argument

• Split the string since separators via slurp method

• Apply the inv_tranpose_base method to get the uncrypted terms

Algorithm

This method is used to create a wrong path of decrypting method. Using a similar Separators terms, I define a 'fake' terms list wich have absolutely no meanings for the rest of the algorithm. Using it as the last step of algorithm, it doesn't allow any brute force attack to decrypt. The threshold value 'seuil' will define the amount of distribution of fake separators.

Parameters Type

Description of De-crypter

Welcom to Raptor cryptographic help This following instructions give you the full light on the given cryptographic algorithm "Raptor". In a firts time I will explain the main algorithm rules. Each of the function used can be found on the full source code and have a dedicated help section.

Description of the Main Raptor's Cryptographic Algorithm

Algorithm

This is the main algorithm of the program. It allows from a system argv string to crypt it and get a string,key couple as result. We will use this following variables to make it work :

• table2 : A list of list containing all the necessary Base table from Base 11 to Base 37

• Basemin : 2 as default, it means the minimum base index to generate

• Basemax : 37 as default, it means the maximum base index to generate

• chaine : The string chain to crypt as system argv argument

• choice : A choice variable to manage the main loop (continue or quit)

• Range : Define the range of values generate into the corresponding Numeric Base a the begining

The return of the algorithm is ruled by the following variables:

• testkey : The final half key as key

• raw_txt : The final crypted strin as string. This is the main Raptor Cryptographic Algorithm v3. It is ruled by the following steps :

• Initialization of differents variables and of the Base table via the table generator methods

• Splitting part of the given raw string as input. This string will be splitted into differents slices, wiche be crypted one by one and associated to his key via the third level separators wich define the third level of the crypting tree.

• Crypting procedure for each of the slices obtained by the split method above. These crypted results will be stored as a list of list, respectively a list of slices, defined by a list of crypted terms.

• Manage the results via slurp2 and slurp3 methods. The results are properly stored at this time to be correctly interpreted later.

• Give a wrong path for decrypting using some fake values to both of crypted txt and key as strings. It means any Brute force attack will be ignored.

• Returns the couple (crypt txt, key) wich is efficient to be decrypted by the solver.

This algorithm is stable in his domain and must be used on it. Please not to try bigger data slice and automate it via shell script if necessary. It should be used as a data crypter using a top level slicer and manager (from the shell script as exemple).

See source below to more explanation. ,')','*','+',',','-','.','/'] sep_lvl2=[":",";","<","=",">","?","@"] sep_lvl3=

['A','B','C','D','E','F','G','H','I','J','K','L'] mesquin=['M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] long_long_chaine = [] tmp_long_chaine = [] long_chaine = [] long_crypt = [] testc = [] testk = [] int_chaine = [] lvl2_key_miam = [] tmp_crypt = []
(continues on next page)

Description of De-crypter

(continued from previous page)

while(choice!='q'): for i in range (0,len(long_long_chaine)): for j in range(0,len(long_long_chaine[i])): tmp_crypt = crypt_procedure(long_long_

# init_all() current_sep_lvl3 = "A" current_sep_lvl2 = ":" long_chaine[:] = [] long_crypt[:] = [] long_long_crypt = [] testc[:] = [] testk[:] = [] int_chaine[:] = [] lvl2_key_miam[:] = [] long_long_chaine[:] = [] tmp_long_chaine[:] = [] tmp_crypt = () testkey = '' raw_txt = '' clean_txt = '' longi = 0 longii = 0 res = () if(userchoice): chaine = '' chaine=input("
˓→chaine[i][j],table2) long_long_crypt.append(tmp_crypt) # print(long_crypt[-1][0]) if(not longi and not longii): testc = res[0] testk = res[1] else : if (longi):
for i in range (0,len(long_crypt)):

(continues on next page)

128

Chapter 5. Raptor Cryptographic Algorithm v3.1

for j in range(0,len(long_crypt[i][0])): testc.append(str(long_crypt[i][0][j])) for k in range(0,len(long_crypt[i][1])): testk.append(str(long_crypt[i][1][k])) current_sep_lvl2=cyclik_ascii_lvl2(current_sep_lvl2) testc[-1]+=current_sep_lvl2 testk[-1]+=current_sep_lvl2 if(longii):
for l in range (0,len(long_long_crypt)):

# print(long_long_crypt[l]) for j in range(0,len(long_long_crypt[l][0])): testc.append(str(long_long_crypt[l][0][j])) for k in range(0,len(long_long_crypt[l][1])): testk.append(str(long_long_crypt[l][1][k])) current_sep_lvl2=cyclik_ascii_lvl2(current_sep_lvl2) testc[-1]+=current_sep_lvl2 testk[-1]+=current_sep_lvl2 # print("l = "+str(l)+" | len long[l] = "+str(len(long_ ˓→long_crypt[l][0]))) if(len(long_long_crypt[l][0])<seuil): current_sep_lvl3=cyclik_ascii_lvl3(current_sep_ ˓→lvl3) testc[-1]+=current_sep_lvl3 testk[-1]+=current_sep_lvl3 # print(testc) # print(testk) int_chaine=(ascii_to_int(chaine))
for i in range(0,len(testk)): testkey+=str(testk[i]) if(not longi and not longii): raw_txt = crypt_final(res,int_chaine,table2) else:

raw_txt += crypt_final_long(testc,int_chaine,table2) raw_txt=mesqui(raw_txt,seuil) testkey=mesqui(testkey,seuil) print(" ---------------------------------") print("Chaine cryptée : \n") print(raw_txt) print(" ---------------------------------") print("Clé unique : \n") print(testkey) print(" ---------------------------------") choice=input("c)ontinuer ou q)uitter") if(choice!='q'): userchoice+=1

5.1. Description of De-crypter

Description of De-crypter

Description of the Main Raptor's Cryptographic Algorithm

Algorithm

Description of the Main Raptor's Cryptographic Algorithm

This is the main solver algorithm program. It allow us to decrypt datas slices crypted with the version 1 of the Raptor Cryptographic Algorithm. To solve I need thse following variables :

• raw_txt : The input crypted string storage

• Basemin : The minimum Base index

• Basemax : The maximum Base index

• table2 : The list of list containing the Base Table

• testkey : The key of the algorithm, the decrypting process absolutely need this key.

The solving procedure is ruled by the following steps:

• Generating the Base Table and store it into my table2 variable

• Getting inputs known as crypted string and his associated key.

• Organize data slice removing separators via the slurps methods

• Decrypting process using the decrypt_procedure method (see documentation)

• Store and return the results of decrypting process

Source Code

[2,36]") exit(0) maxi=Basemax-Basemin table2=table() long_chaine = [] long_crypt = [] longi=0 seuil = 20 seuil_lvl2=70 choice = '' userchoice=0 sep=['!','"','#','$','%','&','(','
)','*','+',',','-','.','/'] sep_lvl2=[":",";","<","=",">","?","@"] sep_lvl3=

['A','B','C','D','E','F','G','H','I','J','K','L'] mesquin=['M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] long_long_chaine = [] tmp_long_chaine = [] long_chaine = [] long_crypt = [] testc = [] testk = [] int_chaine = [] lvl2_key_miam = [] tmp_crypt = [] while(choice!='q'): # init_all() current_sep_lvl3 = "A" current_sep_lvl2 = ":" long_chaine[:] = [] long_crypt[:] = [] long_long_crypt = [] testc[:] = [] testk[:] = [] int_chaine[:] = [] lvl2_key_miam[:] = [] long_long_chaine[:] = [] tmp_long_chaine[:] = [] tmp_crypt = () testkey = '' raw_txt = '' clean_txt = '' longi = 0 longii = 0
(continues on next page)

Description of De-crypter

(continued from previous page) res = () raw_txt=input("Veuillez entrer la chaine cryptée : \n") testkey=input("Veuillez saisir la clé : \n") if(len(raw_txt)>=seuil*6 and len(raw_txt)<seuil_lvl2*6): long_chaine = split(raw_txt,seuil) longi+=1 else:

if(len(raw_txt)>=seuil_lvl2*6): tmp_long_chaine = split(raw_txt,seuil_lvl2*6) for i in range(0,len(tmp_long_chaine)): long_long_chaine.append(split(tmp_long_chaine[i],seuil)) longii+=1 raw_txt = slurp3(raw_txt) testkey = slurp3(testkey) if(not longi and not longii): clean_txt = decrypt_procedure(raw_txt,testk,table2) else:

if(longi):

lvl2_liste = [] lvl2_key = [] lvl2_liste = slurp2(raw_txt) lvl2_key = slurp2(testkey) lvl2_key_miam = [] # print(lvl2_liste) # print(lvl2_key)
for i in range (0,len(lvl2_key)): lvl2_key_miam.append(miam(lvl2_key[i])) # print(lvl2_key_miam) for i in range (0,len(lvl2_liste)-1): clean_txt+= decrypt_procedure(lvl2_liste[i],lvl2_key_

˓→miam[i],table2) if(longii): lvl3_liste = [] lvl3_key = [] lvl3_liste = slurp4(raw_txt) lvl3_key = slurp4(testkey) lvl2_liste = [] lvl2_key = [] lvl2_key_miam = [] final_key = [] for i in range (0,len(lvl3_key)):
lvl2_key.append(slurp2(lvl3_key[i])) for i in range (0,len(lvl3_liste)-1): lvl2_liste.append(slurp2(lvl3_liste[i])) for i in range(0,len(lvl2_key)-1): del lvl2_key_miam[-1] final_key.append(lvl2_key_miam) # print("final") # print(final_key) # print("liste : "+str(len(lvl2_liste))+" | key ˓→"+str(len(final_key)))

for k in range (0,len(lvl2_liste[i])-1):

# print("lvl2[i][k] : ") # print(lvl2_liste[i][k]) # print(final_key[0][k]) clean_txt+=decrypt_procedure(lvl2_liste[i][k], ˓→final_key[0][k],table2)
# print(str(k) + "/" + str(len(lvl2_liste[i])-2)) # print(str(i)+" / "+str(len(lvl2_key)-1)) print("Chaine décryptée : \n") print(clean_txt) choice=input("c)ontinuer ou q)uitter") if(choice!='q'): userchoice+=1

Description of De-crypter

ascii_to_int

def ascii_to_int(chaine)

Algorithm

Utils method : ascii to integer converter.

Parameters Type Description chaine str

The string to convert Returns list : A list containing all integers values since ASCII.

Source Code res = []

for letter in chaine: res.append(ord(letter)) return res

134

Chapter 5. Raptor Cryptographic Algorithm v3.1

cryptChaine

def cryptChaine(to_crypt,table,base)

Algorithm

The simple method to crypt an ascii string as integer list.

Parameters Type Description to_crypt int list

The converted int list since an ascii string

Algorithm

Utils method : A method to limit the Base range

Parameters Type Description Range int

The range as a limit base int The current Base index

Returns int : The limited by range res.

Source Code

Algorithm

This is the key builder.

Parameters Type Description int_chaine

int list The base index list as a starting builder for key

Returns int list : the builded key from index base list.

Source Code

res=[] for i in range (0,len(int_chaine

)): tmp=((int_chaine[i]*int_chaine[len(int_chaine)-i-1]+10)%36) if (tmp<10)

Algorithm

A method to transpose an integer list to the corresponding key's base index => The result will be a succession of transposed values from differents integers to differents base

Algorithm

Compute a cyclik ascii separators into ponctuation signs. Get a second cyclic ascii set modulo length

Parameters Type Description current str

The current poncuation separator

Returns str : The following separator from the defined 'sep' Set.

Source Code

sep=[":",";","<","=",">","?","@"] tmp=((sep.index(current)+1

Algorithm

A function to reverse a string as argument.

Parameter Type Description s

String The string to reverse

Returns str : The reversed string

Source Code

res=[] for i in range(0,len(liste)): res.append(liste[len(liste)-i-1]) return res 5.20. reverse 5.21 split_number def split_number(num)

Algorithm

Integer splitter using the inverse Horner scheme and get it as a list of digits.

Parameters Type Description num int

The integer to be splitted

Algorithm

Get the direct Base complemented value from the original x value. The Base must be inferior or equal to 10.

Parameters

Algorithm

A value getter to obtain an index from the original Base converted string value. This method is working as the list 'index' method and allow us to get the raw full integer corresponding to the list of list value.

Parameters

Algorithm

This function is used to compute the complement value from the original one in his own base. I use a temporary variable to store the numeric value of the compement and restitute it in his own base.

Parameters Type

Algorithm

The complement function is the full algorithm combining the complement_at_sup11 and complement_at functions. I specify the way to take between both of them using an if then else structure.

Parameters

Algorithm

This method allow us to rebuild a str list of crypted terms using separators set.

Parameters

Algorithm

This method is similar of the slurp method. It defined a second level of crypting management.

Parameters Type Description chaine str

The raw string crypted message

Returns str list : The list of crypted terms rebuilded from the raw string.

Source Code

tmp='' res = [] sep=[":",";","<","=",">","?","@"] for elem in chaine:

Algorithm

This method is similar of the slurp2 method. It defined a third level of crypting management.

Parameters Type Description chaine str

The raw string crypted message

Returns str list : The list of crypted terms rebuilded from the raw string.

Source Code

Algorithm

This method is similar of the slurp2 method. It defined a third level of crypting management.

Parameters Type Description chaine str

The raw string crypted message

Returns str list : The list of crypted terms rebuilded from the raw string.

Source Code

Algorithm

This method compute the chained 2nd order equations to solve the numeric suit. It permit us to get the ASCII values as a list. To solve the system you have to instance the solver with the square root of term 0. Once theorem zero done, you will apply the equation solver with square root of the 0-term as b, a as 1 and c as -following term. The algorithm sort the roots and take only positives ones.

Parameters Type

Description liste int list The computed multiplied list to solve Returns int list : A list containing solved terms.

Source Code

Algorithm

This method manage the decrypting procedure. It is ruled by the following steps :

• Build the full key since the key argument

Algorithm

This method is used to create a wrong path of decrypting method. Using a similar Separators terms, I define a 'fake' terms list wich have absolutely no meanings for the rest of the algorithm. Using it as the last step of algorithm, it doesn't allow any brute force attack to decrypt. The threshold value 'seuil' will define the amount of distribution of fake separators. • Multiplying each term of the crypt list with 10000 to get integers values from float.

Parameters Type

• Key padding to confirm key appending the two first elements of the key at the end and the top one numric list at the end

print(str_key) # print("################################") print('!'+string) # print("################################") quit() 6
.1. Description of Crypter

Description of De-Crypter

Main Raptor Cryptographic Alternative Algorithm

Algorithm

To decrypt the obtained string sequence from the Crypter, you have to follow these steps :

• Rebuild original term list from the string using the sep Set

• Transpose each term in his corresponding Base from the key to get integers values.

• Dividing each of term by 10000 to restitute float values

• The zero step of decrypting is the multiplication of the first term of the list with the first value of the begining Ascii converted list (appending it to the key to make it confidential)

• Restitute each i_term multiplying with i-1_term

• Rounding and restitute via conversion the origial ASCII chain.

Source Code

Algorithm

This is the main Raptor Cryptographic Alternative algorithm v2. The difference between both versions is the type of the numbers list. The second version is using a representation of float crypted preserving the full precision of the values. This one is stable on his definition's domain and could be considered as the first one as 'fast crypting algorithm'. There are differents ways to use :

• Cybersecurity of business and organization (Hospitals, banks, etc)

• Crypting data stream on the web

• Crypting authentification informations

This algorithm is ruled by the followings steps :

• Define two differents sets :

-

Algorithm

To decrypt the obtained string sequence from the Crypter, you have to follow these steps :

• Rebuild the terms list from the given string using sep and vir Sets

Algorithm

The mirror function build a mirror list from the given one.

Parameters Type Description liste list

The list to be treat

Returns list : The mirror list from the given parameter.

Source Code

Crypting Protocol

We will crypt a simple message containing the word 'salut'.

In a first step we have to compute the weight list of the differents caracters (meaning an approximation of the ASCII code used in the computer code algorithm).

Weigth List

Giving 0 to 'a' to 26 to 'z', we have : 18.0.11.20.19 as the weigth list of the string

Cumulated weigth list

Once done, we have to compute the cumulated weigth list. I mean, the list application can be considered as a suit defined by : 𝑢 𝑛 a suit from N to N with the length 𝑛 ∈ N | 𝑢 𝑖 =𝑢 𝑖-2 +𝑢 𝑖-1

In our case, the computed list is 18. 18.29.49.68 We call it 𝑣 𝑖

Key Computing

At this moment we have to compute the public key 𝑘 𝑖 of the algorithm defined via modulo since the formula :

Crypting Process

The crypting process is ruled by a pseudo-convolution with the given symbol * meaning a point by point multiplication. This newer suit is ruled by 𝑣 𝑖 and 𝑢 𝑖 We call it 𝑤 𝑖 defined by : 𝑣 𝑖 * 𝑢 𝑖

In our example, it gives : We obtain the suit 𝑤=324.0.319.980.1292

⎧ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎩ 𝑤 0 = 𝑣 0 .𝑢 0 = 324 𝑤 1 = 𝑣 1 .𝑢 1 = 0 𝑤 2 = 𝑣

Encryption

At the end we use the Encryption into differents numeric bases to hide the crypting process.

The Base indexes are defined by the key 𝜉 The list to encrypt is defined by 𝑤 The Encryption process will be caled Ξ Defined by : Ξ 𝑖 = (𝑤 𝑖 ) 𝜉𝑖 (8. 8.2.9 Ξ 6 = 67500, 𝜉 6 = 10

The specified base index 𝜉 6 = 10, so any conversion is superfluous. Or by performing a Base transposition since the 13 Base Table , we obtain :

(0𝑏𝑎30) 13 = (11.13 3 + 10.13 2 + 3.13 + 13) 10 = 25886 (8.18)

The Base transposition done, we could reverse the key to obtain the rest of the list.

Key build

We can use the following definition :

𝜌 is the length of the key 𝜉 since Initialisation Section.

We go to compare the 𝜌 length of 𝜉 with 𝜒 the length of Ξ.We have 𝜒=2.𝜌

We will use the following terms :

• ξ : the mirror of 𝜉 13226.23100.42689.56746.16544.67500.25886.73818.25376.105445.116063.125875.161542.373266

Chain Polynom Resolution

To continue the decrypting process, we know the suit increasing by recurrence. We can resolve the polynom using logic, we call it 𝐶ℎ.

𝐶ℎ 𝑛 = 𝑦 2 +(𝑦 ′2 +(𝑦 ′′2 +...+𝑦 (𝑛)2 )).y + c =0

The recursive injection of a polynome is resolvable uniquely using positive real roots.

With this definition, we will not keep cases with △ ≤ 0

In the last section of the demonstration, we will use the Chain Polynoms resolution algorithm defined by :

• Solve 𝑦 2 + 𝑏.𝑦 -Ξ 𝑖 = 0

• 𝑥 = (𝑟𝑜𝑜𝑡 > 0) -𝑏

• 𝑏 = 𝑟𝑜𝑜𝑡

• Add x to the solved list R.

Decrypting Protocol

We gonna initialize the procedure with :

•

Conclusion

we can conclude using a simple ASCII table and get letters from the obtained numeric suit. R={115,105,32,116,117,32,108,39,97,92,116,114,11,117,118,233} 𝐴𝑆𝐶𝐼𝐼 𝑅 ={s,i, ,t,u, ,l,',a, ,t,r,o,u,v,é } We can get the final decrypted string : "si tu l'a trouvé"

Decrypting Protocol

  while(len(chaine)>=29 or len(chaine)==0): chaine=input("Veuillez entrer une chaine <29 : \n") res=crypt_procedure(chaine,table2) testc = res[0] testk = res[1] for i in range(0,len(testk)): testkey+=str(testk[i]) raw_txt = crypt_final(res) print("

  list The list to multiply b int/float list The list to multiply Returns int / float list : The computed point by point multiplication def transpose_base(liste,key,table)

#

  second level local declaration long_chaine = [] (continues on next page)

  list The list to multiply b int/float list The list to multiply Returns int / float list : The computed point by point multiplication def transpose_base(liste,key,table)

  Type Description tuple tuple List couple representing the crypted strin and the associated key Returns str : The crypted list as a string with correct separators 3.24.2 Source Code sept=['!','"','#','$','%','&','(',')','*','+',',','-','.','/'] res = '' sep =sept[int(int_chaine[1]*m.cos(int_chaine[0]))%13] crypt=tuple[0] key=tuple[1] for i in range (0,len(crypt)): res+=sep+str(crypt[i]) sep=cyclik_ascii(sep) Chaining the final-level algorithm to get complex crypto-procedure Parameters Type Description tuple tuple List couple representing the crypted string and the associated key Returns str : The full second level crypted string 3.25.2 Source Code sept=['!','"','#','$','%','&','(',')','*','+',',','-','.','/'] res = '' sep =sept[int(int_chaine[1]*m.cos(int_chaine[0]))%13] for i in range (0,len(liste)): res+=sep+str(liste[i]) sep=cyclik_ascii(sep)

  From a given str list, we rebuild the full length string Parameters Type Description chaine str list The String slices as a list Returns str : The full striing rebuilded from the slices list 3.32.2 Source Code res = '' for i in range (0,len(chaine))

  cryptée : \n") testkey=input("Clé unique : \n") if(len(raw_txt)/5>=seuil and len(raw_txt)/5<seuil_lvl2): longi+=1 if(len(raw_txt)/5>=seuil_lvl2): longii+=1 raw_txt = slurp3(raw_txt) testkey = slurp3(testkey) if(not longi and not longii): testkey=miam(testkey) clean_txt = decrypt_procedure(raw_txt,testkey,table2) for i in range (0,len(lvl2_key)): lvl2_key_miam.append(miam(lvl2_key[i])) for i in range (0,len(lvl2_liste)-1): clean_txt+= decrypt_procedure(lvl2_liste[i],lvl2_key_ ˓→miam[i],table2) for i in range (0,len(lvl3_key)): lvl2_key.append(slurp2(lvl3_key[i])) for i in range (0,len(lvl3_liste)-1): lvl2_liste.append(slurp2(lvl3_liste[i])) for i in range(0,len(lvl2_key)-1): lvl2_key_miam[:] = [] for j in range (0,len(lvl2_key[i])): (continues on next page) 86 Chapter 4. Raptor Cryptographic Algorithm v3 lvl2_key_miam.append(miam(lvl2_key[i][j])) del lvl2_key_miam[-1] final_key.append(lvl2_key_miam) for k in range (0,len(lvl2_liste[i])-1): clean_txt+=decrypt_procedure(lvl2_liste[i][k], ˓→final_key[0][k],table2)print("Chaine décryptée : \n") print(clean_txt) choice=input("c)ontinuer ou q)uitter") if(choice!='q'

  list The list to multiply b int/float list The list to multiply Returns int / float list : The computed point by point multiplication

  def decrypt_procedure(chaine,key,table)

  lvl2_key_miam[:] = [] for j in range (0,len(lvl2_key[i])): lvl2_key_miam.append(miam(lvl2_key[i][j])) # print("miam") # print(lvl2_key_miam) (continues on next page)

  The weigth as an integer list Returns int list : The computed list containing the inverse operation of vec_poids method list The list to multiply b int/float list The list to multiply Returns int / float list : The computed point by point multiplication def transpose_base(liste,key,table)

  (int(m.sqrt(liste[0]))) tmp=res[0] for i in range (1,len(liste)):# print("y = "+str(tmp)) # print("x = "+str(x)) tmp2 = equa_2_nd(1,-tmp,-liste[i]) x=tmp2-tmp res.append(int(x

•

  The sep Set representing terms separators -The vir Set reprseneting the comma in float values • Getting raw string as input • Converting ASCII values to their decimal correspondence • Dividing each i+1_term of the list by the i_term of the list • Building key from the given formula : key(i)=((l(i)*l(i+1) modulo l(i+2)) modulo 26) • Multiplying each term by 10000 Building the mirror key from the original one • Compute each fraction division float value. Each fraction is defined by res(i)/key(i+1). Each part of the value is represented into a single integer value • Multiplying each float res by 10 to get larger values (useful to Base

{

  𝑘 𝑖 = [𝑢 𝑖 .𝑢 𝑛-𝑖 𝑚𝑜𝑑 26] + 10 𝑖𝑓 ∃𝑢 𝑖 , 𝑢 𝑛-𝑖 𝑢 𝑗 𝑖𝑓 !∃𝑢 𝑗 , 𝑗 = 𝑛/2 + 1 . full Length key 𝜉 using the formula : { 𝜉 𝑖 = 𝑘 𝑖 𝑖𝑓 𝑖 <= 𝑛/2 + 1 𝜉 𝑖 = 𝑘 𝑛-𝑖 𝑖𝑓 𝑖 > 𝑛/2 + 1 . (8.3)

.

  2 .𝑢 2 = 319 𝑤 3 = 𝑣 3 .𝑢 3 = 980 𝑤 4 = 𝑣 5 .𝑢 4 = 1292

  (𝑤 0 ) 𝜉0 = (324) 14 = 192 Ξ 1 = (𝑤 1 ) 𝜉1 = (0) 10 = 0 Ξ 2 = (𝑤 2 ) 𝜉2 = (319) 11 = 270 Ξ 3 = (𝑤 3 ) 𝜉3 = (980) 10 = 980 Ξ 4 = (𝑤 4 ) 𝜉4 = (1292) 14 = 684 . (8.6) The Encrypted suit is Ξ = 192.0.270.980.684 Its associate key is 𝜉 = 14.10.11.10Highlighted 𝜉 𝑗 , Bases index are consistent with the Terms of the suit Ξ Thereby, with the Correspondance between 𝜉 0 and Ξ 0 , we obtain the following chained system resolution. 8.2.3 Ξ 0 = 018kh, 𝜉 0 = 21 By drawing up the 21 Base

  𝑦 2 = Ξ 0 ⇐⇒ 𝑦 = √ 13226 = 115 𝑅 0 = 115 • 𝑦 2 -115.𝑦 -23100 = 0 𝑥 = 220 -115 = 105 𝑅 1 = 105 • 𝑦 2 -220.𝑦 -8064 = 0 𝑅 2 = 252 -220 = 32 • 𝑦 2 -252.𝑦 -42688 = 0 𝑅 3 = 368 -252 = 116 • 𝑦 2 -368.𝑦 -56745 = 0 𝑅 4 = 485 -368 = 117 • 𝑦 2 -485.𝑦 -16544 = 0 𝑅 5 = 517 -485 = 32 • 𝑦 2 -517.𝑦 -67500 = 0 𝑅 6 = 625 -517 = 108 • 𝑦 2 -625.𝑦 -25896 = 0 𝑅 7 = 664 -625 = 39 • 𝑦 2 -664.𝑦 -73817 = 0 𝑅 8 = 761 -664 = 97 • 𝑦 2 -761.𝑦 -25376 = 0 𝑅 9 = 793 -761 = 32 • 𝑦 2 -793.𝑦 -105444 = 0 𝑅 10 = 909 -793 = 116 • 𝑦 2 -909.𝑦 -116622 = 0 𝑅 11 = 1023 -909 = 114 • 𝑦 2 -1023.𝑦 -125874 = 0 𝑅 12 = 1134 -1023 = 111 • 𝑦 2 -1134.𝑦 -146367 = 0 𝑅 13 = 1251 -1134 = 117 • 𝑦 2 -1251.𝑦 -161542 = 0 𝑅 14 = 1369 -1251 = 118 • 𝑦 2 -1369.𝑦 -373266 = 0 𝑅 15 = 1602 -

table .

 .

	1.2 tablebase
	def tablebase(base)
	append(recursive_build(bases[i-mini]))
	while(not ok):
	tmp=recursive_build_sup_lvl(bases[i-mini],table[i-mini],ind)
	table[i-mini]=tmp[0]
	ind+=1
	if(ind==rec_level_l[i-mini]):
	ok=1
	return table
	2	Chapter 1. Numeric Base Recursive Builder Algorithm

  This function recursively build a full Base Table from an existing one. You can pass the first step table as already builded recursive table.

	res = [] letter = 'a' letterbis = 'A' for i in range(0,base): if(i<10 or (i<=10 and base <=10)): res.append(str(i)) if(i>=10 and base >10 and base<37): res.append(letter) letter=chr(ord(letter)+1) return res def recursive_build(table_base) 1.3.1 Algorithm Parameters Type Description 1.2. tablebase 1.3 recursive_build table_base list Base Table array as list

Returns str list : The recursively builded Base Table 1.3.2 Source Code res = [] for i in table_base: for j in table_base: res.append(i+j) return res 4 Chapter 1. Numeric Base Recursive Builder Algorithm 1.4 recursive_build_sup_lvl_safe_mode def recursive_build_sup_lvl_safe_mode(current,indice)

Numeric Base Recursive Builder Algorithm CHAPTER TWO RAPTOR CRYPTOGRAPHIC ALGORITHM V1

			Type	Description
		table_base	str list my first step Base table array as list
		current	str list my current Base table array as list
		lvl	int	Define the level of recursivity
	1.5.2 Source Code
	res	= []
	break_ind = 0
	for i in table_base:
		try :
		res.extend(recursive_build_sup_lvl_safe_mode(current,i))
		except:
		break_ind=1
		break
	return (res,break_ind)
	6			Chapter 1.

Returns (list,int) Tuple : The (Base

Table builded, Index of depth) Couple of informations.

build of the full Base table since the first step table using functions : -rec_table_construct_lvl1

table for each necessary numeric base via the function table and splitTable • Recursive : It draw the 'zero theorem' of Table construction since the first step. Must be considered as te first loop of recursive builder algorithm -rec_manage : It draw the full Base Table using recursive loop • Instanciation of the local varables to manipulate the algorithm

  Recursive Construction method from the Base table. The recursive algorithm permit to edit much larger array from existing original base table. Ths algorithm must be used as the init loop of the final recursive method (see rec_manage method)Recursive Construction method from the Base table. The recursive algorithm manage array building since 2 levels of recursive construction. => Do not use for the first recursive building loop recursivity manager to build properly the base table. It must be used to map the numeric values into base values. This method allow contruction of hundreds of thousand values table

	Returns str : The reversed string 2.3.2 Source Code str= "" for i in s: str=i+str return str 2.3. reverse 2.4 splitTable def splitTable(table) 2.4.1 Algorithm Split a string as array from the given separator. Parameters Type table string The list to split Description Returns list : The splitted list 2.4.2 Source Code represent='' letter='a' powIndex=0 count=0 if(fin>10*base): fin=10*base for i in range(debut,fin): current=i if(i<base): if(i<10): represent+=str(i) else: represent+=letter letter=chr(ord(letter)+1) if(i==base-1): letter='a' else: tmp='' if(base<10): tmp+=str(current%base) else: if(current%base<10): tmp+=str(current%base) else: tmp+=letter if(count==0): letter=chr(ord(letter)+1) (continued from previous page) else: count-=1 if(current%base==base-1): letter='a' current=int(current/base) represent+=reverse(tmp) represent+="\n" return represent 16 Chapter 2. Raptor Cryptographic Algorithm v1 2.6 rec_table_construct_lvl1 def rec_table_construct_lvl1(table,base,powindex,last) 2.6.1 Algorithm Parameters Type Description table list The Base table array base int The current numeric base as integer powindex int The pow index as integer last int unused Returns list : The Recursively builded Base table as list 2.6.2 Source Code lettrebase=table[10:base] if(powindex == 1): del table[10*base] res=table[:] for i in range (len(table)-1,base**2-1): if(i%base==(base-1) and i!=len(table)-1): powindex+=1 res.append(lettrebase[powindex-1]+str(table[(i-len(table)+1)%base])) return res def rec_table_construct_final(table,base,lvl) 2.7.1 Algorithm Parameters Type Description table list The first recursive level builded Base table base int The base to treat as integer lvl int The level of recursivity in construction return res 2.8 rec_manage def rec_manage(table) 2.8.1 Algorithm Parameters Type Description table list The initial Base table to complete Returns list : The fully builded Base table 2.6. rec_table_construct_lvl1 2.7 rec_table_construct_final 2.8.2 Source Code

local_list=table.split('\n') res_list=[] for i in range (0,len(local_list)): res_list.append(local_list[i]) return res_list 14 Chapter 2. Raptor Cryptographic Algorithm v1 2.5 table def table(base,debut,fin,inc) 2.5.1 Algorithm Base table recursive builder. The generated Base table array is defined via : • base : Define the base to begin the table • debut : Define the first value of Base table • fin : Define the last value of Base table • inc : Define the incrementation step Parameters Type Description base int The first base of the table debut int The first value of the table in the given base fin int The last value of the table in the given base inc int The value of incrementation step Returns Str : A string containing all the base generated representing the array (see conversion later) 2.5.2 Source Code while(current/base!=0): count=powIndex*10*base if(not current%(10*base)): powIndex+=1 (continues on next page) 2.5. table Returns list : The fully specified level recursivity builded Base table 2.7.2 Source Code res=[] basetable=table[0:base] for i in range(0,len(basetable)): basetable[i]=basetable[i][lvl:] for eat in basetable: for this in table: res.append(eat+this) A for i in range(9,len(table)): table2=table

Raptor Cryptographic Algorithm v1 Crypto-Doc, Release 1.0 2.12 local_table_dico

	2.13 limit_range 2.14 base_key
	def local_table_dico(table2,base,rangeB) def limit_range(Range,base) def base_key(int_chaine)
	2.12.1 Algorithm 2.13.1 Algorithm
	Utils method : A method to convert a Base table to Python dictionnary Utils method : A method to limit the Base range
		Parameters Type Parameters Type Description Description
		table2	list of list An array containing all the fully builded Base table Range int The range as a limit
		base	int base	Define the Base index int The current Base index
	rangeB Returns int : The limited by range res. int	Define the max step of incrementation
	Returns Dictionnary : A dictionnary representing the specified Base table
	2.13.2 Source Code
	2.12.2 Source Code
	res=0
	str_base={} if(Range>base**2):
	res = {}	res=base**2
	if(rangeB>base**2): else:
		rangeB=base**2 res=Range
	for i in range (0,rangeB): return res
		str_base[i]=table2[base][i]
	return str_base
	24			Chapter 2. Raptor Cryptographic Algorithm v1

table list of list An array containing all fully builded Base Table base int Define the Base index Returns str list : A string list containing all the base crypted values, Must be used as a crypted list. 2.11.2 Source Code res = [] for i in range(0,len(to_crypt)): res.append(table[base][to_crypt[i]]) return res 22 Chapter 2.

•

  We associate the crypted strin to the key as return

	2.22 cyclik_ascii 2.23 crypt_final
	def cyclik_ascii(current) def crypt_final(tuple)
	2.22.1 Algorithm
	Compute a cyclik ascii separators into ponctuation signs
			Parameters Type Description
			current	str	The current poncuation separator
	Returns str : The following separator from the defined 'sep' Set.
	2.22.2 Source Code
	res =sep[tmp]	Parameters Type chaine string +1)%13)	Description The string to crypt
	return res
	2.21.2 Source Code
	int_chaine = ascii_to_int(chaine)
	base_keyy = base_key(int_chaine)
	if(len(base_keyy)%2==0):
	key=base_keyy[0:int(len(base_keyy)/2)]
	else:
	key=base_keyy[0:int((len(base_keyy)/2)+1)]
	vec_poid	= vec_poids(int_chaine)
	crypt_lst = multlist(int_chaine,vec_poid)
	crypt_lst = transpose_base(crypt_lst,base_keyy,table)
	return(crypt_lst,key)

table list of list The Base Table recursively builded

Returns list tuple : The couple crypted string and key as result. It permits to decrypt any message.

sep=['!','"','#','$','%','&','(',')','*','+',',','-','.','/'] tmp=

((sep.index(current)

34 Chapter 2. Raptor Cryptographic Algorithm v1 2.24 slurp

	def slurp(chaine)
		Type Description
	tuple	tuple List couple representing the crypted strin and the associated key
	Returns str : The crypted list as a string with correct separators
	2.23.2 Source Code
	res = ''
	sep = '!'
	crypt=tuple[0]
	key=tuple[1]
	for i in range (0,len(crypt)):
	res+=sep+str(crypt[i])
	sep=cyclik_ascii(sep)
	return res

.24. slurp 2.25 resolve

	Type Description str The raw string crypted message Returns str list : The list of crypted terms rebuilded from the raw string chaine 2.24.2 Source Code tmp='' res = [] sep=['!','"','#','$','%','&','(',')','*','+',',','-','.','/'] for elem in chaine: if(not elem in sep): tmp+=str(elem) else : res.append(tmp) tmp='' if(elem==''): break res=res[1:] res.append(tmp) return res 2def resolve(liste)

Type Description liste int list The computed multiplied list to solve Returns int list : A list containing solved terms. 2.25.2 Source Code

	res = []
	x = 0
	tmp2 = 0
	res.append(int(m.sqrt(liste[0])))
	tmp=res[0]
	for i in range (1,len(liste)):
	tmp2 = equa_2_nd(1,-tmp,-liste[i])
	x=tmp2-tmp
	res.append(int(x))
	tmp=tmp2
	return res

36 Chapter 2. Raptor Cryptographic Algorithm v1 2.26 decrypt_procedure

	def decrypt_procedure(chaine,key,table)

Chapter 2. Raptor Cryptographic Algorithm v1 CHAPTER THREE RAPTOR CRYPTOGRAPHIC ALGORITHM V2

	• Convert the int list as result to ASCII chain
	Parameters Type	Description
	chaine	str	The raw crypted text as string
	key	int list	The half key as int list
	table	list of list The Base Table array
	Returns str : The uncrypted text.
	2.26.2 Source Code
	res = ''
	base=key[:]
	tmp = []
	key.reverse()
	tmp = key[:]
	to_find = []
	to_find=slurp(chaine)
	if(len(to_find)%2==0):
	base+=tmp[0:len(key)]
	else:
	base+=tmp[1:len(key)]
	tmp_liste=inv_transpose_base(to_find,base,table)
	int_liste=resolve(tmp_liste)
	res = int_to_ascii(int_liste)
	return res

• Generating the first step Base table for each necessary numeric base via the function table and splitTable • Recursive build of the full Base table since the first step table using functions : -rec_table_construct_lvl1 : It draw the 'zero theorem' of Table construction since the first step. Must be considered as te first loop of recursive builder algorithm -rec_manage : It draw the full Base Table using recursive loop • Initialization : Instanciation

  of the local varables to manipulate the algorithm

42 Chapter 3. Raptor Cryptographic Algorithm v2

		(continued from previous page)
	testc[-1]+=current_sep_lvl2
	testk[-1]+=current_sep_lvl2
	int_chaine=(ascii_to_int(chaine))
	for i in range(0,len(testk)):
	testkey+=str(testk[i])
	if(not longi):
	raw_txt = crypt_final(res,int_chaine)
	else:
	raw_txt += crypt_final_long(testc,int_chaine)
	print("Chaine cryptée : \n")
	print(raw_txt)
	print("Clé unique : \n")
	print(testkey)
	if(not longi):
	clean_txt = decrypt_procedure(raw_txt,testk,table2)
	else:
	lvl2_liste = []
	lvl2_key	= []
	lvl2_liste = slurp2(raw_txt)
	lvl2_key	= slurp2(testkey)
	lvl2_key_miam = []
	for i in range (0,len(lvl2_key)):
	lvl2_key_miam.append(miam(lvl2_key[i]))
	for i in range (0,len(lvl2_liste)-1):
	clean_txt+= decrypt_procedure(lvl2_liste[i],lvl2_key_miam[i],
	˓→table2)
	userchoice):
	chaine = ''
	chaine=input("Veuillez entrer la chaine à crypter : ")
	if(len(chaine)>=20):
	long_chaine = split(chaine,seuil)
	longi+=1
	if(not longi):
	res=crypt_procedure(chaine,table2)
	else :
	for i in range(0,len(long_chaine)):
	long_crypt.append(crypt_procedure(long_chaine[i],table2))
	if(not longi):
	testc = res[0]
	testk = res[1]
	else :
	for i in range (0,len(long_crypt)):
	for j in range(0,len(long_crypt[i][0])):
		testc.append(str(long_crypt[i][0][j]))
	for k in range(0,len(long_crypt[i][1])):
		testk.append(str(long_crypt[i][1][k]))
	current_sep_lvl2=cyclik_ascii_lvl2(current_sep_lvl2)
		(continues on next page)

44 Chapter 3. Raptor Cryptographic Algorithm v2

		(continued from previous page)
	if(Basemin<2 or Basemax>37):
	print("Affichage impossible veuillez selectionner une plage de valeure contenue␣
	˓→dans [2,36]")
	exit(0)
	#init routine
	maxi=Basemax-Basemin
	for i in range(Basemin,Basemax):
	table2.append(table(i,0,Range,1))
	import sys
	import math as m
	import random as r
	represent=''
	table2 = []
	dic = {}
	main_dic={}
	choice = ' '
	chaine=''
	#system check routine
	if(len(sys.argv)!=4):
	Basemin = 2
	Basemax = 37
	Range	= 36**2
	else :
	Basemin = int(sys.argv[1])
	Basemax = int(sys.argv[2])
	Range	= int(sys.argv[3])
		(continues on next page)

  Recursive Construction method from the Base table. The recursive algorithm permit to edit much larger array from existing original base table. Ths algorithm must be used as the init loop of the final recursive method (see rec_manage method)Recursive Construction method from the Base table. The recursive algorithm manage array building since 2 levels of recursive construction. => Do not use for the first recursive building loop

	represent='' letter='a' powIndex=0 count=0 if(fin>10*base): fin=10*base for i in range(debut,fin): current=i if(i<base): if(i<10): represent+=str(i) else: represent+=letter letter=chr(ord(letter)+1) if(i==base-1): letter='a' else: tmp='' if(base<10): tmp+=str(current%base) else: if(current%base<10): tmp+=str(current%base) else: tmp+=letter if(count==0): letter=chr(ord(letter)+1) (continued from previous page) else: count-=1 if(current%base==base-1): letter='a' current=int(current/base) represent+=reverse(tmp) represent+="\n" return represent 50 Chapter 3. Raptor Cryptographic Algorithm v2 3.6 rec_table_construct_lvl1 def rec_table_construct_lvl1() 3.6.1 Algorithm Parameters Type Description table list The Base table array base int The current numeric base as integer powindex int The pow index as integer last int unused return res def rec_table_construct_final(table,base,lvl) 3.7.1 Algorithm Parameters Type Description table list The first recursive level builded Base table base int The base to treat as integer 3.6. rec_table_construct_lvl1 3.7 rec_table_construct_final lvl int The level of recursivity in construction

Type Description table string The list to split Returns list : The splitted list 3.4.2 Source Code local_list=table.split('\n') res_list=[] for i in range (0,len(local_list)): res_list.append(local_list[i]) return res_list 48 Chapter 3. Raptor Cryptographic Algorithm v2 3.5 table def table() 3.5.1 Algorithm Base table recursive builder. The generated Base table array is defined via : • base : Define the base to begin the table • debut : Define the first value of Base table • fin : Define the last value of Base table • inc : Define the incrementation step Parameters Type Description base int The first base of the table debut int The first value of the table in the given base fin int The last value of the table in the given base inc int The value of incrementation step Returns Str : A string containing all the base generated representing the array (see conversion later) 3.5.2 Source Code while(current/base!=0): count=powIndex*10*base if(not current%(10*base)): powIndex+=1 (continues on next page) 3.5. table Returns list : The Recursively builded Base table as list 3.6.2 Source Code lettrebase=table[10:base] if(powindex == 1): del table[10*base] res=table[:] for i in range (len(table)-1,base**2-1): if(i%base==(base-1) and i!=len(table)-1): powindex+=1 res.append(lettrebase[powindex-1]+str(table[(i-len(table)+1)%base])) Returns list : The fully specified level recursivity builded Base table 3.7.2 Source Code res=[] basetable=table[0:base] for i in range(0,len(basetable)): basetable[i]=basetable[i][lvl:] for eat in basetable: for this in table: res.append(eat+this) return res 52 Chapter 3. Raptor Cryptographic Algorithm v2 3.8 rec_manage def rec_manage(table) 3.8.1 Algorithm A recursivity manager to build properly the base table. It must be used to map the numeric values into base values. This method allow contruction of hundreds of thousand values table Parameters Type Description table list The initial Base table to complete Returns list : The fully builded Base table 3.8.2 Source Code j=0 for i in range(9,len(table)): table2=table

•

  We associate the crypted strin to the key as return

	Crypto-Doc, Release 1.0
	Parameters Type chaine string 3.21.2 Source Code int_chaine = ascii_to_int(chaine) base_keyy = base_key(int_chaine) if(len(base_keyy)%2==0): key=base_keyy[0:int(len(base_keyy)/2)] Description The string to crypt else: key=base_keyy[0:int((len(base_keyy)/2)+1)] vec_poid = vec_poids(int_chaine) crypt_lst = multlist(int_chaine,vec_poid) crypt_lst = transpose_base(crypt_lst,base_keyy,table) return(crypt_lst,key) 66 Chapter 3. Raptor Cryptographic Algorithm v2 3.22 cyclik_ascii def cyclik_ascii(current) 3.22.1 Algorithm Compute a cyclik ascii separators into ponctuation signs Parameters Type Description current str The current poncuation separator Returns str : The following separator from the defined 'sep' Set. 3.22.2 Source Code +1)%13) res =sep[tmp] return res 3.22. cyclik_ascii 3.23 cyclik_ascii_lvl2 def cyclik_ascii_lvl2(current)

table list of list The Base Table recursively builded Returns list tuple (crypt_lst,key) : The couple crypted string and key as result. It permits to decrypt any message. sep=['!','"','#','$','%','&','(',')','*','+',',','-','.','/'] tmp=((sep.index(current)

  Key builder from the half key as integer list. It rebuild the missing half with a mirror copy of the first one.

	if(not elem in sep): tmp+=str(elem) else: res.append(tmp) tmp='' if(elem==''): break res.append(tmp) return res 72 3.28 miam def miam(key) 3.28.1 Algorithm Parameters Type key int list The half key as int list Chapter 3. Raptor Cryptographic Algorithm v2 Description Returns int list : The full key rebuilded from the half key 3.28.2 Source Code tmp='' count=1 res=[] for this in key: if(count%2==0): tmp+=str(this) count=1 res.append(tmp) tmp='' else: tmp=str(this) count+=1 for i in range(0,len(res)): res[i]=int(res[i]) return res 3.28. miam 3.29 resolve def resolve(liste)

  Split the given string argument 'chaine' into slices from threshold size 'seuil'. Each of this slices are allowed into the cryptographic algorithm.

	Parameters Type chaine str key int list table list of list The Base Table array Description The raw crypted text as string The half key as int list Returns str : The uncrypted text. 3.30.2 Source Code res = '' base=key[:] tmp = [] key.reverse() tmp = key[:] to_find = [] to_find=slurp(chaine) if(len(to_find)%2==0): base+=tmp[0:len(key)] else: base+=tmp[1:len(key)] tmp_liste=inv_transpose_base(to_find,base,table) int_liste=resolve(tmp_liste) res = int_to_ascii(int_liste) return res 3.31.1 Algorithm Parameters Type Description chaine str The full string to treat seuil int Define the threshold size of the slices Returns str list : The slices list as result 3.31.2 Source Code res = [] tmp = '' index = 0 div=int(len(chaine)/seuil) for i in range(0,div): tmp='' for j in range(index,(index+seuil)): tmp+=chaine[j] if(j==(index+seuil-1)): index=j+1 res.append(tmp) if((index-1)<len(chaine)): tmp=chaine[index:] res.append(tmp) return res 76 Chapter 3. Raptor Cryptographic Algorithm v2 3.32 tilps 3.30. decrypt_procedure 3.31 split def split(chaine,seuil) def tilps(chaine)

• Convert the int list as result to ASCII chain

  Base table recursive builder. The generated Base table array is defined via :• base : Define the base to begin the table • debut : Define the first value of Base table • fin : Define the last value of Base table • inc : Define the incrementation step Recursive Construction method from the Base table. The recursive algorithm permit to edit much larger array from existing original base table. Ths algorithm must be used as the init loop of the final recursive method (see rec_manage method) Recursive Construction method from the Base table. The recursive algorithm manage array building since 2 levels of recursive construction. => Do not use for the first recursive building loop recursivity manager to build properly the base table. It must be used to map the numeric values into base values. This method allow contruction of hundreds of thousand values table

	Returns str : The reversed string 4.3.2 Source Code str= "" for i in s: str=i+str return str 88 4.4 splitTable def splitTable(table) 4.4.1 Algorithm Split a string as array from the given separator. Parameters Type table string The list to split Chapter 4. Raptor Cryptographic Algorithm v3 Description Returns list : The splitted list 4.4.2 Source Code local_list=table.split('\n') res_list=[] for i in range (0,len(local_list)): res_list.append(local_list[i]) return res_list 4.4. splitTable 4.5 table def table(base,debut,fin,inc) 4.5.1 Algorithm Parameters Type Description base int The first base of the table debut int The first value of the table in the given base fin int The last value of the table in the given base inc int The value of incrementation step Returns Str : A string containing all the base generated representing the array (see conversion later) 4.5.2 Source Code represent='' letter='a' powIndex=0 count=0 if(fin>10*base): fin=10*base for i in range(debut,fin): current=i if(i<base): if(i<10): represent+=str(i) else: represent+=letter letter=chr(ord(letter)+1) if(i==base-1): letter='a' else: tmp='' while(current/base!=0): count=powIndex*10*base if(not current%(10*base)): powIndex+=1 (continues on next page) 90 Chapter 4. Raptor Cryptographic Algorithm v3 if(base<10): tmp+=str(current%base) else: if(current%base<10): tmp+=str(current%base) else: tmp+=letter if(count==0): letter=chr(ord(letter)+1) else: count-=1 if(current%base==base-1): letter='a' current=int(current/base) represent+=reverse(tmp) #comment this lonely line to run out the program␣ ˓→:/ represent+="\n" return represent 4.5. table 4.6 rec_table_construct_lvl1 def rec_table_construct_lvl1(table,base,powindex,last) 4.6.1 Algorithm Parameters Type Description table list The Base table array base int The current numeric base as integer powindex int The pow index as integer last int unused Returns list : The Recursively builded Base table as list 4.6.2 Source Code lettrebase=table[10:base] if(powindex == 1): del table[10*base] res=table[:] for i in range (len(table)-1,base**2-1): if(i%base==(base-1) and i!=len(table)-1): powindex+=1 res.append(lettrebase[powindex-1]+str(table[(i-len(table)+1)%base])) return res 92 Chapter 4. Raptor Cryptographic Algorithm v3 4.7 rec_table_construct_final def rec_table_construct_final(table,base,lvl) 4.7.1 Algorithm Parameters Type Description table list The first recursive level builded Base table base int The base to treat as integer lvl int The level of recursivity in construction Returns list : The fully specified level recursivity builded Base table 4.7.2 Source Code res=[] basetable=table[0:base] for i in range(0,len(basetable)): basetable[i]=basetable[i][lvl:] for eat in basetable: for this in table: res.append(eat+this) return res 4.8 rec_manage def rec_manage(table) 4.8.1 Algorithm Parameters Type Description table list The initial Base table to complete Returns list : The fully builded Base table 4.8.2 Source Code j=0 for i in range(9,len(table)): table2=table[i][:] table2=rec_table_construct_lvl1(table2,i+2,1,0) table2=rec_table_construct_final(table2,i+2,1) table2=rec_table_construct_final(table2,i+2,2) table[i]=table2[:] for i in range (9,18): j=3 table2=table[i][:] while(len(table2)<1000000): table2=rec_table_construct_final(table2,i+2,j) j+=1 table[i]=table2[:] return table 94 Chapter 4. Raptor Cryptographic Algorithm v3 4.9 ascii_to_int def ascii_to_int(chaine) 4.9.1 Algorithm Utils method : ascii to integer converter. Parameters Type Description chaine str The string to convert Returns list : A list containing all integers values since ASCII. 4.9.2 Source Code res = [] for letter in chaine: res.append(ord(letter)) return res def int_to_ascii(crypt) 4.10.1 Algorithm Utils method : integer to ascii converter. Description Type Description crypt int list The int list to convert Returns str : The converted ASCII string since int list. 4.10.2 Source Code res = '' for i in range (0,len(crypt)): res+=chr(crypt[i]) return res 96 Chapter 4. Raptor Cryptographic Algorithm v3 4.9. ascii_to_int 4.10 int_to_ascii 4.11 cryptChaine

A def cryptChaine

(to_crypt,table,base)

  table list of list An array containing all fully builded Base Table base int Define the Base index Returns str list : A string list containing all the base crypted values. Must be used as a crypted list.

	return res 4.11. cryptChaine 4.12 local_table_dico def local_table_dico(table2,base,rangeB) 4.12.1 Algorithm Utils method : A method to convert a Base table to Python dictionnary Parameters Type Description table2 list of list An array containing all the fully builded Base table base int Define the Base index rangeB int Define the max step of incrementation Returns Dictionnary : A dictionnary representing the specified Base table 4.12.2 Source Code str_base={} res = {} if(rangeB>base**2): rangeB=base**2 for i in range (0,rangeB): str_base[i]=table2[base][i] return str_base 98 Chapter 4. Raptor Cryptographic Algorithm v3 4.13 limit_range def limit_range(Range,base) 4.13.1 Algorithm Utils method : A method to limit the Base range Parameters Type Description Range int The range as a limit base int The current Base index Returns int : The limited by range res. 4.13.2 Source Code res=0 if(Range>base**2): res=base**2 else: res=Range return res 4.14 base_key def base_key(int_chaine) 4.14.1 Algorithm This is the key builder. Parameters Type Description int_chaine int list The base index list as a starting builder for key Returns int list : the builded key from index base list. 4.14.2 Source Code res=[] for i in range (0,len(int_chaine)): tmp=((int_chaine[i]*int_chaine[len(int_chaine)-i-1]+10)%36) if(tmp<10): tmp+=10 res.append(tmp) return res 100 Chapter 4. Raptor Cryptographic Algorithm v3 4.15 vec_poids def vec_poids(int_chaine) 4.15.1 Algorithm Compute the vectorial cumulated weight of the list. Parameters Type Description int_chaine int list The integer list to treat Returns int list : The computed accumulated weigth integer list 4.15.2 Source Code res = [] res.append(int_chaine[0]) for i in range(1,len(int_chaine)): res.append(res[i-1]+int_chaine[i]) return res 4.16.1 Algorithm Compute the inverse of the vectorial cumulated weigth computation. Parameters Type Description vec_poids int list The weigth as an integer list Returns int list : The computed list containing the inverse operation of vec_poids method 4.16.2 Source Code res=[] for i in range (0,len(vec_poids)): res.append(1/vec_poids[i]) return res 102 Chapter 4. Raptor Cryptographic Algorithm v3 4.17 equa_2_nd 4.15. vec_poids 4.16 vec_1_poids def vec_1_poids(vec_poids) def equa_2_nd(a,b,c)

4.11.2 Source Code

res = [] for i in range(0,len(to_crypt)): res.append(table[base][to_crypt[i]])

  Key builder from the half key as integer list. It rebuild the missing half with a mirror copy of the first one.

	: tmp+=str(elem) res.append(tmp) tmp='' if(elem==''): else: break res.append(tmp) return res 4.32.1 Algorithm Parameters Type key int list The half key as int list Description Returns int list : The full key rebuilded from the half key 4.32.2 Source Code tmp='' count=1 res=[] for this in key: if(count%2==0): tmp+=str(this) count=1 res.append(tmp) tmp='' else: tmp=str(this) count+=1 for i in range(0,len(res)): res[i]=int(res[i]) return res 118 Chapter 4. Raptor Cryptographic Algorithm v3 4.33 resolve 4.31. slurp4 4.32 miam def miam(key) def resolve(liste)

tmp='' res = [] sep=['A','B','C','D','E','F','G','H','I','J','K','L'] for elem in chaine: if(not elem in sep)

•

  Solve the cumulated multiplied weigth with the equation solver • Convert the int list as result to ASCII chainThe reverse method of the split function. From a given str list, we rebuild the full length string

	Parameters Type chaine str key int list table list of list The Base Table array Description The raw crypted text as string The half key as int list Returns str : The uncrypted text. 4.34.2 Source Code res = '' base=key[:] tmp = [] key.reverse() tmp = key[:] to_find = [] to_find=slurp(chaine) if(len(to_find)%2==0): base+=tmp[0:len(key)] else: base+=tmp[1:len(key)] # Complexify tmp_liste=inv_transpose_base(to_find,base,table) int_liste=resolve(tmp_liste) res = int_to_ascii(int_liste) return res 120 Chapter 4. Raptor Cryptographic Algorithm v3 4.35 split def split(chaine,seuil) 4.35.1 Algorithm Split the given string argument 'chaine' into slices from threshold size 'seuil'. Each of this slices are allowed into the cryptographic algorithm. Parameters Type Description chaine str The full string to treat seuil int Define the threshold size of the slices Returns str list : The slices list as result 4.35.2 Source Code res = [] tmp = '' index = 0 div=int(len(chaine)/seuil) for i in range(0,div): tmp='' for j in range(index,(index+seuil)): tmp+=chaine[j] if(j==(index+seuil-1)): index=j+1 res.append(tmp) if((index-1)<len(chaine)): tmp=chaine[index:] res.append(tmp) return res 4.36.1 Algorithm Parameters Type Description chaine str list The String slices as a list Returns str : The full striing rebuilded from the slices list 4.36.2 Source Code res = '' for i in range (0,len(chaine)): res+=chaine[i] return res 122 Chapter 4. Raptor Cryptographic Algorithm v3 4.37 mesqui 4.35. split 4.36 tilps def tilps(chaine) def mesqui(txt,seuil)

  This is the main Raptor Cryptographic Algorithm v3.1. It use the base_opt module to build Base Table array and follow the same principe of olders ones adding the new feature of dynamically complement results values.

			CHAPTER
			FIVE
		RAPTOR CRYPTOGRAPHIC ALGORITHM V3.1
			Description
	txt	str	The raw string to treat
	seuil	int	The threshold variable to assign the 'fake terms' length
	Returns str : The fully 'fake splitted' crypted string
	4.37.2 Source Code
	res=''
	sep='M'
	for i in range(0,len(txt)):
	res+=txt[i]
	if(i%int((seuil))==0):
	res+=sep
	sep=cyclik_ascii_mesquin(sep,int_chaine)
	return res
	4.37. mesqui		123 Chapter 4. Raptor Cryptographic Algorithm v3

mesquin=['M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']

  table list of list An array containing all fully builded Base Table base int Define the Base index Returns str list : A string list containing all the base crypted values. Must be used as a crypted list.

5.5.2 Source Code

res = [] for i in range(0,len(to_crypt)): res.append(table[base][to_crypt[i]]) return res 136 Chapter 5. Raptor Cryptographic Algorithm v3.1 5.7 limit_range def limit_range(Range,base)

  Returns int : The real decimal value of the specified term in his own Base.

	5.24 complement_at_sup11
	def complement_at_sup11(x,table,base=11)
		Type	Description
	x	str	The value to search
	table	list of list The full Base Table
	base	int	The index of the base
	5.23.2 Source Code
	ind=0
	while(table[base][ind]!=x):
	ind+=1
	return ind
	154		Chapter 5. Raptor Cryptographic Algorithm v3.1

  The layout procedure to organise crypting results. The uodate consist to complement each of terms in his corresponding base. It allow a superior level of crypting. I use the separators set as well.

	Type str list of list The full Base Table array Description A string representation of my base converted value int The base index of the current value Returns str : The complmented value in his own Base. x table base 5.25.2 Source Code final_res=0 if(base<=10): splitted=split_number(int(x)) for i in range(0,len(splitted)): splitted[i]=complement_at(splitted[i],base) final_res*=10 final_res+=splitted[i] return final_res else: final_res=complement_at_sup11(x,table,base) return final_res 156 Chapter 5. Raptor Cryptographic Algorithm v3.1 5.26 crypt_final def crypt_final(tuple,int_chaine,table) 5.26.1 Algorithm Parameters Type Description tuple tuple List couple representing the crypted strin and the associated key Returns str : The crypted list as a string with correct separators 5.26.2 Source Code sept=['!','"','#','$','%','&','(',')','*','+',',','-','.','/'] res = '' sep =sept[int(int_chaine[1]*m.cos(int_chaine[0]))%13] crypt=tuple[0] key=tuple[1] tmp_len=len(key) if(len(key)%2==0): for i in range(1,tmp_len): key.append(key[tmp_len-i-1]) else: for i in range(0,tmp_len): key.append(key[tmp_len-i-1]) for i in range (0,len(crypt)): # injective crypt[i] res+=sep+str(complement(crypt[i],table,key[i])) sep=cyclik_ascii(sep) return res 5.27.1 Algorithm Chaining the final-level algorithm to get complex crypto-procedure Parameters Type Description tuple tuple List couple representing the crypted string and the associated key Returns str : The full second level crypted string 5.27.2 Source Code sept=['!','"','#','$','%','&','(',')','*','+',',','-','.','/'] res = '' sep =sept[int(int_chaine[1]*m.cos(int_chaine[0]))%13] for i in range (0,len(liste)): res+=sep+str(liste[i]) sep=cyclik_ascii(sep) # print(res) return res 158 Chapter 5. Raptor Cryptographic Algorithm v3.1 5.28 slurp 5.26. crypt_final 5.27 crypt_final_long def crypt_final_long(liste,int_chaine,table) def slurp(chaine)

  Key builder from the half key as integer list. It rebuild the missing half with a mirror copy of the first one.

	tmp='' res = [] sep=['A','B','C','D','E','F','G','H','I','J','K','L'] for elem in chaine: if(not elem in sep): tmp+=str(elem) else: res.append(tmp) tmp='' if(elem==''): break res.append(tmp) return res 162 Chapter 5. Raptor Cryptographic Algorithm v3.1 5.32 miam def miam(key) 5.32.1 Algorithm Parameters Type Description key int list The half key as int list Returns int list : The full key rebuilded from the half key 5.32.2 Source Code tmp='' count=1 res=[] for this in key: # print("this = "+str(this)) # print("tmp = "+str(tmp)) if(count%2==0): tmp+=str(this) count=1 # print("tmp = "+str(tmp)) res.append(tmp) tmp='' else: tmp=str(this) count+=1 for i in range(0,len(res)): res[i]=int(res[i]) return res 5.32. miam 5.33 resolve def resolve(liste)

  Split the given string argument 'chaine' into slices from threshold size 'seuil'. Each of this slices are allowed into the cryptographic algorithm.

	• Split the string since separators via slurp method • Complement eah ch term in his own value • Apply the inv_tranpose_base method to get the uncrypted terms • Solve the cumulated multiplued weigth with the equation solver • Convert the int list as result to ASCII chain Parameters Type Description chaine str The raw crypted text as string key int list The half key as int list table list of list The Base Table array Returns str : The uncrypted text. 5.34.2 Source Code res = '' base=key[:] tmp = [] key.reverse() tmp = key[:] to_find = [] to_find=slurp(chaine) print(len(to_find)) print(len(key)) for i in range(0,len(to_find)): #injective inverse to_find[i] to_find[i]=complement(to_find[i],table,base[i]) tmp_liste=inv_transpose_base(to_find,base,table) int_liste=resolve(tmp_liste) res = int_to_ascii(int_liste) return res 5.34. decrypt_procedure 5.35 split def split(chaine,seuil) 5.35.1 Algorithm Parameters Type Description chaine str The full string to treat seuil int Define the threshold size of the slices Returns str list : The slices list as result 5.35.2 Source Code res = [] tmp = '' index = 0 div=int(len(chaine)/seuil) for i in range(0,div): tmp='' # print("index = "+str(index)+" | seuil = "+str(seuil)+" | i = "+str(i)) for j in range(index,(index+seuil)): tmp+=chaine[j] # print("j = "+str(j)+" | tmp = "+str(tmp)) if(j==(index+seuil-1)): index=j+1 res.append(tmp) if((index-1)<len(chaine)): tmp=chaine[index:] res.append(tmp) return res 166 Chapter 5. Raptor Cryptographic Algorithm v3.1 5.36 tilps def tilps(chaine) 5.36.1 Algorithm The reverse method of the split function. From a given str list, we rebuild the full length string Parameters Type Description chaine str list The String slices as a list Returns str : The full striing rebuilded from the slices list 5.36.2 Source Code res = '' for i in range (0,len(chaine)): res+=chaine[i] return res 5.36. tilps 5.37 mesqui def mesqui(txt,seuil)

Description of Crypter Main Raptor Cryptographic Alternative Algorithm 6.1.1 Algorithm

  This is the main Raptor Cryptographic Alternative algorithm. During my researches, I have thought about an other version of the algorithm optimised for the long data stream as string. The first algorithm use exponentional integer values list instead of this one wich allow to treat bigger slices using a divider. Each term will be divide during the algorithm. This algorithm is rules by following steps :

	CHAPTER SIX RAPTOR CRYPTOGRAPHIC ATERNATIVE ALGORITHM V1 6.1 • Getting inputs
	Description • Converting ASCII to Integers values to get a numeric list
	txt seuil • Dividing chain : eachterm is divided by the next one str The raw string to treat int The threshold variable to assign the 'fake terms' length
	• Multiplying each i_term to the i+1_term modulo the i+2_term to get the key modulo 26. It means Returns str : The fully 'fake splitted' crypted string key(i)=((data(i)*data(i+1)) modulo data(i+2)) modulo 26
	5.37.2 Source Code
		']
	res=''
	sep='M'
	for i in range(0,len(txt)):
	res+=txt[i]
	if(i%int((seuil))==0):
	res+=sep
	sep=cyclik_ascii_mesquin(sep,int_chaine)
	return res
	168	Chapter 5. Raptor Cryptographic Algorithm v3.1

mesquin=['M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z

Description of De-Crypter Chapter 6. Raptor Cryptographic Aternative Algorithm v1 CHAPTER SEVEN RAPTOR CRYPTOGRAPHIC ATERNATIVE ALGORITHM V2 7.1 Description of Crypter Main Raptor Cryptographic Alternative Algorithm

		(continued from previous page)
	ind=0
	first = key[-1]
	key= key[:-1]
	for item in string:
		if not item in sep:
		tmp+=item
		# print(tmp)
		else:
		rez.append(table[key[ind]].index(tmp))
		tmp=''
		ind+=1
	firstt=rez[-1]
	rez=rez[:-1]
	# Algorithme de décryptage
	for i in range(0,len(rez)):
		rez[i]=rez[i]/10000
	rezz=[]
	rezz.append(first*rez[0])
	for i in range(1,len(rez)):
		rezz.append(rez[i]*rezz[i-1])
	from base_opt import * final=[]
	import random as r
	sep=['!','"','#','$','%','&','(',')','*','+',',','-','.','/'] for i in range(len(rezz)):
	vir=[]	final.append(chr(round(rezz[i])))
	txt=''
	# Construction de la table des bases txt=(chr(first))
	for i in range(len(final)):
	table=table() txt+=str(final[i])
	print(txt)
	string=input('chaine cryptée : ')
	str_key=input('clé : ')
	key=[]
	tmp=''
	ind=0
	for item in str_key:
		if not item in sep:
		tmp+=item
		else:
		key.append(int(tmp))
		tmp=''
		ind+=1
	rez=[]
	tmp=''
		(continues on next page)
	172 6.2.	Chapter 6. Raptor Cryptographic Aternative Algorithm v1

Table converter

 converter

			(continued from previous page)
	table=table()
	# Algorithme de cryptage
	txt=input("Entrez un texte")
	l=[]
	res=[]
	for i in range(len(txt)):
	l.append(ord(txt[i]))
	first=int(l[0])
	for i in range(0,len(l)-1):
	res.append(float(l[i+1]/l[i]))
	key=[]
	for i in range(0,len(l)-2):	# Finir la chaine de texte par trois␣
	˓→caractères "usuels", par exemple "..."
	key.append(int((l[i]*l[i+1])%l[i+2])) # Eventuellement ameliorer la clé en la␣
	˓→complementant a 36 sur [10,36]
	key[i]=(key[i])%26
	for i in range(len(res)):
	res[i]=int(res[i]*10000)
	res.append(first)
	key.append(key[0])	#key padding
	key.append(key[1])
	tmp=0
	Float_res=[]
	Mirror_key=[]
	Mirror_key=mirror(key)
	Mirror_key.append(first)
	# Compute each fraction division float value. Each fraction is defined by res(i)/key(i+1)
	# Each part of the value is represented into a single integer value
	for i in range(len(res)):
	tmp = res[i]/(key[i]+1) Float_res.append(int(tmp))	)
	• Convert into key-indexed Base Table values Float_res.append(int((tmp-int(tmp))*1000))
	• Defining commas and separators from the vir and sep Sets tmp=0.0
	• Return the full crypted string #Multiplying each float res by 10 to get larger values (useful to Base Table converter)
	for i in range(len(Float_res)):
	Float_res[i]*=10
	#Convert into key-indexed Base Table values 7.1.2 Source Code crypt=[]
	for i in range(len(Float_res)):
	from base_opt import * crypt.append(table[Mirror_key[i]][Float_res[i]])
	import random as r
	# rajouter des operations de listes reversibles
	string=""
	ind=0

sep=['!','"','#','$','%','&','(',')','*','+',',','-','.','/'] vir=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U', ˓→'V','W','X','Y','Z'] (continues on next page) 176 Chapter 7. Raptor Cryptographic Aternative Algorithm v2 (continues on next page) 7.1.

Description of Crypter 7.2 Description of De-Crypter Main Raptor Cryptographic Alternative Algorithm

  # Rebuild the terms list from the given string using sep and vir Sets for item in string:if not item in sep and not item in vir: tmp+=item else:# Convert crypted value to their integer index rez.append(table[Mirror_key[ind]].index(tmp))# Devide each of value by 10 to get the smaller origianl values for i in range(len(rez)):rez[i]/=10 Float_rez=[]# Rebuild float values from the integer couples values for i in range(0,len(rez)):# Divide each computed values from multiplication of i_term fo the float list with the␣ ˓→last computed term by 10000 to get origianls terms for i in range(1,len(rez)):

	7.3 mirror	(continued from previous page)
	tmp=''
	ind=0 first=Mirror_key[-1] def mirror(liste)
	Mirror_key=Mirror_key[:-1]
	• Convert crypted value to their integer index
	tmp='' • Devide each of value by 10 to get the smaller origianl values ind+=1
	• Rebuild float values from the integer couples values firstt=rez[-1]
	• Round multiplication of float value and Mirror key value to rebuild terms rez=rez[:-1]
	• Divide each computed values from multiplication of i_term fo the float list with the last computed term by
	10000 to get origianls terms
	• Round and convert to ASCII values to get the original string
	if(i%2==0): 7.2.2 Source Code tmp=rez[i]
	else: from base_opt import * Float_rez.append(tmp+rez[i]/1000) import random as r tmp=0.0
	# Algorithme de décryptage
	# Round multiplication of float value and Mirror key value to rebuild terms
	rez=[]
	table=table() for i in range(len(Float_rez)):
	rez.append(round(Float_rez[i]*(Mirror_key[i]+1)))
	string=input('Chaine Cryptée : ') rezz=[] str_key=input('Clé : ') rezz.append((first*rez[0])/10000)
	Mirror_key=[]
	tmp=''
	ind=0
	for item in str_key: if not item in sep : rezz.append((rez[i]*rezz[i-1])/10000)
	tmp+=item # Round and convert to ASCII values to get the original string final=[] else:
	Mirror_key.append(int(tmp)) for i in range(len(rezz)):
	tmp='' final.append(chr(round(rezz[i])))
	txt=""	ind+=1
	txt=(chr(first))
	rez=[] for i in range(len(final)):
		(continues on next page)
	180	Chapter 7. Raptor Cryptographic Aternative Algorithm v2

sep=['!','"','#','$','%','&','(',')','*','+',',','-','.','/'] vir=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U',

˓→'V','W','X','Y','Z']

(continues on next page)

7.2. Description of De-Crypter

Table ,

 , Or by performing a Base transposition since the 21 Base Table, we obtain : (018𝑘ℎ) 21 = (0.21 4 + 1.21 3 + 8.21 2 + 20.21 + 17) 10 = 13226 (8.8) By drawing up the 16 Base Table, we find : Base transposition since the 16 Base Table, we obtain : The specified base index 𝜉 2 = 10, so any conversion is superfluous. By drawing up the 34 Base Table, we find : Base transposition since the 34 Base Table, we obtain : By drawing up the 28 Base Table, we find : Or by performing a Base transposition since the 28 Base Table, we obtain : Or by performing a Base transposition since the 14 Base Table, we obtain : (0605𝑎) 14 = (6.14 3 + 5.14 + 10) 10 = 16544 (8.16)

	8.2.7 Ξ 4 = 2gai, 𝜉 4 = 28
	⎧ ⎪ ⎪ ⎨ ⎪ ⎩ ⎪	2 = 2 𝑖 = 18 𝑔 = 16 𝑎 = 10	.	(8.13)
	we find : (2𝑔𝑎𝑖) 28 = (2.28 3 + 16.28 2 + 10.28 + 18) 10 = 56746 ⎧ 0 = 0 ⎪ ⎪ ⎪ ⎪ 1 = 1 ⎨ ⎪ ⎪ 8 = 8 . 8.2.8 Ξ 5 = 0605a, 𝜉 5 = 14 𝑘 = 20 ⎪ ⎪ ⎩ ℎ = 17 By drawing up the 14 Base Table, we find :	(8.14) (8.7)
	⎧ ⎪ ⎪ ⎨ ⎪ ⎩ ⎪	0 = 0 𝑎 = 10 6 = 6 5 = 5	.	(8.15)
	⎧ ⎪ ⎪ ⎪ ⎪ ⎨	0 = 0 5 = 5 𝑎 = 10	.	(8.9)
	⎪ ⎪ ⎪ ⎪ ⎩	3 = 3 𝑐 = 12
	Or by performing a (05𝑎3𝑐) 16 = (5.16 3 + 10.16 2 + 3.16 + 12) 10 = 23100	(8.10)
	8.2.5 Ξ 2 = 8064, 𝜉 2 = 10
	⎧ ⎪ ⎪ ⎨ ⎪ ⎩ ⎪	1 = 1 𝑗 = 19 2 = 2 𝑣 = 31	.	(8.11)
	Or by performing a (12𝑣𝑗) 34 = (1.34 3 + 2.34 2 + 31.34 + 19) 10 = 42689	(8.12)
	186				Chapter 8. Math Proof

8.2.4 Ξ

1 = 05a3c, 𝜉 1 = 16 8.2.6 Ξ 3 = 12vj, 𝜉 3 = 34

  : the concatenation operatorTo rebuild the missing half key, we go to reverse 𝜉 with the following syntax Once the full key rebuilded from 𝜉, we could transpose again the rest of the list as step 1.Or by performing a Base transposition since the 13 Base Table, we obtain : (277𝑎4) 13 = (2.134 + 7.13 3 + 7.13 2 + 10.13 + 4) 10 = 73818 (8.21)The specified base index 𝜉 9 = 10, so any conversion is superfluous.Or by performing a Base transposition since the 14 Base Table, we obtain : (2𝑎5𝑑𝑏) 14 = (2.144 + 10.14 3 + 5.14 2 + 13.14 + 11) 10 = 105445 (8.23) 8.2.16 Ξ 11 = 5813, 𝜉 11 = 28 Or by performing a Base transposition since the 28 Base Table, we obtain : (5813) 28 = (5.28 3 + 8.28 2 + 1.28 + 3) 10 = 116063 (8.25) By drawing up the 34 Base Table, we find : Or by performing a Base transposition since the 34 Base Table, we obtain : (36𝑢7) 34 = (3.34 3 + 6.34 2 + 30.34 + 7) 10 = 125875 (8.27) 8.2.18 Ξ 13 = 146367, 𝜉 13 = 10The specified base index 𝜉 13 = 10, so any conversion is superfluous.Or by performing a Base transposition since the 16 Base Table, we obtain : (27706) 16 = (2.164 + 7.16 3 + 7.16 2 + 6) 10 = 161542 (8.28) By drawing up the 21 Base Table, we find : Base transposition since the 21 Base Table, we obtain : (1𝑗68𝑐) 21 = (1.214 + 19.21 3 + 6.21 2 + 8.21 + 12) 10 = 373266 (8.30)We finnaly obtain the following numeric suit :

	8.2.17 Ξ 12 = 36u7, 𝜉 12 = 34
	{ ξ = 𝜉 ⌢ ξ ξ = 𝜉 ⌢ ξ/𝑛	⎧ ⎪ ⎪ ⎨ ⎪ ⎩ ⎪	3 = 3 𝑢 = 30 6 = 6 7 = 7	.	𝑖𝑓 𝜒 𝑚𝑜𝑑 2 = 0 𝑖𝑓 𝜒 𝑚𝑜𝑑 2 = 1	.	(8.19) (8.26)
	8.2.12 Successive Base Transpositions -Step 2
	8.2.13 Ξ 8 = 277a4, 𝜉 8 = 13
	By drawing up the 13 Base Table, we find :
		⎧ ⎪ ⎪ ⎨ ⎪ ⎩ ⎪	2 = 2 𝑎 = 10 4 = 4 7 = 7	.	(8.20)
		⎧ ⎪ ⎪ ⎪ ⎪ ⎨	1 = 1 6 = 6 8 = 8	.	(8.29)
		⎪ ⎪ ⎪ ⎪ ⎩	𝑐 = 12 𝑗 = 19
	By drawing up the 14 Base Table, we find : Or by performing a
		⎧ ⎪ ⎪ ⎪ ⎪ ⎨	2 = 2 5 = 5 𝑎 = 10	.	(8.22)
		⎪ ⎪ ⎪ ⎪ ⎩	𝑏 = 11 𝑑 = 13
	By drawing up the 28 Base Table, we find :
		⎧ ⎪ ⎪ ⎨ ⎪ ⎩ ⎪	1 = 1 8 = 8 3 = 3 5 = 5	.	(8.24)
	188							Chapter 8. Math Proof

• ξ/𝑛 : the mirror of 𝜉 bereft of 𝜉 𝑛 • ξ : the rebuilded key 8.2. Decrypting Protocol • ⌢ 8.2.14 Ξ 9 = 25376, 𝜉 9 = 10 8.2.15 Ξ 10 = 2a5db, 𝜉 10 = 14 8.2.19 Ξ 14 = 27706, 𝜉 14 = 16 8.2.20 Ξ 15 = 1j68c, 𝜉 15 = 21

1.4. recursive_build_sup_lvl_safe_mode

Chapter 2. Raptor Cryptographic Algorithm v1

(continues on next page)2.1. Description of Crypter

2.2. Description of De-crypter

2.8. rec_manage

2.10. int_to_ascii

2.12. local_table_dico

2.20. inv_transpose_base

2.22. cyclik_ascii

2.26. decrypt_procedure

3.12. local_table_dico

4.7. rec_table_construct_final

4.21. crypt_procedure

Chapter 5. Raptor Cryptographic Algorithm v3.1

5.24. complement_at_sup11

Chapter 7. Raptor Cryptographic Aternative Algorithm v2

7.2. Description of De-Crypter

int_to_ascii

def int_to_ascii(crypt)

Algorithm

Utils method : integer to ascii converter.

Description Type Description crypt

int list The int list to convert

Returns str : The converted ASCII string since int list.

Source Code

Algorithm

Algorithm

The crypter manager to orchestrate the crypting procedure. It works from these steps:

• We convert the given ascii string as integer list

• We compute the Base index list as key from the converted integer list

• We build the second part of the key since the mirror of the Base index list

• We compute the cumulated weight of the integer list

• We compute the point by point multiplication between cumulated weigth list and original integer list

• We transpose the multiplied list into the given specified Base from the key

Decrypting Protocol

Initialisation

In this demonstration, we will use a Encrypted list using the Raptor cryptographic algorithm. The terms list is given by : !018kh"05a3c#8064$12vj%2gai&0605a(67500)0ba30*277a4+25376,2a5db-5813 36u7!146367"27706#1j68c

The associated key is given as a public key :

2116103428141013

We consider in a first time differents type of caracters set used in the crypting and Encrypting processes. §= [!,",#,$,%,&,(,),*,+,-, ]

Using this informations, we could get a first Terms list to treat called Ξ.

018kh.05a3c. 8064.12vj.2gai.0605a.67500.0ba30.277a4.25376.2a5db.5813.36u7.146367.27706.1j68c A list with length 16 is highlighting We will use the Set

With 𝜒 the length of the Terms list.

Here 𝜒 = 16, we could observ than length of key 𝜌 | 𝜌 = 𝜒.

Ξ 𝑖 will represent the respectives terms of the list.

We start the decrypting process by exctracting the key's Bases index from the 𝑐 𝑛 number suit contained in key. with 𝑐 𝑖 , ∀ i ∈ [0,𝜌 ], 𝑐 𝑖 ≤ 9

We obtain : 𝜉 = 21. 16.10.34.28.14.10