albert0bsd (OP)
|
 |
September 22, 2021, 08:29:19 AM Last edit: April 06, 2022, 09:00:41 PM by albert0bsd |
|
I made a new repository in github ecctoolsThis is a small collection of tools that i've made in the past months, most of those tools only do one or two things, those task are or were useful for me in some moments. Tool lists: List of tools in this repository - keygen
- sharedsecret
- rehashaddress
- calculatefromkey
- calculatefrompublickey
- keydivision
- keymath
- modmath
- addr2rmd
I will be updating this list when i add some new codes I start this topic just to seek ideas, improvements, bug reports, requests. Regards!
|
|
|
|
examplens
Legendary
Offline
Activity: 3654
Merit: 3894
Wheel of Whales 🐳
|
 |
September 22, 2021, 09:43:39 AM |
|
add in the title something like (for Linux users only) 
|
|
|
|
WanderingPhilospher
Sr. Member
  
Offline
Activity: 1372
Merit: 268
Shooters Shoot...
|
I will help, but we need to figure out how Windows users can easily compile or at least have a .exe file to run on Windows. I will try to compile on Windows - Mingw64 using make command. Will post update. No good with Mingw64 and make command. Same errors as keysubtracter. C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gmpecc.o:gmpecc.c:(.bss+0x2020): multiple definition of `EC'; C:\msys64\tmp\ccf7PnVf.o:rehashaddress.:(.bss+0x2040): first defined here C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gmpecc.o:gmpecc.c:(.bss+0x0): multiple definition of `DoublingG'; C:\msys64\tmp\ccf7PnVf.o:rehashaddress.:(.bss+0x20): first defined here C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: gmpecc.o:gmpecc.c:(.bss+0x2000): multiple definition of `G'; C:\msys64\tmp\ccf7PnVf.o:rehashaddress.:(.bss+0x2020): first defined here collect2.exe: error: ld returned 1 exit status make: *** [Makefile:9: default] Error 1
But for Keyhunt, I can create/compile using Mingw64 and using make command.
|
|
|
|
WanderingPhilospher
Sr. Member
  
Offline
Activity: 1372
Merit: 268
Shooters Shoot...
|
 |
September 23, 2021, 02:10:02 AM |
|
I was able to compile under Windows using Mingw64!! 
|
|
|
|
WanderingPhilospher
Sr. Member
  
Offline
Activity: 1372
Merit: 268
Shooters Shoot...
|
 |
September 23, 2021, 02:51:24 AM |
|
Here is the Windows version: https://github.com/WanderingPhilosopher/Windows-ECC-Toolsalbert0bsd, 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.
|
|
|
|
albert0bsd (OP)
|
add in the title something like (for Linux users only)  Well, yes i usually develop for linux, but the code can be running on windows through the ubuntu shell. Also with Mingw64. I was able to compile under Windows using Mingw64!!  That is what i'm talking about  Thanks! 1. For rehashaddress, what hash algorithm do you use?
for now only sha256, but i will add some extra options. 2. Looking at README.md, looks like this tool only support legacy address (address with prefix 1), is it true?
Yes that is true for now, i will plan to add some extra kind of address but i'm still learning and testing it. 3. You might want to mention version of C (and other dependency/utility), so other people (and yourself in the future) could save some time.
Excellent yes, i will add it in the readme, some times I forget that most users doesn't know linux, also i forget that most user never read the readme LOL I will add it, also to the readme in github. Thanks!
|
|
|
|
albert0bsd (OP)
|
 |
September 24, 2021, 07:39:36 AM |
|
Interesting i saw that it use scrypt and pbkdf2. s1 = scrypt(key=(passphrase||0x1), salt=(salt||0x1), N=218, r=8, p=1, dkLen=32) s2 = pbkdf2(key=(passphrase||0x2), salt=(salt||0x2), c=216, dkLen=32, prf=HMAC_SHA256) keypair = generate_bitcoin_keypair(s1 ⊕ s2)
I will implement that, one to generate those address and another to forcebrute them.
|
|
|
|
PrivatePerson
Member

Offline
Activity: 174
Merit: 12
|
 |
