Small collection of tools written in C for ECC and bitcoin

Overview

ecctools

Small collection of tools written in C for ECC and bitcoin

Why this programs are written in C language?

Well i like C language because compiled code is faster than interpreted code.

How to download and run the code?

For Termux users you need to install some utilities

apt update && apt upgrade
apt install root-repo
apt install git -y
apt install build-essential -y
apt install libgmp

Clone this repository

git clone https://github.com/albertobsd/ecctools.git

Compile:

make

rehashaddress

A NON standard, deterministic private key generator from a password or passphrase.

what is the objective of this tool? just provide a easy way to generate deterministics privatekeys from a selected password or passphrase and number of rehashes

Advice: USE A SECURE PASSWORD

Example of use

Generate 2 privatekeys and his address after 100 thausand of rehahes

./rehashaddress -p "}78~Et=jPQP5}MVVj2fc0X38{~I}?c" -n 2 -m 100000

Output:

[I] Password: }78~Et=jPQP5}MVVj2fc0X38{~I}?c
[I] n: 2
[I] m: 100000
Privatekey: ca12010ce2daaf02611d440acd42e8bc791881375c58197cf56995059b28e797
Compress publickey: 035f149fb58e6eb5a7bcc812c1f72e5c9a3ee7ea151991a31a4d3e98e5ace25568
Compress address: 16Ln3w1JLD8s7rNni37A7SiVmVPHXEHFWF
Uncompress publickey: 045f149fb58e6eb5a7bcc812c1f72e5c9a3ee7ea151991a31a4d3e98e5ace2556850fc0b339809eda8cc9f74ee698ed018049b0cfbefe72e66dbc256622f1662d7
Uncompress address: 1NKUnTCtN3Pbm3wEVsFZFuotKkjPPi4g3B
Privatekey: 1037ea7cc723e34f3d81d9e01b5b1df081d47312a3d549b67fd635424446c1b0
Compress publickey: 026813442784ee62c0d69dcf244f91518e85f4a796a1b967758aef1b7d88abd23b
Compress address: 1JWH4qYemWFJAULUtcx1QiboDAD64Bb718
Uncompress publickey: 046813442784ee62c0d69dcf244f91518e85f4a796a1b967758aef1b7d88abd23bd7e12a189fa7d6a80154cbf29999b74bece7bfcca8a70e3df92d8ece238e8700
Uncompress address: 1Ho9VcvHcdu5Xrkv3pcME5zaPvyje1AWnM

Please check the comments in the source code rehashaddress.c

calculatefromkey

A easy way to check the address and publickeys of a privatekey

what is the objective of this tool? just to check a privatekey and his address and publickey

Example of use

./calculatefromkey ca12010ce2daaf02611d440acd42e8bc791881375c58197cf56995059b28e797

Output:

privatekey: ca12010ce2daaf02611d440acd42e8bc791881375c58197cf56995059b28e797
publickey compressed: 035f149fb58e6eb5a7bcc812c1f72e5c9a3ee7ea151991a31a4d3e98e5ace25568
public address compressed 16Ln3w1JLD8s7rNni37A7SiVmVPHXEHFWF
publickey uncompressed: 045f149fb58e6eb5a7bcc812c1f72e5c9a3ee7ea151991a31a4d3e98e5ace2556850fc0b339809eda8cc9f74ee698ed018049b0cfbefe72e66dbc256622f1662d7
public address uncompressed 1NKUnTCtN3Pbm3wEVsFZFuotKkjPPi4g3B

Do you wanna more programs here?

Well just ask for the program that you want. But please don't be annoying, I do this for hobby and fun.

Use the Issue section or the bitcointalk topic:

https://github.com/albertobsd/ecctools/issues

https://bitcointalk.org/index.php?topic=5361234.0

Donations:

  • BTC: 1Coffee1jV4gB5gaXfHgSHDz9xx9QSECVW
  • ETH: 0x6222978c984C22d21b11b5b6b0Dd839C75821069
  • DOGE: DKAG4g2HwVFCLzs7YWdgtcsK6v5jym1ErV
