Bitcoin Forum
May 24, 2024, 06:23:54 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Creating Private Keys  (Read 934 times)
EdwardSlo (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
July 26, 2016, 07:32:42 PM
 #1

i was trying to create an program in the c++ that randomly generates private keys like offlinebitcoins.com does
I want to base it off the users input so they input their secret exponent like 1 and generate the public and private key (public) 5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf (private) 1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm

#include <openssl/sha256.h>
#include <string>
#include <cstdlib>
#include <ctime>
using namespace std;
static const char base58char[] = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";

int stringLength = sizeof(base58char) - 1;

char KeyGen() 
{

   return base58char[rand() % stringLength];
}

void KeyGeneration()
{
   for (int s = 0; s < 64; s++)
   {
      cout << KeyGen();
   }
   std::cin.get();
}


can anybody help

this has to be all offline
OgNasty
Donator
Legendary
*
Offline Offline

Activity: 4746
Merit: 4286


Leading Crypto Sports Betting & Casino Platform


View Profile WWW
July 26, 2016, 07:46:00 PM
Last edit: July 26, 2016, 08:35:41 PM by OgNasty
 #2

There's a program called vanitygen that will let you create as many private keys as you want with parameters.  That might help you?

Here's the thread for it.  I highly recommend.

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

..Stake.com..   ▄████████████████████████████████████▄
   ██ ▄▄▄▄▄▄▄▄▄▄            ▄▄▄▄▄▄▄▄▄▄ ██  ▄████▄
   ██ ▀▀▀▀▀▀▀▀▀▀ ██████████ ▀▀▀▀▀▀▀▀▀▀ ██  ██████
   ██ ██████████ ██      ██ ██████████ ██   ▀██▀
   ██ ██      ██ ██████  ██ ██      ██ ██    ██
   ██ ██████  ██ █████  ███ ██████  ██ ████▄ ██
   ██ █████  ███ ████  ████ █████  ███ ████████
   ██ ████  ████ ██████████ ████  ████ ████▀
   ██ ██████████ ▄▄▄▄▄▄▄▄▄▄ ██████████ ██
   ██            ▀▀▀▀▀▀▀▀▀▀            ██ 
   ▀█████████▀ ▄████████████▄ ▀█████████▀
  ▄▄▄▄▄▄▄▄▄▄▄▄███  ██  ██  ███▄▄▄▄▄▄▄▄▄▄▄▄
 ██████████████████████████████████████████
▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄
█  ▄▀▄             █▀▀█▀▄▄
█  █▀█             █  ▐  ▐▌
█       ▄██▄       █  ▌  █
█     ▄██████▄     █  ▌ ▐▌
█    ██████████    █ ▐  █
█   ▐██████████▌   █ ▐ ▐▌
█    ▀▀██████▀▀    █ ▌ █
█     ▄▄▄██▄▄▄     █ ▌▐▌
█                  █▐ █
█                  █▐▐▌
█                  █▐█
▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀█
▄▄█████████▄▄
▄██▀▀▀▀█████▀▀▀▀██▄
▄█▀       ▐█▌       ▀█▄
██         ▐█▌         ██
████▄     ▄█████▄     ▄████
████████▄███████████▄████████
███▀    █████████████    ▀███
██       ███████████       ██
▀█▄       █████████       ▄█▀
▀█▄    ▄██▀▀▀▀▀▀▀██▄  ▄▄▄█▀
▀███████         ███████▀
▀█████▄       ▄█████▀
▀▀▀███▄▄▄███▀▀▀
..PLAY NOW..
DarkStar_
Legendary
*
Offline Offline

Activity: 2772
Merit: 3282


View Profile WWW
July 26, 2016, 11:23:39 PM
 #3

There's a program called vanitygen that will let you create as many private keys as you want with parameters.  That might help you?

Here's the thread for it.  I highly recommend.

https://bitcointalk.org/index.php?topic=25804.0
He is looking to create brainwallets, not custom vanity addresses. Edward, does it have to be in C++? You could always download a brainwallet script and run it offline. It has the same result as offlinebitcoins.com every time. If your interested, I recommened using this brainwallet source code, which is a branch of the script offlinebitcoins is using. I haven't checked to see if it will steal your keys, so make sure to only use it offline. I don't recommend using brainwallets though, since they can be easily bruteforced if you pick a fairly easy phrase.

taking a break - expect delayed responses
ImHash
Hero Member
*****
Offline Offline

Activity: 924
Merit: 506


View Profile
July 28, 2016, 12:55:52 AM
 #4

and what are you going to do with them? or what good can come out from doing this?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!