I'm learning about bitcoin and while i was testing addresses generation i ran into weird things.
If we generate a 256bits private key k and generate corresponding public key Q.
We could split k in k1 (first 128 bits) and k2 (last 128bits)
Then we generate a set with all 128bits private key and their corresponding public keys.
So, in theory, for each public key in the set:
we multiply the public key by 2^128
then, we substract Q to the result
we test if we have the result in the set
if yes, we have found k
But what is weird is i always found one approximation of k and not the true k.
Here is a link to the experience in python if i'm not clear enough : https://github.com/mvrcrypto/bitp0wn/blob/master/substract_optim.py
EDIT: Okay, i now have one and only one k and i can retrieve the good one. You can get the programm at the address below.