Issues
  • Why then devide to 32 not work ?

    Why then devide to 32 not work ?

    I devide 62 bits pubkey to 32

    And get this pubkeys:

    03782e746d99acac63f8ef9fced1164cd55b20a28b1567ea34ce8dca4b0d890d40
    03666b5737758ddeb7bb98a95432cb81c58e9931e32b4b54ffa3b72faec6c33ba6
    03666b5737758ddeb7bb98a95432cb81c58e9931e32b4b54ffa3b72faec6c33ba6
    03782e746d99acac63f8ef9fced1164cd55b0a28b1567ea34ce8dca4b0d890d40
    03f231dc9ca5aa43b5bd96ad639b61a2348bf5918ca4a8ec79c9c4276deed78f8d

    Result zero !! Nothin founded.

    Albert, please help ?????

    Regards.😭

    opened by Hurd8x 20
  • Unsecure EC scalar multiplication

    Unsecure EC scalar multiplication

    You should warn clearly that this implementation of ECC point multiplication is not secure at all regarding side-channel attacks (power, EM/RF emissions, memory read), and timing measurements. Depending of the bits of the scalar number (usually a private secret), the operations performed are very different. https://github.com/albertobsd/ecctools/blob/main/gmpecc.c#L99

    All the operations requiring this point multiplication are affected and are not secure. Public key computation (with keygen, or calculatefromkey) and sharedsecret ECDH.

    This should not be used in any system in production, or securing a private key.

    opened by antonio-fr 9
  • / 2

    / 2

    hi @albertobsd ! Can you help me and explain one thing: example privkey 0x30a6e39807c92c3533dac2acd41452 pubkey of this privkey 02B5F5D0BF884267CC5B3D6BF5B185AD6CC8BF63704D2BD0951A41B2A1744EB39C you see that this privkey is odd and it can be divide by 2 equals pubkey also can divide by 2 but when we 0x30a6e39807c92c3533dac2acd41452 / 2 = 0x185371cc03e4960000000000000000 == pubkey = 038C3D7D46F82B9287014A8E248A390760CB58E64DA570F2B6A67720FE41971A8C and 02B5F5D0BF884267CC5B3D6BF5B185AD6CC8BF63704D2BD0951A41B2A1744EB39C / 2 = 02186bd8fc6ef3103226bc23637c6d13a75a4779ff041f771c71ea386b43d6b4d4

    AS you see the pubkeys are differents? why? can you explain if you know. Thank you

    opened by kpot87 6
  • Make please additional function to ./keymath and ./modmath ?

    Make please additional function to ./keymath and ./modmath ?

    Bro, then try calculate some more difficult for ex divide pubkey + multiply key to number + add to pubkey a number needs paste previous result(from 1, 2, 3 operation etc).

    Can you add function for calculate many math operation then just one run ? For ex after publick key add MANY needed operation and calculate for ex:

    ./keymath 03a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070 / 4 , x 6 , + 1, /6 , + 10, x 3, / 8 etc ???

    ./modmath 1233456fffeeecc / 4 , x 6 , + 1, /6 , + 10, x 7,+4, / 1 etc ??? Please Bro ?

    This function will be very helpful.

    Please Bro ?

    Thank You

    opened by Hurd8x 4
  • Problem install

    Problem install

    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 gmpecc.c:1:10: fatal error: gmp.h: No such file or directory 1 | #include <gmp.h> | ^~~~~~~ compilation terminated. make: *** [Makefile:7: default] Error 1

    opened by ET2200 4
  • Consecutive substraction

    Consecutive substraction

    Posting the same comment i left on Youtube ! :D

    Hello alberto ! I wanted to know if it is possible to do substraction with the public key the same way it work with keydivision. Fore exemple instead of writing a line eache time i want to do a substraction with the result of the public key would it be possible to do like : ./keymath (publickey) - 1 -n (number of operations) In short : Doing consecutive substraction or addition

    opened by Pvnic 4
  • Why this method not work on puzzle privkeys ? p.s. dividing...

    Why this method not work on puzzle privkeys ? p.s. dividing...

    Hi

    Loock: we have pubkey of this privkey - 0xfffffffffffffffffffffffff

    ./md 0xfffffffffffffffffffffffff / 0x4000000000000 Result: 80266a9dd3b03fffffffffffffffffff5d269cebf99579e8f2f9b463c06987c4

    ./md 0x80266a9dd3b03fffffffffffffffffff5d269cebf99579e8f2f9b463c06987c4 - 0x4000000000000 Result: 80266a9dd3b03fffffffffffffffffff5d269cebf99579e8f2f5b463c06987c4

    [email protected]:~/ecctools$ ./md 0x80266a9dd3b03fffffffffffffffffff5d269cebf99579e8f2f5b463c06987c4 x 0x4000000000000 Result: fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140

    [email protected]:~/ecctools$ ./md 1 - 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140

    Result: 2 this is a privkey what belong to pubkey, what we will brute - privkey 2.

    we was find orivkey 2, and now we recover this privkey 0xfffffffffffffffffffffffff

    ./md 1 - 2 Result: fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140

    [email protected]:~/ecctools$ ./md 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140 / 0x4000000000000 Result: 80266a9dd3b03fffffffffffffffffff5d269cebf99579e8f2f5b463c06987c4

    ./md 0x80266a9dd3b03fffffffffffffffffff5d269cebf99579e8f2f9b463c06987c4 x 0x4000000000000 Result: fffffffffffffffffffffffff

    succesfuly recovered.

    why method not work with puzzle priv/pubkey ? I try many times but not succesful.

    ????

    opened by Hurd8x 3
  • Why this happened ?

    Why this happened ?

    Bro, good day or night ;)

    Why resulted private key after dividing is bigger then a devided privkey ?

    [email protected]:~/ecctools$ ./modmath 0x100000000000000000000000000000 0 / 30240
    Result: 61cb720c761cb720c761cb720c761cb6a4811d64db34aaa77c3500a19c342 679

    Ho to manipulate with keys for get result < then a 0x100000000000000000000000000000 ??

    Thanks !

    opened by Hurd8x 3
  • Core Dumped (segmentation fault)

    Core Dumped (segmentation fault)

    Hello Alberto i'v been trying to use keydivision with an Input file but it seems to not work. The error i get doing it is in the title and the error i get with the compiler is this :

    keydivision.c:167:5: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] 167 | fgets(buffer_input,1024,INPUT); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ keydivision.c:206:6: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] 206 | fgets(buffer_input,1024,INPUT); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gcc -O3 -o keymath keymath.c gmpecc.o util.o base58.o sha256.o rmd160.o -lgmp rm *.o

    Thank you !

    opened by Pvnic 3
  • offer

    offer

    There are no good products in the software at the moment. For bip 39 (BIP32, bip44) and also there are no good bip38 recovery products (this is very necessary.) If you have the interest and time, the community will owe you a debt. Thanks for your time and your efforts. I am not an expert in c but wrote bip 32.44 to work in python. This sparked interest in the community. BIP 38 is interesting to me personally for restoring access to the wallet. I will look forward to hearing from you. Your products are unique

    opened by Noname400 3
  • How to limit the number of decimal numbers obtained during calculation and used in calculations ?

    How to limit the number of decimal numbers obtained during calculation and used in calculations ?

    Good day.

    Then I use keymath and modmath and devide for deviding for example 777 / 999 = 0.77777777777777777....7 inf. modmath and keymath genererate result not with minimum needed float numbers 0.77777777777777777(This will be named X) * 999 = 777.0, but with maximum nposible float number - 0.777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 ........7 (this will be named Y) * 999 = 777.0 and private / publick keys for X and Y are different !!!

    How to use in calculus editable floats count in result ? Bro, help plesse ?

    opened by Hurd8x 2
  • Question

    Question

    Hi Alberto.

    Key math is an arithmetic calculator for public keys, containing only four operations:

    -addition -subtraction -multiplication by a scalar number -division by a scalar number

    It would be fantastic if we could do these operations "Key math" performed from the "input file.txt" and saved in "output файл.txt ". Let's say we specified one of the four operations (x / + - ) according to which the number "35" or another number will be calculated, then "Key math" we perform this operation with each line from the "output файл.txt ".

    opened by Fgghjjghjnj 0
  • calculatefrompublickey from file

    calculatefrompublickey from file

    Can you make it where it can do it from a file like this does https://github.com/albertobsd/ecctools#addr2rmd to address or rmd160.

    I also notice you have https://github.com/albertobsd/ecctools#calculatefromkey and https://github.com/albertobsd/ecctools#calculatefrompublickey but both are the same

    opened by bigvito19 0
