DO NOT USE THIS. This is a re-do of a security research, not ready for real world deployment
This project was insipired by my time as an undergrad researcher in USP, studying under Odemir Bruno and Jeaneth Machicao. With their guidance, the concept of this system was described and a first c++ draft was created, but unfortunately never finished.
Until now.
This Cryptographic system is based on the i-Logistic map equation. Machicao published many papers on the k-logistic map[1], reaching the conclusion that it was a suitable equation for a Cryptographically Secure Pseudo Random Number Generator (CSPRNG).
This is a pretty famous function for chaos studies. The hard-to-explain, impossible to predict logistic map looks like so:
Quite the complicated mathematical function, right?
Once
That is, unpredictably until we talk about cryptography. See, the probability density for each possible value of x is not exactly flat, it is more of a sharp U, as the probability of getting a 0 or a 1 exponentially increase once we get close to rounding errors in floating point variables.
This small but noticeable probability shift makes the cryptographic security of logistic map-based cryptographies be questionable at best. This is where Machicao's research come in:
Machicao[2] sought to fix the problems with using the logistic map by discarding the first k digits of
Recent studies[3] show that this is reliable enough to be considered cryptographically secure, and - more importantly to me - have given a good way to calculate when something can be considered reliable enough to be secure, so I can come back to my undergrad plans
As someone with a mind for computers and binaries, I spoke to Machicao about approaching this problem in a more computer-friendly way. Instead of discarding the first k digits of the number in decimal notation, we could discard the first k binary digits (bits), making everything faster to compute and more suited to low power computers$^*$.
Anyway, I needed a way to differentiate my idea from Machicao's, and since hers used k as the exponent and I was going for bits, i seemed the best choice.
With all that preamble done, let's look at what I am actually doing here:
I want to design a simple stream cipher based on the i-logistic map, use a simple reversible operation to mix it with the plaintext (haven't decided yet on XOR, modular addition, or both) and spit out the text.
For option 1 we have:
For the second option we have:
Where:
- $ r_i $ is the random number generated in the i-th iteration;
- $ P_i $ is the i-th plaintext character;
- $ C_i $ is the i-th ciphertext character;
- $ \oplus $ is the XOR operation;
- $ % $ is the mod operation;
For decrypting, everything works the same, with the exception of the second option, where we use modular subtraction instead.
Since chaotic systems are very sensitive to change, every last bit of the state is useful for us when calculating keyspace. Assuming we are using n bytes for the state, the minimum amount of bits of keyspace - assuming a suitable key generation algorithm - would be 8*n.
Seeing as we need at least 256 bits to have something considered secure against brute forcing for simetric encryption, we need to use at least 32 bytes.
There is also a possibility of parameterizing
A conveniently suitable keygen algorithm - based on user-inputted data - would use a secure hashing algorithm that results in a hash with at least as many bits as the key we are using, so for 256 bits, we can use SHA256, and for 512 bits we can use SHA512. The second one will be assumed for the rest of this explanation.
With those demonstrably secure random bits generated, our key space is limited to 512 or
Well, remember when I said we need fixed point notation, of arbitrary precision no less - seeing how many bytes we need for a system secure against brute force?
This means I have to make my own system - as GMP, despite technicaly covering it, was too general to give the speed I wanted.
The simple system I created (in fixed.h) is beautiful, but has a fatal flaw: It needs a power of 2 amount of bytes. This means we can't skirt the edge of acceptable to get the most performance out of our system, but we can use 32 bytes for state.
The final keyspace that can be reliably generated based on the given limitations is 32 bytes for internal state and 16 bytes for the
There are no results for now, but as I develop and implement things, I'll keep this readme posted
After I finish the basic version, there are other ways to use the i-logistic map's ideas.
- Use the tent map, instead of the logistic map, as the source of randomness: It is a coarser, but easier to compute by hand, equation that can present similar results to the logistic map. It's just a bit of variety, doubling the keyspace of the system, i guess.
- Modularize the system so my cryptography can take any PRNG I create and just run with it, assuming it will work. It's gonna make every other item in this list much easier
- Use a combined logistic-map and tent-map[4]; This is not my original idea, but it is a good one nonetheless. The new system will use 2 possible compositions of logistic and tent maps, instead of only using one or the other. The paper says it is more suitable to cryptagraphic purposes, but I expect a big drop in performance. This will increase the amount of PRNGs by 2 again, for a total of 4.
- Use one map to add perturbations to another. This idea is my own (With Odemir's nudge back when I researched with him). The idea is that there will be 2 maps running, one for samppling as the CSPRNG, the other perturbing the first after a random amount of iterations. The idea is that the perturbations are so infrequent that there will not be enough information to fully describe the internal system of the CSPRNG at any point. We could also mix-n-match the previously described systems, instead of just using a single map, for a grand total of 16 combinations + 4 non-perturbed systems, 20 CSPRNGs (though using the same one twice might be bad, so possibly only 16).
- Use a secondary map for block cipher-ing this system. Right now, this is a strea cipher, which is faster but less secure than block ciphers. We need a secondary source of random-ness to create "block cipher modes of operation" and really blow this home-project out of proportion. Since we can mix-n-match again, we could have as many as 400 (maybe only 256) options just for CSPRNG alone (though choosing the same twice could also be a bad idea, so we might only have 240).
[1] https://aip.scitation.org/doi/abs/10.1063/1.4983836
[2] https://arxiv.org/pdf/2111.05101.pdf