The evo-crypter
project uses an iterative, function composition-based encryption scheme that is inspired by the concept of evolutionary mutations in biology. Here's a more detailed explanation of the algorithm:
src/mutations/mod.c
.fn_<mutation_identifier>_up
: Used for encryption.fn_<mutation_identifier>_down
: Used for decryption.<mutation_identifier>
is a unique symbol (e.g., a number, letter, or special character like # or *) that identifies the mutation.fn_<mutation_identifier>_down
is the exact inverse of fn_<mutation_identifier>_up
. Otherwise, decryption will not correctly restore the original data.evo-crypter
using the --generations
command-line argument.BUFFER_SIZE
in the code).apply_mutation_up
function acts as a dispatcher. Based on the current symbol in the generation sequence, it selects the appropriate fn_<mutation_identifier>_up
function to apply.fn_<mutation_identifier>_up
function is called, modifying the current data chunk.encrypted.txt
by default).apply_mutation_down
function acts as a dispatcher, similar to apply_mutation_up
, but it selects the corresponding fn_<mutation_identifier>_down
function.fn_<mutation_identifier>_down
functions are applied in the reverse order compared to the encryption process. This is crucial for correct decryption.decrypted.txt
by default).evo-crypter
supports multi-threaded processing to improve performance.--threads
command-line argument controls the number of threads used.Let's say the generation sequence is "1,a" and the input file contains "Hello".
Encryption:
fn_1_up
is applied to "Hello" (let's assume it shifts letters by 1: "Hello" -> "Ifmmp").fn_a_up
is applied to "Ifmmp" (let's assume it converts to uppercase: "Ifmmp" -> "IFMMP").fn_1_up
is applied to "IFMMP" (shifted by 1: "IFMMP" -> "JGNNQ").fn_a_up
is applied to "JGNNQ" (converted to uppercase: "JGNNQ" -> "JGNNQ").Decryption:
fn_a_down
is applied to "JGNNQ" (converted to lowercase: "JGNNQ" -> "jgnnq").fn_1_down
is applied to "jgnnq" (shifted back by 1: "jgnnq" -> "ifmmp").fn_a_down
is applied to "ifmmp" (converted to lowercase: "ifmmp" -> "ifmmp").fn_1_down
is applied to "ifmmp" (shifted back by 1: "ifmmp" -> "hello").