Owner
Luis Alberto
Luis Alberto
Retter - A collection of hash functions, ciphers, tools, libraries, and materials related to cryptography & security

Retter - A collection of hash functions, ciphers, tools, libraries, and materials related to cryptography & security.

Maciej A. Czyzewski 75 Jul 28, 2022
BTCU Wallet is the original Bitcoin Ultimatum client and it builds the backbone of the network.

The concept of BTCU is similar to the concept of the second cryptocurrency by capitalization - Ethereum.

Bitcoin Ultimatum (BTCU) 31 Jul 1, 2022
Bitcoin and Altcoins Publickey subtracter

keysubtracter Bitcoin and Altcoins Publickey subtracter Generate multiple but different "copies" of a publickey, Actually Added and substracted public

Luis Alberto 18 Jun 17, 2022
Bitcoin Core integration/staging tree

Bitcoin is an experimental digital currency that enables instant payments to anyone, anywhere in the world. Bitcoin uses peer-to-peer technology to operate with no central authority: managing transactions and issuing money are carried out collectively by the network. Bitcoin Core is the name of open source software which enables the use of this currency.

Bitcoin 65.5k Jul 29, 2022
A high-performance distributed Bitcoin mining pool server.

Viabtc Mining Server ViaBTC Mining Server is a high-performance distributed Bitcoin mining pool server. We have made a lot of optimizations for Bitcoi

