Bitcoin Forum
May 03, 2024, 08:27:09 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 2 [3]
41  Local / Кодеры / Re: Casascius python как добавить сюда ещё и генерацию адре on: February 22, 2019, 03:40:00 PM
Ваш код что вы мне дали все прекрасно делает, просто по скорости генерации очень долго.

Можно ли изменить ваш код так что бы все так же генерировался кодом миникеем только в этом скрипте https://github.com/samrushing/paper_key
пускай даже я не увижу приват ключ hex но там же дается приват ключ wif + Address и очень быстро все это делает (подчеркиваю требуется на основе мини-ключа)



42  Local / Кодеры / Re: Casascius python как добавить сюда ещё и генерацию адре on: February 22, 2019, 11:05:22 AM
вот смотрите https://github.com/samrushing/paper_key
просто скрипт что я сейчас вам отправил выше делает все шустро не смотря на свои криптографические вычисления так же получает и приват ключ и адрес

обычный генератор на выходе получаем:
private: L3rx4SDmX3kY4P8B1KngkzdS9qmWZbNoRS8u34dNkhZqeJsUPkE1
public: 1GvzcndBngkUo35GjQs5MVysVEVtP2t2X

за 4 минуты на этом скрипте я получаю таких строк как выше 1 миллион
есть одно но он генерирует рандомно а мне нужно от мини-кеев ( по правилу миникеев )

Quote
SKhHHQLDkHsAniFW2MRyVw9jwDDkKx

если бы можно было как то добавить в этот скрипт что по ссылке генерацию мини-кеев и от них получать так

Quote
SKhHHQLDkHsAniFW2MRyVw9jwDDkKx
private: L3rx4SDmX3kY4P8B1KngkzdS9qmWZbNoRS8u34dNkhZqeJsUPkE1
public: 1GvzcndBngkUo35GjQs5MVysVEVtP2t2X

было бы то что я и пытаюсь получить (нужна скорость)

43  Local / Кодеры / Re: Casascius python как добавить сюда ещё и генерацию адре on: February 21, 2019, 08:48:58 PM
Уж не знаю, зачем вам эти мини-ключи понадобились, но держите:

Code:
import random
import hashlib
import codecs
import ecdsa

BASE58 = '23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'

def Candidate():
    """
    Generate a random, well-formed mini private key.
    """
    return('%s%s' % ('S', ''.join(
        [BASE58[ random.randrange(0,len(BASE58)) ] for i in range(29)])))

def GenerateKeys(numKeys = 10):
    """
    Generate mini private keys and output the mini key as well as the full
    private key. numKeys is The number of keys to generate, and
    """
    keysGenerated = 0
    totalCandidates = 0
    while keysGenerated < numKeys:
        try:
            cand = Candidate()
            # Do typo check
            t = '%s?' % cand
            # Take one round of SHA256
            candHash = hashlib.sha256(t).digest()
            # Check if the first eight bits of the hash are 0
            if candHash[0] == '\x00':
                privateKey = GetPrivateKey(cand)
                print('\n%s\nSHA256( ): %s\nsha256(?): %s\nUncompressed address: %s\nCompressed address: %s' %
                      (cand, privateKey, candHash.encode('hex_codec'), generate_address(privateKey), generate_compressed_address(privateKey)))
                if CheckShortKey(cand):
                    print('Validated.')
                else:
                    print('Invalid!')
                keysGenerated += 1
            totalCandidates += 1
        except KeyboardInterrupt:
            break
    print('\n%s: %i\n%s: %i\n%s: %.1f' %
          ('Keys Generated', keysGenerated,
           'Total Candidates', totalCandidates,
           'Reject Percentage',
           100*(1.0-keysGenerated/float(totalCandidates))))

def GetPrivateKey(shortKey):
    """
    Returns the hexadecimal representation of the private key corresponding
    to the given short key.
    """
    if CheckShortKey(shortKey):
        return hashlib.sha256(shortKey).hexdigest()
    else:
        print('Typo detected in private key!')
        return None

