Apollo18.CipherDecisor (Apollo18 v1.1.9)
Utilitary module to help to choice best cipher parameter
options to be used whit Apollo18
cipher functionality modules.
(This module functionalities are'nt in web/javascript version).
Link to this section Summary
Functions
Receives a string to be ciphered and the max time in seconds desired to the resultant ciphered string should take in moment of decipher. Return the best estimated parameters to be used to decide cipher configurations.
Link to this section Functions
get_best_parameters(string, max_decipher_time_execution_seconds \\ 1)
(since 1.0.0)Receives a string to be ciphered and the max time in seconds desired to the resultant ciphered string should take in moment of decipher. Return the best estimated parameters to be used to decide cipher configurations.
If these returned parameters aren't good for you, you should
manually inform other parameters to Apollo 18
cipher
functionalities as desired/needed.
Keep in mind that's better slice a long text into 2,3 or more parts
and cipher each part separately if you want be more performatic,
or obtain more salt
application on cipher without increase
exponentially the time to cipher/decipher.
For very small strings (<= 200) the salt
parameter vary from 5
to 6. For small strings (<= 1000) the salt
parameter vary from 3
to 4. For all other cases the salt
parameter vary from 1 to 3.
Examples
iex > string = Krug.SanitizerUtil.generate_random(400)
iex > Apollo18.CipherDecisor.get_best_parameters(string,1)
%{base64: false, salt: 4}
iex > string = Krug.SanitizerUtil.generate_random(400)
iex > Apollo18.CipherDecisor.get_best_parameters(string,1)
%{base64: false, salt: 4}
iex > string = Krug.SanitizerUtil.generate_random(400)
iex > Apollo18.CipherDecisor.get_best_parameters(string,1.3)
%{base64: true, salt: 4}
iex > string = Krug.SanitizerUtil.generate_random(2000)
iex > Apollo18.CipherDecisor.get_best_parameters(string,2)
%{base64: true, salt: 3}
iex > string = Krug.SanitizerUtil.generate_random(2000)
iex > Apollo18.CipherDecisor.get_best_parameters(string,1)
%{base64: true, salt: 2}
iex > string = Krug.SanitizerUtil.generate_random(6000)
iex > Apollo18.CipherDecisor.get_best_parameters(string,12)
%{base64: false, salt: 3}
iex > string = Krug.SanitizerUtil.generate_random(6000)
iex > Apollo18.CipherDecisor.get_best_parameters(string,20)
%{base64: true, salt: 3}
iex > string = Krug.SanitizerUtil.generate_random(20000) iex > Apollo18.CipherDecisor.get_best_parameters(string,16) %{base64: false, salt: 2}
iex > string = Krug.SanitizerUtil.generate_random(20000) iex > Apollo18.CipherDecisor.get_best_parameters(string,20) %{base64: true, salt: 2}