April 06, 2022, 02:58:00 PM |
|
~/ecctools$ ./addr2rmd -bash: ./addr2rmd: No such file or directory ~/ecctools$ make gcc -O3 -c bloom/bloom.c -o bloom.o 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 xxhash/xxhash.c -o xxhash.o #gcc -O3 -c gmpecc.c -o gmpecc.o gcc -O3 -c util.c -o util.o gcc -O3 -o rehashaddress rehashaddress.c gmpecc.c util.o sha256.o base58.o rmd160.o -lgmp gcc -O3 -o calculatefromkey calculatefromkey.c gmpecc.c util.o base58.o sha256.o rmd160.o -lgmp `libgcrypt-config --cflags --libs` gcc -O3 -o calculatefrompublickey calculatefrompublickey.c util.o base58.o sha256.o rmd160.o -lgmp gcc -O3 -o keydivision keydivision.c gmpecc.c util.o base58.o sha256.o rmd160.o -lgmp gcc -O3 -o keymath keymath.c gmpecc.c util.o base58.o sha256.o rmd160.o -lgmp gcc -O3 -o modmath modmath.c gmpecc.c util.o base58.o sha256.o rmd160.o -lgmp gcc -O3 -o keygen keygen.c gmpecc.c util.o sha256.o base58.o rmd160.o -lgmp -lcrypto `libgcrypt-config --cflags --libs` keygen.c: In function ‘main’: keygen.c:152:38: warning: unknown conversion type character ‘\x0a’ in format [-Wformat=] 152 | fprintf(stderr,"OpenSSL error: %l\n",err); | ^~ keygen.c:152:20: warning: too many arguments for format [-Wformat-extra-args] 152 | fprintf(stderr,"OpenSSL error: %l\n",err); | ^~~~~~~~~~~~~~~~~~~~~ keygen.c:135:4: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result] 135 | fread(buffer_key,1,bytes,fd); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ keygen.c:145:4: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result] 145 | fread(buffer_key,1,bytes,fd); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ keygen.c:158:4: warning: ignoring return value of ‘getrandom’, declared with attribute warn_unused_result [-Wunused-result] 158 | getrandom(buffer_key,bytes,GRND_NONBLOCK); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gcc -O3 -o sharedsecret sharedsecret.c gmpecc.c util.o sha256.o base58.o rmd160.o -lgmp `libgcrypt-config --cflags --libs` sharedsecret.c: In function ‘main’: sharedsecret.c:82:2: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] 82 | fgets(buffer,1022,stdin); | ^~~~~~~~~~~~~~~~~~~~~~~~ sharedsecret.c:90:2: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] 90 | fgets(buffer,1022,stdin); | ^~~~~~~~~~~~~~~~~~~~~~~~ rm *.o
|
|
|
|
seoincorporation
Legendary
Offline
Activity: 3528
Merit: 3229
|
 |
April 06, 2022, 04:40:10 PM |
|
Great tool mate thanks for sharing it. I would like to request a feature if it's possible. It would be nice if you add the passphrase (BrainWallet) option, that way people we can recover or create addresses from words or phrases. A good example of this is: https://brainwalletx.github.io/On that site we can input the phrase 'bitcointalk', and get the address: 15Ds7MtbSx8hxC73dojDzMj2WE6jTJHR67 That is why I think this would be a great tool for your collection. If you need some help I have a script on bash and python for passphrase and I could share them with you for the C code translation.
|
|
|
|
albert0bsd (OP)
|
 |
April 06, 2022, 09:04:11 PM |
|
~/ecctools$ ./addr2rmd -bash: ./addr2rmd: No such file or directory Sorry for that I just forget to add the compilation line in the Makefile. I already update that repository. It would be nice if you add the passphrase (BrainWallet) option, that way people we can recover or create addresses from words or phrases. A good example of this is:
I already have a tool for that in the repossitory it is rehashaddress this tool can generate a Endless addresses from a passphrase check the readme for more details. Basic example: $ ./rehashaddress -p bitcointalk -n 1 -m 0 [I] Password: bitcointalk [I] n: 1 [I] m: 0 Privatekey: 75959c5b70c912201868c26256115fd330ef389dcf93468d33a13a0716ca55e7 Compress publickey: 036c36c67862ee2ff9aac1df60c7a45da6dfdf0dd2ded2acb5a23dec86cdd1ea73 Compress address: 1JrxYDDPLSeocamJCXTPQTQvn2u5Uhgnw5 Uncompress publickey: 046c36c67862ee2ff9aac1df60c7a45da6dfdf0dd2ded2acb5a23dec86cdd1ea73bc4219906bf6c3a676b9151f5841dff2150654801ae1ed5f65665370f8db90f9 Uncompress address: 15Ds7MtbSx8hxC73dojDzMj2WE6jTJHR67
|
|
|
|
seoincorporation
Legendary
Offline
Activity: 3528
Merit: 3229
|
 |