def CheckShortKey(shortKey):
    """
    Checks for typos in the short key.
    """
    if len(shortKey) != 30:
        return False
    t = '%s?' % shortKey
    tHash = hashlib.sha256(t).digest()
    # Check to see that first byte is \x00
    if tHash[0] == '\x00':
        return True
    return False

def generate_address(private_key):
    public_key = __private_to_public(private_key)
    address = __public_to_address(public_key)
    return address
       

def generate_compressed_address(private_key):       
public_key = __private_to_compressed_public(private_key)
address = __public_to_address(public_key)
return address
   

def __private_to_public(private_key):
    private_key_bytes = codecs.decode(private_key, 'hex')
    # Get ECDSA public key
    key = ecdsa.SigningKey.from_string(private_key_bytes, curve=ecdsa.SECP256k1).verifying_key
    key_bytes = key.to_string()
    key_hex = codecs.encode(key_bytes, 'hex')
    # Add bitcoin byte
    bitcoin_byte = b'04'
    public_key = bitcoin_byte + key_hex
    return public_key
       
def __private_to_compressed_public(private_key):
    private_hex = codecs.decode(private_key, 'hex')
    # Get ECDSA public key
    key = ecdsa.SigningKey.from_string(private_hex, curve=ecdsa.SECP256k1).verifying_key
    key_bytes = key.to_string()
    key_hex = codecs.encode(key_bytes, 'hex')
    # Get X from the key (first half)
    key_string = key_hex.decode('utf-8')
    half_len = len(key_hex) // 2
    key_half = key_hex[:half_len]
    # Add bitcoin byte: 0x02 if the last digit is even, 0x03 if the last digit is odd
    last_byte = int(key_string[-1], 16)
    bitcoin_byte = b'02' if last_byte % 2 == 0 else b'03'
    public_key = bitcoin_byte + key_half
    return public_key
       
def __public_to_address(public_key):
    public_key_bytes = codecs.decode(public_key, 'hex')
    # Run SHA256 for the public key
    sha256_bpk = hashlib.sha256(public_key_bytes)
    sha256_bpk_digest = sha256_bpk.digest()
    # Run ripemd160 for the SHA256
    ripemd160_bpk = hashlib.new('ripemd160')
    ripemd160_bpk.update(sha256_bpk_digest)
    ripemd160_bpk_digest = ripemd160_bpk.digest()
    ripemd160_bpk_hex = codecs.encode(ripemd160_bpk_digest, 'hex')
    # Add network byte
    network_byte = b'00'
    network_bitcoin_public_key = network_byte + ripemd160_bpk_hex
    network_bitcoin_public_key_bytes = codecs.decode(network_bitcoin_public_key, 'hex')
    # Double SHA256 to get checksum
    sha256_nbpk = hashlib.sha256(network_bitcoin_public_key_bytes)
    sha256_nbpk_digest = sha256_nbpk.digest()
    sha256_2_nbpk = hashlib.sha256(sha256_nbpk_digest)
    sha256_2_nbpk_digest = sha256_2_nbpk.digest()
    sha256_2_hex = codecs.encode(sha256_2_nbpk_digest, 'hex')
    checksum = sha256_2_hex[:8]
    # Concatenate public key and checksum to get the address
    address_hex = (network_bitcoin_public_key + checksum).decode('utf-8')
    wallet = base58(address_hex)
    return wallet

def base58(address_hex):
    alphabet = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
    b58_string = ''
    # Get the number of leading zeros and convert hex to decimal
    leading_zeros = len(address_hex) - len(address_hex.lstrip('0'))
    # Convert hex to decimal
    address_int = int(address_hex, 16)
    # Append digits to the start of string
    while address_int > 0:
        digit = address_int % 58
        digit_char = alphabet[digit]
        b58_string = digit_char + b58_string
        address_int //= 58
    # Add '1' for each 2 leading zeros
    ones = leading_zeros // 2
    for one in range(ones):
        b58_string = '1' + b58_string
return b58_string


GenerateKeys()

Код взят отсюда.


спасибо большое дай Бог вам здоровья!
Скажите есть ещё варианты генерации?

