This repository has been archived by the owner on Oct 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DOCS.txt
101 lines (54 loc) · 3.6 KB
/
DOCS.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
DIVISION:
This is just a proof of concept program just to show how we can divide publickeys.
The result from exact divisions is the same like any decimal number but if the division is not exact the result will be in an unknow place in the curve
Example of use: Divide a publickey bewteen 4 three times in a row:
./division -p 03a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070 -n 3 -d 4
Output:
03f694cbaf2b966c1cc5f7f829d3a907819bc70ebcc1b229d9e81bda2712998b10
02e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d
033ab6bde10cd3ac0cd06883fa66f0b0e3eb1309c0534b812286e2a30ca540db99
explanation:
the target publickey `03a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070` have privatekey `0x1000000000000000000000000000000`
each line of the output are the result of divide the publickey by 4 lets to check this example with math
MATH:
math is basically an arithmetic calculator For publickeys with only four operations:
- addition
- subtration
- multiplication by an scalar number
- division by an scalar number
previous example:
./math 03a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070 / 4
output:
Result: 03f694cbaf2b966c1cc5f7f829d3a907819bc70ebcc1b229d9e81bda2712998b10
this is the first line of the division example, their privatekey is `0x1000000000000000000000000000000` bewteen 4 equals to `0x400000000000000000000000000000`
./math 03f694cbaf2b966c1cc5f7f829d3a907819bc70ebcc1b229d9e81bda2712998b10 / 4
output:
Result: 02e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d
from here you can do your calculations by your self
multiplication by an scalar number:
The multiplication and the division only can be done with a number you can't multiply or divide two publickeys
./math 033ab6bde10cd3ac0cd06883fa66f0b0e3eb1309c0534b812286e2a30ca540db99 x 64
Result: 03a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070
Modmath
this is an arithmetic calculator but all operations are modulo N, this is Modulo `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141`
Did you remember that i write before: "not exact the result will be in an unknow place in the curve" Well!!, we can know more or less where those result are but even with this information we can't find values when we don't know the PrivateKey value.
./modmath 1 / 2
Output:
Result: 7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1
./modmath 3 / 2
Output:
Result: 7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a2
if you see those privatekeys are sequentially, Lest to divide the publickeys of `1` and `3` by `2`
./math 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 / 2
output:
Result: 0200000000000000000000003b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63
./math 02f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9 / 2
output:
Result: 02c62c910e502cb615a27c58512b6cc2c94f5742f76cb3d12ec993400a3695d413
Know you can comprobate that the publickeys of `7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1` and `7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a2` are
`0200000000000000000000003b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63`
`02c62c910e502cb615a27c58512b6cc2c94f5742f76cb3d12ec993400a3695d413`
can you calcualte what is the publickey of `7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0` with math?
./math 0200000000000000000000003b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63 - 1
output:
Result: 0300000000000000000000003b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63