April 07, 2022, 02:06:27 PM |
|
... I already have a tool for that in the repossitory it is rehashaddress this tool can generate a Endless addresses from a passphrase check the readme for more details. Basic example: $ ./rehashaddress -p bitcointalk -n 1 -m 0 [I] Password: bitcointalk [I] n: 1 [I] m: 0 Privatekey: 75959c5b70c912201868c26256115fd330ef389dcf93468d33a13a0716ca55e7 Compress publickey: 036c36c67862ee2ff9aac1df60c7a45da6dfdf0dd2ded2acb5a23dec86cdd1ea73 Compress address: 1JrxYDDPLSeocamJCXTPQTQvn2u5Uhgnw5 Uncompress publickey: 046c36c67862ee2ff9aac1df60c7a45da6dfdf0dd2ded2acb5a23dec86cdd1ea73bc4219906bf6c3a676b9151f5841dff2150654801ae1ed5f65665370f8db90f9 Uncompress address: 15Ds7MtbSx8hxC73dojDzMj2WE6jTJHR67 I see mate, you are right, there is the tool but I get confused with the name, but it's what I was looking for. Now, what you have as Privatekey output is the Secret Exponent, and I don't see the privatekey in the output: For that same example: Secret Exponent: 75959c5b70c912201868c26256115fd330ef389dcf93468d33a13a0716ca55e7 Privatekey: 5Ji57mxMqPCo5jKuaQxTv9HYnkjVMYrh2ZieRhMyesiJQeVz2Du And I think this is important because if we want to import the address to any wallet the right format is the one starting with 5J...
|
|
|
|
albert0bsd (OP)
|
 |
April 07, 2022, 02:27:21 PM |
|
O right the privatekey in WIF format, I will add it later
|
|
|
|
fxsniper
Member

Offline
Activity: 406
Merit: 47
|
 |
April 17, 2022, 10:34:00 AM |
|
I have a problem with compiled all tools on WSL2 ubuntu can compile success only one is rehashaddress other code is error
Did this tools have a python code version that can be used keydivision keymath modmath
|
|
|
|
fxsniper
Member

Offline
Activity: 406
Merit: 47
|
 |
April 17, 2022, 11:04:57 AM |
|
still have some errors when compiling (make) keygen.c: In function ‘main’: keygen.c:152:38: warning: unknown conversion type character ‘\x0a’ in format [-Wformat=] fprintf(stderr,"OpenSSL error: %l\n",err); ^~ keygen.c:152:20: warning: too many arguments for format [-Wformat-extra-args] fprintf(stderr,"OpenSSL error: %l\n",err); ^~~~~~~~~~~~~~~~~~~~~ keygen.c:135:4: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result] fread(buffer_key,1,bytes,fd); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ keygen.c:145:4: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result] fread(buffer_key,1,bytes,fd); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ keygen.c:158:4: warning: ignoring return value of ‘getrandom’, declared with attribute warn_unused_result [-Wunused-result] getrandom(buffer_key,bytes,GRND_NONBLOCK); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gcc -O3 -o sharedsecret sharedsecret.c gmpecc.c util.o sha256.o base58.o rmd160.o -lgmp `libgcrypt-config --cflags --libs` sharedsecret.c: In function ‘main’: sharedsecret.c:82:2: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] fgets(buffer,1022,stdin); ^~~~~~~~~~~~~~~~~~~~~~~~ sharedsecret.c:90:2: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] fgets(buffer,1022,stdin); ^~~~~~~~~~~~~~~~~~~~~~~~
some I try to fix problems not found file and require file "gmp.h" and file "openssl/rand.h just random fix sudo apt-get install libgmp3-dev sudo apt install libgcrypt sudo apt install libgcrypt20-dev sudo apt install openssl sudo apt-get install libssl-dev
|
|
|
|
albert0bsd (OP)
|
 |