просто если запустить скрипт тот что я дал с википедии то выходит 1 миллион записей в 4 минуты а скрипт что вы дали выше за несколько часов только справится с 1 миллионом
44  Local / Кодеры / Re: Casascius python как добавить сюда ещё и генерацию адре on: February 21, 2019, 05:42:11 PM
Вам точно нужно генерировать приватные ключи в формате мини-ключей - древнем, никем не поддерживаемом формате?

Да, было бы здорово если бы вы мне помогли со скриптом.... Очень прошу вас
45  Local / Кодеры / Casascius python как добавить сюда ещё и генерацию адрес& on: February 21, 2019, 03:46:50 PM
Есть код у Casascius на python что генерирует мини-ключи
вот с wiki https://en.bitcoin.it/wiki/Mini_private_key_format
Code:
import random
import hashlib

BASE58 = '23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'

def Candidate():
    """
    Generate a random, well-formed mini private key.
    """
    return('%s%s' % ('S', ''.join(
        [BASE58[ random.randrange(0,len(BASE58)) ] for i in range(29)])))

def GenerateKeys(numKeys = 10):
    """
    Generate mini private keys and output the mini key as well as the full
    private key. numKeys is The number of keys to generate, and
    """
    keysGenerated = 0
    totalCandidates = 0
    while keysGenerated < numKeys:
        try:
            cand = Candidate()
            # Do typo check
            t = '%s?' % cand
            # Take one round of SHA256
            candHash = hashlib.sha256(t).digest()
            # Check if the first eight bits of the hash are 0
            if candHash[0] == '\x00':
                privateKey = GetPrivateKey(cand)
                print('\n%s\nSHA256( ): %s\nsha256(?): %s' %
                      (cand, privateKey, candHash.encode('hex_codec')))
                if CheckShortKey(cand):
                    print('Validated.')
                else:
                    print('Invalid!')
                keysGenerated += 1
            totalCandidates += 1
        except KeyboardInterrupt:
            break
    print('\n%s: %i\n%s: %i\n%s: %.1f' %
          ('Keys Generated', keysGenerated,
           'Total Candidates', totalCandidates,
           'Reject Percentage',
           100*(1.0-keysGenerated/float(totalCandidates))))

def GetPrivateKey(shortKey):
    """
    Returns the hexadecimal representation of the private key corresponding
    to the given short key.
    """
    if CheckShortKey(shortKey):
        return hashlib.sha256(shortKey).hexdigest()
    else:
        print('Typo detected in private key!')
        return None

def CheckShortKey(shortKey):
    """
    Checks for typos in the short key.
    """
    if len(shortKey) != 30:
        return False
    t = '%s?' % shortKey
    tHash = hashlib.sha256(t).digest()
    # Check to see that first byte is \x00
    if tHash[0] == '\x00':
        return True
    return False

Если его запустить мы получаем:
Quote
SKhHHQLDkHsAniFW2MRyVw9jwDDkKx
SHA256( ): ae172028e80ef37d3e01906ccd05441946c3efa9e4532ab20f5a6e25ce293840
sha256(?): 0057497a02482464d757500773d3d2c26badbcd94d5081d1cff9ea7c16fd2175
Validated.

Скажите как получить ещё и адресс при генерации

SKhHHQLDkHsAniFW2MRyVw9jwDDkKx
SHA256( ): ae172028e80ef37d3e01906ccd05441946c3efa9e4532ab20f5a6e25ce293840
sha256(?): 0057497a02482464d757500773d3d2c26badbcd94d5081d1cff9ea7c16fd2175
Address: 17bYqJpPz3huoXuz6Dx6iLejuAHA2k2q3H
Validated.

HuhHuhHuhHuhHuhHuhHuhHuhHuhHuhHuh ПОМОГИТЕ ПОЖАЛУЙСТА МУЖИКИ допилить скрипт что бы и адрес выдавал того приват ключа что оно сгенерировало
46  Bitcoin / Bitcoin Discussion / Re: Casascius 2-Factor Physical Bitcoin on: February 20, 2019, 06:44:10 AM
I have recently improved this by introducing BIP 38 and a working proof-of-concept implementation of it.

