You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ It is also a part of [_RedLibrary_](https://github.com/Red-company/RedLibrary).
12
12
13
13
## Why I decided to concept that?
14
14
15
-
I was understanding how _DiffieHellman_ works and I thought, _DH_ is really good for making _secure client-server messaging channels_, but _I did have an idea_ how to make the algorithm longer but get an opportunity _to hide the base number_ you use and get a _really good level of safety_.
15
+
I was understanding how _DiffieHellman_ works and I thought, _DH_ is really good for making _secure client-server messaging channels_, but _I did have an idea_ how to make the algorithm longer(and safer) and get an opportunity _to hide the base number_ you use.
16
16
17
17
## How _2lDH_ works by DH colors method?
18
18
@@ -37,7 +37,7 @@ Diffie-Hellman(colors)
37
37
\___/ \___/
38
38
```
39
39
40
-
I'm sure you know it, so, I wrote it here to make it easier to compare with my _2-layer DH_. <br/><br/>
40
+
I'm sure you know it, so, I wrote it here to make it easier to compare with _2-layer DH_. <br/><br/>
41
41
Let's have a look of _2-layer DiffieHellman_:
42
42
43
43
```C
@@ -82,7 +82,7 @@ Shared key = hab
82
82
----------
83
83
```
84
84
85
-
So, as you can see, that looks like a doubled _DiffieHellman_, and yeah, it is, but, first of all, our _Base Num_ is hidden now, secondly, this _DH_ edition is more secure(it's _not as fast_ as _original DiffieHellman_), and, thirdly, we spend _reasonable time_ to get well secured. In fact, there are some _difficulcy modes_ in this library, which gives it an _ability_ to it to be rather _wide-usable_.
85
+
So, as you can see, that looks like a doubled _DiffieHellman_, and yeah, it is, but, first of all, our _Base Num_ is hidden now, secondly, this _DH_ edition is now safed from log function and, thirdly, we spend _reasonable time_ to get well secured. In fact, there are some _difficulcy modes_ in this library, which gives it an _ability_ to it to be rather _wide-usable_(from IoT to infrastructure-level apps).
In the example file I used _Prime number_ equal to _-1_, because I wanted the algorithm _to be un-cutted in range_ in all operations(I wanted to get a pair of fingerprints that can be used for encryption functions).
150
+
In the example file I used _Prime number_ equal to _-1_, because I wanted the algorithm _to be un-cutted in range_ in all operations(I wanted to get a pair of fingerprints that can be used in encryption functions as a key).
151
151
152
152
The crucial thing in classic DiffieHellman is that you're exchanging something, that it's impossible to calculate sqrt from(or at least toooooooooo difficult, as difficult that useless):
153
153
154
154
```C
155
-
6k.
155
+
6k(unsafest one).
156
156
-------
157
157
158
-
Time spent to calculatefor example = 4s.
158
+
Average time spent to calculate(for example) = 1s.
159
159
160
160
Max value is about (2 ** (6.000 * 6.000)).
161
161
162
+
Key is one of [2;2**36m]. (With some exclusions).
163
+
162
164
Just imagine how much time that takes.
163
165
Or calculate in a big num calculator.
164
166
```
@@ -175,6 +177,8 @@ As we use _2lDH_ that is like 2x _DiffieHellman_, that can be wrote as funny mat
175
177
Est. chance of getting the one we need = lim[x->0] / 2
176
178
```
177
179
180
+
In fact, to break this, first of all we need to capture all packets related to the protocol and to perform all calculations needed after that.
181
+
178
182
## Standards
179
183
180
184
I made some _standards_ for each part to use _2lDH_ in way you need. *Let's check them out.* <br/>
0 commit comments