Pages:
Author

Topic: keysubtracter - test - development requests - bug reports - page 3. (Read 2145 times)

hero member
Activity: 862
Merit: 662
how to reduce the search range of 125 to 120 ? what range i put for substract the public key of 125 to smaller range ? 0:1f>>>>> ?

there is no way to narrow it down with 100% certainty, In the best case the complexibility is the same, in the worst case the complexibility is sometimes worse. I've trying so many methods and none of then give you some certainty.
jr. member
Activity: 50
Merit: 1
how to reduce the search range of 125 to 120 ? what range i put for substract the public key of 125 to smaller range ? 0:1f>>>>> ?
newbie
Activity: 29
Merit: 0
Is 'n' 32bit limited?

sadly yes, but are you going to do a list of more of 2 billion address?


Not sure I need that but I was curious to test out and found that with 'n' higher than that the first address doesn't change.
Also when trying to make a big file I've found it working very slow. Uses only 4 threads (or maybe 2 cores). Thought the drive may be the problem but ram drive doesn't make any change.
Would be nice (and code simple I guess) to make the output file parted for such experiments
hero member
Activity: 862
Merit: 662
Is 'n' 32bit limited?

sadly yes, but are you going to do a list of more of 2 billion address?

newbie
Activity: 29
Merit: 0
Is 'n' 32bit limited?
full member
Activity: 1162
Merit: 237
Shooters Shoot...
Quote
could you give me an example command line for puzzle #125

It really depends on what you are trying to do and which program you will use to achieve what you are trying to do.

But a basic setting would be:

Code:
WindowsKeySubtractorV2.2 -p 0233709eb11e0d4439a729f21c2c443dedb727528229713f0065721ba8fa46f00e -s -n 1000 -r 1:fffff -o 125OffsetKeys.txt
pause

Or if you are using with a program that needs only x points:

Code:
WindowsKeySubtractorV2.2 -p 0233709eb11e0d4439a729f21c2c443dedb727528229713f0065721ba8fa46f00e -z -s -n 1000 -r 1:fffff -o 125OffsetKeys.txt
pause

And with those, I used -s to subtract, but you could use -a or -s and -a to get both added and subtracted points.



copper member
Activity: 1330
Merit: 899
🖤😏
LOL 100%. My high school math teacher used to beat the hell out of me, hence my limited understanding. I have already read about the elliptic curve and all I could figure out from it was the fact that the graph looks like a vagina if you rotate it and the G spot is never on a single spot, very similar to a woman's body. Lol.


On github it says we need to save the generated data to get a private key from it, so could you give me an example command line for puzzle #125? I will take care of the rest, thanks.
full member
Activity: 1162
Merit: 237
Shooters Shoot...
New release for Windows Version (I guess it will compile and work on Linux as well).

https://github.com/WanderingPhilosopher/Windows-KeySubtractor/releases/tag/v2.2

New features/changes:

-a = add to pubkey only
-s = subtract from pubkey only

-a -s = add and subtract at same time, as before.

-z = x point only. Program will leave off leading y coord parity, 02 and/or 03. Only applicable when generating new pubkeys. Does not impact addresses or hash160s.

I added a completion percentage so people wouldn't wonder how close the program was from being finished LOL.

I converted the + and - info, from decimal to hex. I did this to save on file size/drive space. If you find a pubkey, address or hash160, you'll have to do math either way to reconstruct your target pubkey.

A few notes. You always have to use the -n flag. That tells the program how many keys you want to generate.
When using the -n, if you use -n 1000, you are telling the program to generate 1000 new pubkeys, addresses, or hash160s.
You have to use -n AND either -a, -s, or both.
If you use -a or -s alone, so if you use -a -n 1000, the program will add and generate 1000 new pubkeys.
If you use -a and -s together, so if you use -a -s -n 1000. the program will add and subtract 1000 new pubkeys, not 2000 new pubkeys.