True. I forgot that random letters have a magnetic quality that pulls the two halves of the letter b (but not d) apart, making it confusing like this. And the research probably shows that 1 and l don’t have this problern, loecause they are all one piece. Good call

help me please
need get address of the private key

Code:
import random
import hashlib

BASE58 = '23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'

def Candidate():
    """
    Generate a random, well-formed mini private key.
    """
    return('%s%s' % ('S', ''.join(
        [BASE58[ random.randrange(0,len(BASE58)) ] for i in range(29)])))

def GenerateKeys(numKeys = 10):
    """
    Generate mini private keys and output the mini key as well as the full
    private key. numKeys is The number of keys to generate, and
    """
    keysGenerated = 0
    totalCandidates = 0
    while keysGenerated < numKeys:
        try:
            cand = Candidate()
            # Do typo check
            t = '%s?' % cand
            # Take one round of SHA256
            candHash = hashlib.sha256(t).digest()
            # Check if the first eight bits of the hash are 0
            if candHash[0] == '\x00':
                privateKey = GetPrivateKey(cand)
                print('\n%s\nSHA256( ): %s\nsha256(?): %s' %
                      (cand, privateKey, candHash.encode('hex_codec')))
                if CheckShortKey(cand):
                    print('Validated.')
                else:
                    print('Invalid!')
                keysGenerated += 1
            totalCandidates += 1
        except KeyboardInterrupt:
            break
    print('\n%s: %i\n%s: %i\n%s: %.1f' %
          ('Keys Generated', keysGenerated,
           'Total Candidates', totalCandidates,
           'Reject Percentage',
           100*(1.0-keysGenerated/float(totalCandidates))))

def GetPrivateKey(shortKey):
    """
    Returns the hexadecimal representation of the private key corresponding
    to the given short key.
    """
    if CheckShortKey(shortKey):
        return hashlib.sha256(shortKey).hexdigest()
    else:
        print('Typo detected in private key!')
        return None

def CheckShortKey(shortKey):
    """
    Checks for typos in the short key.
    """
    if len(shortKey) != 30:
        return False
    t = '%s?' % shortKey
    tHash = hashlib.sha256(t).digest()
    # Check to see that first byte is \x00
    if tHash[0] == '\x00':
        return True
    return False
    GenerateKeys (1)

now
SKhHHQLDkHsAniFW2MRyVw9jwDDkKx
SHA256( ): ae172028e80ef37d3e01906ccd05441946c3efa9e4532ab20f5a6e25ce293840
sha256(?): 0057497a02482464d757500773d3d2c26badbcd94d5081d1cff9ea7c16fd2175
Validated.

need
SKhHHQLDkHsAniFW2MRyVw9jwDDkKx
SHA256( ): ae172028e80ef37d3e01906ccd05441946c3efa9e4532ab20f5a6e25ce293840
sha256(?): 0057497a02482464d757500773d3d2c26badbcd94d5081d1cff9ea7c16fd2175
Address: 17bYqJpPz3huoXuz6Dx6iLejuAHA2k2q3H
Validated.
47  Bitcoin / Development & Technical Discussion / Re: Casascius python upgrade on: February 18, 2019, 09:11:52 PM
hi, can you please try to change the code

Code:
import random
import hashlib

BASE58 = '23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'

def Candidate():
    """
    Generate a random, well-formed mini private key.
    """
    return('%s%s' % ('S', ''.join(
        [BASE58[ random.randrange(0,len(BASE58)) ] for i in range(29)])))