December 12, 2022, 06:14:17 PM Last edit: December 23, 2022, 02:40:12 AM by albert0bsd |
|
I just add verifymsg to the reposity This is a tool to help to vefiry the signatature of a bitcoin message : ./verifymsg -m 1E9YwDtYf9R29ekNAfbV7MvB4LNv7v3fGa -a 1NChfewU45oy7Dgn51HwkBFSixaTnyakfj -s "HCsBcgB+Wcm8kOGMH8IpNeg0H4gjCrlqwDf/GlSXphZGBYxm0QkKEPhh9DTJRp2IDNUhVr0FhP9qCqo2W0recNM="
The signature match with the address and it is valid
-----BEGIN BITCOIN SIGNED MESSAGE----- 1E9YwDtYf9R29ekNAfbV7MvB4LNv7v3fGa -----BEGIN BITCOIN SIGNATURE----- 1NChfewU45oy7Dgn51HwkBFSixaTnyakfj HCsBcgB+Wcm8kOGMH8IpNeg0H4gjCrlqwDf/GlSXphZGBYxm0QkKEPhh9DTJRp2IDNUhVr0FhP9qCqo2W0recNM= -----END BITCOIN SIGNATURE-----
Also it have some VERBOSE mode -v it give you the calculated publickey of the address, also the values RSZ for this signature. ./verifymsg -m 1E9YwDtYf9R29ekNAfbV7MvB4LNv7v3fGa -a 1NChfewU45oy7Dgn51HwkBFSixaTnyakfj -s "HCsBcgB+Wcm8kOGMH8IpNeg0H4gjCrlqwDf/GlSXphZGBYxm0QkKEPhh9DTJRp2IDNUhVr0FhP9qCqo2W0recNM=" -v Final X, Y : 2b0172007e59c9bc90e18c1fc22935e8341f88230ab96ac037ff1a5497a61646 105ecd499fa11dffe894dead6759ab732baf593b6a4da4b7a7294d5afffa02b7 Final R: 2b0172007e59c9bc90e18c1fc22935e8341f88230ab96ac037ff1a5497a61646 Final S: 058c66d1090a10f861f434c9469d880cd52156bd0584ff6a0aaa365b4ade70d3 Final Z: d6a75acdff18b0a8103f867c6cab8c12ec8ac250dfa8dcdb4f89d8e553270115 Calculated address: 1NChfewU45oy7Dgn51HwkBFSixaTnyakfj Calculated publickey uncompressed: 044e01f16fe203dbfd8110fd636f42e69bd2fa9e0fef913f00554e4412cb1cae070296f95c6b64f3fdcb7ee9dc838f20b992077e839703b3c2c5427e90e5afd0d1 Calculated publickey compressed: 034e01f16fe203dbfd8110fd636f42e69bd2fa9e0fef913f00554e4412cb1cae07
The signature match with the address and it is valid
-----BEGIN BITCOIN SIGNED MESSAGE----- 1E9YwDtYf9R29ekNAfbV7MvB4LNv7v3fGa -----BEGIN BITCOIN SIGNATURE----- 1NChfewU45oy7Dgn51HwkBFSixaTnyakfj HCsBcgB+Wcm8kOGMH8IpNeg0H4gjCrlqwDf/GlSXphZGBYxm0QkKEPhh9DTJRp2IDNUhVr0FhP9qCqo2W0recNM= -----END BITCOIN SIGNATURE-----
|
|
|
|
GR Sasa
Member

Offline
Activity: 200
Merit: 14
|
 |
July 09, 2023, 11:30:41 AM |
|
Hi WanderingPhilospher,
I just noticed that you only compiled 2 tools out of 9 tools that Alberto developed in his ecctools
Could you please help us compile others tools for us windows users?
Thank you, and Goodluck hunting for #130!
|
|
|
|
|
digaran
Copper Member
Hero Member
   
Offline
Activity: 1330
Merit: 903
🖤😏
|
 |
July 31, 2023, 06:47:35 PM |
|
Is there any example command to use modmath, keydivision etc for windows? Appreciate a reply.
|
🖤😏
|
|
|
GR Sasa
Member

Offline
Activity: 200
Merit: 14
|
 |
July 31, 2023, 07:00:23 PM |
|
Many examples are written in the repository ecctools. Alberto already provided couple of examples for each program 
|
|
|
|
digaran
Copper Member
Hero Member
   
Offline
Activity: 1330
Merit: 903
🖤😏
|
 |
July 31, 2023, 09:24:46 PM |
|
Many examples are written in the repository ecctools. Alberto already provided couple of examples for each program  I just read WP's page, there was only 1 example, since Alberto and WP share the same topic, I had to ask it here, you could have said that when I asked you via PM. Thanks though, let the never ending division begin! 😉
|
🖤😏
|
|
|
|