My release section has the compiled Windows exe file. To run on Windows, download the WindowsKeySubtractorv2.2.zip folder. Unzip it. Edit the batch file settings. Make sure you run the program in the same folder as the .dll file (included in the zip folder) or you will get the "Missing libgmp-10.dll" error. Unless you have libgmp-10.dll loaded on your PC and set in the Path/environments.

Let me know of any bugs that you may find.

WP

full member
Activity: 1162
Merit: 237
Shooters Shoot...
@albert0bsd, I am facing the same error issue while running this in ubantu 22.04 LTS

having gcc version gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0

How to solve this please help.

thanks and Regards.

By same error, do you mean error message "collect2: error: ld returned 1 exit status"? I tried compiling this tool on newly installed Debian 11 and got similar error. My gcc version is gcc version 10.2.1 20210110 (Debian 10.2.1-6).

Code:
gcc -O3 -c sha256/sha256.c -o sha256.o
gcc -O3 -c base58/base58.c -o base58.o
gcc -O3 -c rmd160/rmd160.c -o rmd160.o
gcc -O3 -c gmpecc.c -o gmpecc.o
gcc -O3 -c util.c -o util.o
gcc -o keysubtracter keysubtracter.c gmpecc.o util.o sha256.o base58.o rmd160.o -lgmp
/usr/bin/ld: gmpecc.o:(.bss+0x2020): multiple definition of `EC'; /tmp/ccwgKfYZ.o:(.bss+0x0): first defined here
/usr/bin/ld: gmpecc.o:(.bss+0x0): multiple definition of `DoublingG'; /tmp/ccwgKfYZ.o:(.bss+0x40): first defined here
/usr/bin/ld: gmpecc.o:(.bss+0x2000): multiple definition of `G'; /tmp/ccwgKfYZ.o:(.bss+0x20): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:7: default] Error 1


I had same issues when compiling for windows using MingW64; my work around to fix this was to:

edit the gmpecc.c
strike out #include "gmpecc.h"
and remove the code starting with void Point_Doubling...
Code:

#include
//#include "gmpecc.h"


void Point_Doubling(struct Point *P, struct Point *R) {
mpz_t slope, temp;
mpz_init(temp);
mpz_init(slope);
if(mpz_cmp_ui(P->y, 0) != 0) {
mpz_mul_ui(temp, P->y, 2);
mpz_invert(temp, temp, EC.p);
mpz_mul(slope, P->x, P->x);
mpz_mul_ui(slope, slope, 3);
mpz_mul(slope, slope, temp);
mpz_mod(slope, slope, EC.p);
mpz_mul(R->x, slope, slope);
mpz_sub(R->x, R->x, P->x);
mpz_sub(R->x, R->x, P->x);
mpz_mod(R->x, R->x, EC.p);
mpz_sub(temp, P->x, R->x);
mpz_mul(R->y, slope, temp);
mpz_sub(R->y, R->y, P->y);
mpz_mod(R->y, R->y, EC.p);
} else {
mpz_set_ui(R->x, 0);
mpz_set_ui(R->y, 0);
}
mpz_clear(temp);
mpz_clear(slope);
}

void Point_Addition(struct Point *P, struct Point *Q, struct Point *R) {
mpz_t PA_temp,PA_slope;
mpz_init(PA_temp);
mpz_init(PA_slope);
if(mpz_cmp_ui(P->x, 0) == 0 && mpz_cmp_ui(P->y, 0) == 0) {
mpz_set(R->x, Q->x);
mpz_set(R->y, Q->y);
}
else {
if(mpz_cmp_ui(Q->x, 0) == 0 && mpz_cmp_ui(Q->y, 0) == 0) {
mpz_set(R->x, P->x);
mpz_set(R->y, P->y);
}
else {
if(mpz_cmp_ui(Q->y, 0) != 0) {
mpz_sub(PA_temp, EC.p, Q->y);
mpz_mod(PA_temp, PA_temp, EC.p);
}
else {
mpz_set_ui(PA_temp, 0);
}
if(mpz_cmp(P->y, PA_temp) == 0 && mpz_cmp(P->x, Q->x) == 0) {
mpz_set_ui(R->x, 0);
mpz_set_ui(R->y, 0);
}
else {
if(mpz_cmp(P->x, Q->x) == 0 && mpz_cmp(P->y, Q->y) == 0) {
Point_Doubling(P, R);
}
else {
mpz_set_ui(PA_slope, 0);
mpz_sub(PA_temp, P->x, Q->x); //dx = B.x - A.x
mpz_mod(PA_temp, PA_temp, EC.p); ///dx = dx % p
mpz_invert(PA_temp, PA_temp, EC.p); //gmpy2.invert(dx, p) % p
mpz_sub(PA_slope, P->y, Q->y);
mpz_mul(PA_slope, PA_slope, PA_temp);
mpz_mod(PA_slope, PA_slope, EC.p);
mpz_mul(R->x, PA_slope, PA_slope); //c*c
mpz_sub(R->x, R->x, P->x); // c*c - A.x
mpz_sub(R->x, R->x, Q->x); //(c*c - A.x) - B.x
mpz_mod(R->x, R->x, EC.p); // Rx % p
mpz_sub(PA_temp, P->x, R->x);
mpz_mul(R->y, PA_slope, PA_temp);
mpz_sub(R->y, R->y, P->y);
mpz_mod(R->y, R->y, EC.p);
}
}
}
}
mpz_clear(PA_temp);
mpz_clear(PA_slope);
}

void Scalar_Multiplication(struct Point P, struct Point *R, mpz_t m) {
struct Point SM_T,SM_Q;
int no_of_bits, i;
no_of_bits = mpz_sizeinbase(m, 2);
mpz_init_set_ui(SM_Q.x,0);
mpz_init_set_ui(SM_Q.y,0);
mpz_init_set_ui(SM_T.x,0);
mpz_init_set_ui(SM_T.y,0);
mpz_set_ui(R->x, 0);
mpz_set_ui(R->y, 0);
if(mpz_cmp_ui(m, 0) != 0) {
mpz_set(SM_Q.x, P.x);
mpz_set(SM_Q.y, P.y);
for(i = 0; i < no_of_bits; i++) {
if(mpz_tstbit(m, i)) {
mpz_set(SM_T.x, R->x);
mpz_set(SM_T.y, R->y);
mpz_set(SM_Q.x,DoublingG[i].x);
mpz_set(SM_Q.y,DoublingG[i].y);
Point_Addition(&SM_T, &SM_Q, R);
}
}
}
mpz_clear(SM_T.x);
mpz_clear(SM_T.y);
mpz_clear(SM_Q.x);
mpz_clear(SM_Q.y);
}

void Point_Negation(struct Point *A, struct Point *S) {
mpz_sub(S->y, EC.p, A->y);
mpz_set(S->x, A->x);
}

/*
Precalculate G Doublings for Scalar_Multiplication
*/
void init_doublingG(struct Point *P) {
int i = 0;
mpz_init(DoublingG[i].x);
mpz_init(DoublingG[i].y);
mpz_set(DoublingG[i].x,P->x);
mpz_set(DoublingG[i].y,P->y);
i = 1;
while(i < 256){
mpz_init(DoublingG[i].x);
mpz_init(DoublingG[i].y);
Point_Doubling(&DoublingG[i-1] ,&DoublingG[i]);
mpz_mod(DoublingG[i].x, DoublingG[i].x, EC.p);
mpz_mod(DoublingG[i].y, DoublingG[i].y, EC.p);
i++;
}
}

and place it all in keysubtracter.c after :
Code:
mpz_t min_range,max_range,diff,TWO,base_key,sum_key,dst_key;
gmp_randstate_t state;

The problem, for Windows at least, was #include "gmpecc.h" was being called in keysubtracter.c and gmpecc.c 
That is what causes that error message. I tried to use the #pragma once and other flags to pass to the compiler, but it wouldn't work on Windows.

You can look at the files on my github repo if you are still confused.
https://github.com/WanderingPhilosopher/Windows-KeySubtractor

Hope that helps.
full member
Activity: 1162
Merit: 237
Shooters Shoot...
Hola.

New release for windows; now the add only, subtract only, or both is available in my new release.

https://github.com/WanderingPhilosopher/Windows-KeySubtractor/releases/tag/v2.0

Please test and let me know of any bugs.

Thanks again albert0bsd!
copper member
Activity: 1330
Merit: 899
🖤😏
Hi, in simple terms, what can we do with it? Is it to brute force private keys using pub keys?
I'm not familiar with this tool what parameters should I use?
newbie
Activity: 5
Merit: 0
@albert0bsd, I am facing the same error issue while running this in ubantu 22.04 LTS

having gcc version gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0

How to solve this please help.

thanks and Regards.

By same error, do you mean error message "collect2: error: ld returned 1 exit status"? I tried compiling this tool on newly installed Debian 11 and got similar error. My gcc version is gcc version 10.2.1 20210110 (Debian 10.2.1-6).

Code:
gcc -O3 -c sha256/sha256.c -o sha256.o
gcc -O3 -c base58/base58.c -o base58.o
gcc -O3 -c rmd160/rmd160.c -o rmd160.o
gcc -O3 -c gmpecc.c -o gmpecc.o
gcc -O3 -c util.c -o util.o
gcc -o keysubtracter keysubtracter.c gmpecc.o util.o sha256.o base58.o rmd160.o -lgmp
/usr/bin/ld: gmpecc.o:(.bss+0x2020): multiple definition of `EC'; /tmp/ccwgKfYZ.o:(.bss+0x0): first defined here
/usr/bin/ld: gmpecc.o:(.bss+0x0): multiple definition of `DoublingG'; /tmp/ccwgKfYZ.o:(.bss+0x40): first defined here
/usr/bin/ld: gmpecc.o:(.bss+0x2000): multiple definition of `G'; /tmp/ccwgKfYZ.o:(.bss+0x20): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:7: default] Error 1