def GenerateKeys(numKeys = 10):
    """
    Generate mini private keys and output the mini key as well as the full
    private key. numKeys is The number of keys to generate, and
    """
    keysGenerated = 0
    totalCandidates = 0
    while keysGenerated < numKeys:
        try:
            cand = Candidate()
            # Do typo check
            t = '%s?' % cand
            # Take one round of SHA256
            candHash = hashlib.sha256(t).digest()
            # Check if the first eight bits of the hash are 0
            if candHash[0] == '\x00':
                privateKey = GetPrivateKey(cand)
                print('\n%s\nSHA256( ): %s\nsha256(?): %s' %
                      (cand, privateKey, candHash.encode('hex_codec')))
                if CheckShortKey(cand):
                    print('Validated.')
                else:
                    print('Invalid!')
                keysGenerated += 1
            totalCandidates += 1
        except KeyboardInterrupt:
            break
    print('\n%s: %i\n%s: %i\n%s: %.1f' %
          ('Keys Generated', keysGenerated,
           'Total Candidates', totalCandidates,
           'Reject Percentage',
           100*(1.0-keysGenerated/float(totalCandidates))))

def GetPrivateKey(shortKey):
    """
    Returns the hexadecimal representation of the private key corresponding
    to the given short key.
    """
    if CheckShortKey(shortKey):
        return hashlib.sha256(shortKey).hexdigest()
    else:
        print('Typo detected in private key!')
        return None

def CheckShortKey(shortKey):
    """
    Checks for typos in the short key.
    """
    if len(shortKey) != 30:
        return False
    t = '%s?' % shortKey
    tHash = hashlib.sha256(t).digest()
    # Check to see that first byte is \x00
    if tHash[0] == '\x00':
        return True
    return False
    GenerateKeys (1)
48  Bitcoin / Development & Technical Discussion / Casascius python upgrade on: February 18, 2019, 05:52:15 PM
help please, who is strong in python
need get address of the private key

wiki code python
Code:
import random
import hashlib

BASE58 = '23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'

def Candidate():
    """
    Generate a random, well-formed mini private key.
    """
    return('%s%s' % ('S', ''.join(
        [BASE58[ random.randrange(0,len(BASE58)) ] for i in range(29)])))

def GenerateKeys(numKeys = 10):
    """
    Generate mini private keys and output the mini key as well as the full
    private key. numKeys is The number of keys to generate, and
    """
    keysGenerated = 0
    totalCandidates = 0
    while keysGenerated < numKeys:
        try:
            cand = Candidate()
            # Do typo check
            t = '%s?' % cand
            # Take one round of SHA256
            candHash = hashlib.sha256(t).digest()
            # Check if the first eight bits of the hash are 0
            if candHash[0] == '\x00':
                privateKey = GetPrivateKey(cand)
                print('\n%s\nSHA256( ): %s\nsha256(?): %s' %
                      (cand, privateKey, candHash.encode('hex_codec')))
                if CheckShortKey(cand):
                    print('Validated.')
                else:
                    print('Invalid!')
                keysGenerated += 1
            totalCandidates += 1
        except KeyboardInterrupt:
            break
    print('\n%s: %i\n%s: %i\n%s: %.1f' %
          ('Keys Generated', keysGenerated,
           'Total Candidates', totalCandidates,
           'Reject Percentage',
           100*(1.0-keysGenerated/float(totalCandidates))))

def GetPrivateKey(shortKey):
    """
    Returns the hexadecimal representation of the private key corresponding
    to the given short key.
    """
    if CheckShortKey(shortKey):
        return hashlib.sha256(shortKey).hexdigest()
    else:
        print('Typo detected in private key!')
        return None

def CheckShortKey(shortKey):
    """
    Checks for typos in the short key.
    """
    if len(shortKey) != 30:
        return False
    t = '%s?' % shortKey
    tHash = hashlib.sha256(t).digest()
    # Check to see that first byte is \x00
    if tHash[0] == '\x00':
        return True
    return False
    GenerateKeys (1)

now
SKhHHQLDkHsAniFW2MRyVw9jwDDkKx
SHA256( ): ae172028e80ef37d3e01906ccd05441946c3efa9e4532ab20f5a6e25ce293840
sha256(?): 0057497a02482464d757500773d3d2c26badbcd94d5081d1cff9ea7c16fd2175
Validated.

