This commit is contained in:
Leonetienne 2022-02-07 23:51:09 +01:00
parent 4d083e6acf
commit bb86c85d68

View File

@ -27,7 +27,8 @@ It's pretty ghetto, you know?
* If your only other option would be no encryption at all
### I am not kidding, don't use this for critical stuff! Homebrew ciphers tend to be shit!
Especially mine!🗡️
Especially mine!🗡️
Even assumed it's a good cipher, it's implementation leaves a lot to be desired in terms of being cryptographically secure. The whole leaving partial keys in ram- thingy...
## How do I use this?
### *"I don't care about the library. Just let me use it from the command line!"*
@ -76,7 +77,7 @@ Without saying, this is more advanced and not as-easy as the methods supplied in
### Modes of operation
* [CBC] This block cipher makes use of cipher block chaining. Nothing special.
* [IV] The initialization vector is indeed a bit of special sauce, as it depends on your key instead of being static. It is generated by running the feistel network on *E(m=seed, k=seed)*.
* [RRKM] Never heard of a mode like this, so i've named it **R**olling**R**ound**K**ey**M**ode. This basically means that the round key extrapolation is carried out continously over EVERY round on EVERY block. So in addition to *M<sub>i</sub>* being dependent on *E(M,K<sub>i-1,0</sub>)<sub>i-1</sub>* due to CBC, so is now *K<sub>i</sub>* dependent on *K<sub>i-1,r</sub>* with *r* being the maximum number of extrapolated keys within a call of E(). This is handled within the feistel network class, as an instance lifecycle sees all blocks, if you want to take a peek.
* [RRKM] Never heard of a mode like this, so i've named it **R**olling**R**ound**K**ey**M**ode. This basically means that the round key extrapolation is carried out continously over EVERY round on EVERY block. So in addition to *M<sub>i</sub>* being dependent on *E(M<sub>i</sub>,K<sub>i-1,0</sub>)<sub>i-1</sub>* due to CBC, so is now *K<sub>i</sub>* dependent on *K<sub>i-1,r</sub>* with *r* being the maximum number of extrapolated keys within a call of *E()*. This is handled within the feistel network class, as an instance lifecycle sees all blocks, if you want to take a peek.
### Password to key
How does *GC* transform a password to a key?
@ -88,7 +89,7 @@ First up, we have to establish what requirements this transformation must fulfil
Let's be honest, I'm not a cryptographer, i have no idea how collision resistant this is.
This means, it has to be considered *insecure*!
I have tried a few passwords brute-forcibly, experimentally (about 1mil) and have not been able to produce a collision.
Obviously there have to be collisions, because *|P|, len\(p\) &#8712; &#8501; &#8811; |C|*.
Obviously there have to be collisions, since *|P|, len\(p\) &#8712; &#8501; &#8811; |C|*.
How does it work? Basically, what happens is your password gets recoded to binary. It is then split into blocks of
size KEY_SIZE, they are &xoplus; together, and this single block is then encrypted with itself as a key.