@albert0bsd, I am facing the same error issue while running this in Linux PC 4.4.0-19041-Microsoft #2311-Microsoft Tue Nov 08 17:09:00 PST 2022 x86_64 GNU/Linux

┌──(pc㉿PC)-[~/keysubtracter]
└─$ sudo make
gcc -O3 -c sha256/sha256.c -o sha256.o
gcc -O3 -c base58/base58.c -o base58.o
gcc -O3 -c rmd160/rmd160.c -o rmd160.o
gcc -O3 -c gmpecc.c -o gmpecc.o
gcc -O3 -c util.c -o util.o
gcc -o keysubtracter keysubtracter.c gmpecc.o util.o sha256.o base58.o rmd160.o -lgmp
/usr/bin/ld: gmpecc.o:(.bss+0x2020): multiple definition of `EC'; /tmp/ccbXGjoT.o:(.bss+0x0): first defined here
/usr/bin/ld: gmpecc.o:(.bss+0x0): multiple definition of `DoublingG'; /tmp/ccbXGjoT.o:(.bss+0x40): first defined here
/usr/bin/ld: gmpecc.o:(.bss+0x2000): multiple definition of `G'; /tmp/ccbXGjoT.o:(.bss+0x20): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:7: default] Error 1

┌──(pc㉿PC)-[~/keysubtracter]
└─$ uname -a
Linux PC 4.4.0-19041-Microsoft #2311-Microsoft Tue Nov 08 17:09:00 PST 2022 x86_64 GNU/Linux

┌──(pc㉿PC)-[~/keysubtracter]
└─$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/12/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 12.2.0-10' --with-bugurl=file:///usr/share/doc/gcc-12/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-12 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-12-w47ffq/gcc-12-12.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-12-w47ffq/gcc-12-12.2.0/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (Debian 12.2.0-10)


@albert0bsd, having gcc version gcc
How to solve this please help.

thanks and Regards.
newbie
Activity: 1
Merit: 0
 @albert0bsd, I am facing the same error issue while running this in ubantu 22.04 LTS

having gcc version gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0

How to solve this please help.

thanks and Regards.
hero member
Activity: 862
Merit: 662
What version of Ubuntu do you have?

Code:
uname -a

What version of gcc do you have?

Code:
gcc -v
newbie
Activity: 1
Merit: 0
Quote
gcc -o keysubtracter keysubtracter.c gmpecc.o util.o sha256.o base58.o rmd160.o -lgmp
/usr/bin/ld: gmpecc.o:(.bss+0x2020): multiple definition of `EC'; /tmp/ccmArVbb.o:(.bss+0x0): first defined here
/usr/bin/ld: gmpecc.o:(.bss+0x0): multiple definition of `DoublingG'; /tmp/ccmArVbb.o:(.bss+0x40): first defined here
/usr/bin/ld: gmpecc.o:(.bss+0x2000): multiple definition of `G'; /tmp/ccmArVbb.o:(.bss+0x20): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:7: default] Error 1