need
SKhHHQLDkHsAniFW2MRyVw9jwDDkKx
SHA256( ): ae172028e80ef37d3e01906ccd05441946c3efa9e4532ab20f5a6e25ce293840
sha256(?): 0057497a02482464d757500773d3d2c26badbcd94d5081d1cff9ea7c16fd2175
Address: 17bYqJpPz3huoXuz6Dx6iLejuAHA2k2q3H
Validated.
49  Bitcoin / Bitcoin Discussion / Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it on: December 03, 2018, 09:14:52 AM
arulbero Help!
what key can there be 1Dn8NF8qDyyfHMktmuoQLGyjWmZXgvosXf
2..............
3..............
50  Bitcoin / Bitcoin Discussion / Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it on: November 08, 2018, 11:19:43 AM
this is man 1AqEgLuT4V2XL2yQ3cCzjMtu1mXtJLVvww hacked:

1LzhS3k3e9Ub8i2W1V8xQFdB8n2MYCHPCa 2018-05-29
17aPYR1m6pVAacXg1PTDDU7XafvK1dxvhi  2018-09-08
15c9mPGLku1HuW9LRtBf4jcHVpBUt8txKz 2018-11-08 today

=$ 10,448

what hash 15c9mPGLku1HuW9LRtBf4jcHVpBUt8txKz.........
51  Bitcoin / Development & Technical Discussion / Re: BitCrack - A tool for brute-forcing private keys on: November 08, 2018, 10:13:23 AM
who hacked 15c9mPGLku1HuW9LRtBf4jcHVpBUt8txKz

52  Bitcoin / Development & Technical Discussion / Re: BitCrack - A tool for brute-forcing private keys on: October 22, 2018, 03:06:16 PM
is it possible to brute

example

BitCrack64.exe -u -s 0000000000000000000000000000000000000000000000000000000000000000 1KDv
or
BitCrack64.exe -u -s 0000000000000000000000000000000000000000000000000000000000000000 1KDvs
or
BitCrack64.exe -u -s 0000000000000000000000000000000000000000000000000000000000000000 1KDvsa
.....
find
1KDv and save


similar to Vanitygen but there is random

and here with meaning
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000001
0000000000000000000000000000000000000000000000000000000000000002
53  Local / Майнеры / Vanitygen брут (чекер) on: October 21, 2018, 10:21:06 AM
Мужики что то вообще мало обсуждений этой приблуды на русском хотел бы чутка оживить тему

собственно может кто что знает поделитесь пожалуйста.

как использовать это вариант чека

-s <файл> Генератор случайных чисел семян из <файла>  в vanitygen

------------------------
могу ли я использовать свой словарик допустим на 1гб внутри 64 символьные хешы (SHA256)
что бы найти те же шаблоны типа 1Bitc... или 1Bitco  ну и так далее  - не по генерированному из софта рандому шуршать а по своими.

------------------------
можно ли взять 1 хэш и менять ему 1 символ +и так последовательно?
что бы софт не задавал свои архихрен знает какие символы а взял мой
допустим 19cf730931e051c98b2509001f31c43f126989317a308a26e50d20fb0c4098ad

и менял

19cf730931e051c98b2509001f31c43f126989317a308a26e50d20fb0c4098ae
19cf730931e051c98b2509001f31c43f126989317a308a26e50d20fb0c4098af
19cf730931e051c98b2509001f31c43f126989317a308a26e50d20fb0c4098b0
19cf730931e051c98b2509001f31c43f126989317a308a26e50d20fb0c4098b1
и так пока не найдет тот же шаблон  типа 1Bitc... или 1Bitco


может есть варианты мужики? как вписать в софт что бы проверяло если такое вообще возможно
54  Bitcoin / Development & Technical Discussion / Re: Vanitygen: Vanity bitcoin address generator/miner [v0.22] on: October 21, 2018, 10:05:49 AM
Please help me how to use this

-s <file>  Seed random number generator from <file>

oclvanitygen.exe or vanitygen.exe

-------------------

can i use my dictionary 2gb hash , SHA256 on check vanitygen (not random symbol)

if you can, how?


-------------------

is it possible to take 1 hash and add +1 symbols  to it ?
(vanitygen)
Pages: « 1 2 [3]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!