ViaBTC 91 Jul 11, 2022
Dogecoin is a cryptocurrency like Bitcoin

Dogecoin is a cryptocurrency like Bitcoin, although it does not use SHA256 as its proof of work (POW). Taking development cues from Tenebrix and Litecoin, Dogecoin currently employs a simplified variant of scrypt.

Dogecoin 14.2k Aug 6, 2022
Bitcoin Point of Sale

LNPoS Hardware https://shop.pimoroni.com/products/m5stack-faces-kit-pocket-computer-with-keyboard-game-calculator Installation Install Arduino IDE: ht

Arc 115 Aug 5, 2022
Bitcoin Core integration/staging tree

Bitcoin Core integration/staging tree https://bitcoincore.org For an immediately usable, binary version of the Bitcoin Core software, see https://bitc

Bitcoin Core 36 Jul 6, 2022
Brute Force Bitcoin Private keys, Public keys

Rotor-Cuda This is a modified version of KeyHunt v1.7 by kanhavishva. A lot of gratitude to all the developers whose codes has been used here. Feature

LostCoins 74 Jul 23, 2022
Onix is a decentralized blockchain project built on Bitcoin's UTXO model

What is Onix? Onix is a decentralized blockchain project built on Bitcoin's UTXO model, with support for Ethereum Virtual Machine based smart contract

Onix CryptoCurrency Development 4 Dec 16, 2021
mako - full bitcoin implementation in C

mako - full bitcoin implementation in C

Christopher Jeffrey (JJ) 528 Jul 30, 2022
Open-source, airgapped bitcoin hardware signer for the M5StickV.

Krux ✝ Krux is an open-source DIY hardware signer for Bitcoin that can sign for multisignature and single-key wallets. It is a low-cost airgapped devi

Jeff 42 Jul 29, 2022
A small HOTP/TOTP SHA1 client written in C, depending only on libcrypto (OpenSSL)

A small HOTP/TOTP SHA1 client written in C, depending only on libcrypto (OpenSSL)

null 3 Jan 21, 2022
Libraries and tools to perform fully homomorphic encryption operations on an encrypted data set.

Fully Homomorphic Encryption (FHE) This repository contains open-source libraries and tools to perform fully homomorphic encryption (FHE) operations o

Google 2.7k Aug 4, 2022
Collection of common encryption.

EasyCipher 概述 EasyCipher收集了几种常见的加密方法的C语言实现,并基于Android平台封装了jni接口。 提供的加密方法包括 AES加密核心部分,不涉及模式和padding,支持128bits和256bits AES/CBC/PKCS5Padding SHA256 HAMC-

Billy Wei 6 Jun 9, 2022
A collection of public domain/unlicense single-file cryptography

simple-crypto A collection of single-file public domain/unlicense cryptographic functions in different programming languages. Feel free to copy-paste

null 5 May 16, 2022
Mbedcrypto - a portable, small, easy to use and fast c++14 library for cryptography.

mbedcrypto mbedcrypto is a portable, small, easy to use, feature rich and fast c++14 library for cryptography based on fantastic and clean mbedtlsnote

amir zamani 37 Jun 16, 2022
Small portable AES128/192/256 in C

Tiny AES in C This is a small and portable implementation of the AES ECB, CTR and CBC encryption algorithms written in C. You can override the default

null 3.2k Aug 1, 2022