Hello everyone,
i can't build this on windows ubuntu shell
member
Activity: 406
Merit: 47

I don't know subtract method will work or not? not yet have sample case for test with any puzzle improve
but many people try, I will tri to test this subtract method (not yet clear to understand on this knowledge)
Is there any other scripts keysubtracter in python language (sorry for ask, I am not expert on c++, I am not programmer)?

For this keysubtracter in c++ language, why not try to add GPU calculate to work faster (Dev both CUDA and OpenCL will be great)
hero member
Activity: 862
Merit: 662
please write easy understand make python or explain mathematicaly

I don't know python, but here is a link that explain the point Negation in eliptic curves:

https://www.youtube.com/watch?v=0EsyHJvf_JE

https://trustica.cz/en/2018/03/08/elliptic-curves-point-negation/

For you example the negated Point is : 04c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5e51e970159c23 cc65c3a7be6b99315110809cd9acd992f1edc9bce55af301705

And the result is:

0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c 4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8

Regards!

jr. member
Activity: 70
Merit: 1
this code subtracte in c language https://github.com/WanderingPhilosopher/Windows-KeySubtractor/releases/tag/v1.0


yes i know this git code
i am not understand c language so,
                         
input two point
privatekey    3     -    2      =   1
                 point1 - point2 = point3
                                               X                                                                                                                         Y
point1 f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9      388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672
point2 c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5   1ae168fea63dc339a3c58419466ceaeef7f632653266d0e1236431a950cfe52a


i need 3rd point subtract value

please write easy understand make python or explain mathematicaly
full member
Activity: 1162
Merit: 237
Shooters Shoot...
Here is the Windows version:

https://github.com/WanderingPhilosopher/Windows-KeySubtractor

albert0bsd,

You may want to add the link in your main post so people who use Windows know they can use your program as well.

WP

Edit:  If Windows users wish to compile on their own, I followed this guide  https://www.msys2.org/  to download, install, setup the mingw-w64 GCC. Follow the instructions. Once complete, you can go to the above github page that has my Windows release and download the files and unzip. Open up MSYS MinGW 64-bit, do a cd (change directory) to the folder containing the files. Once there, simply type in make.

Enjoy.
full member
Activity: 1162
Merit: 237
Shooters Shoot...
I finally figured it out...how to compile in Windows using Mingw64 with make command!

I am learning more and more outside of my comfort zone of Visual Studio.

Sorry it took me so long lol.

I will post code for this code, the keysubtracter and your new code for, ecctools

Many thanks for the 2 cool programs
Pages:
Jump to: