Bitcoin Forum
November 09, 2024, 02:38:18 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Random Address generator and balance checker  (Read 1514 times)
ncdlek (OP)
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
August 05, 2016, 08:15:45 PM
 #1

Hi,

Nowadays I am planing to give a talk about bitcoin and blockchain and want to show about address security. So I want to code a script which randomly (and if possible a vocabulary attack) generates bitcoin address and check their balances. When I tell people it is really secure, they didn't get it. And my plan is showing them actually how is strong while I talk.
 
I don't have enough technical background but I had learned some python in ccodecademy.com.

Thanks for help.
OmegaStarScream
Staff
Legendary
*
Offline Offline

Activity: 3654
Merit: 6430



View Profile
August 05, 2016, 08:19:24 PM
 #2

Electrum (which is a desktop wallet in case you don't know) is written in Python. I'm pretty sure you could start from there for what comes to generating addresses , as for checking the balances If you can't run bitcoind on your own server , you can simply use the Blockchain.info API , there is a lot of tutorials out there.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3542
Merit: 6886


Just writing some code


View Profile WWW
August 05, 2016, 08:22:49 PM
 #3

You don't necessarily need to generate Bitcoin addresses to get your point across. Just show them the math and the probabilities. The number of possible addresses is 2^160.

If you actually do want to write a program to do this, then you could use python, but it probably won't be very well optimized. Just use python with openssl and have openssl generate the keys. Then do the base58check encoding on the public key in order to get the Bitcoin address. Lastly, you can use it with cURL to send api requests to whatever REST API you want to use.

ncdlek (OP)
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
August 05, 2016, 08:23:59 PM
 #4

Electrum (which is a desktop wallet in case you don't know) is written in Python. I'm pretty sure you could start from there for what comes to generating addresses , as for checking the balances If you can't run bitcoind on your own server , you can simply use the Blockchain.info API , there is a lot of tutorials out there.

Thanks. I will check.
ncdlek (OP)
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
August 05, 2016, 08:41:38 PM
 #5

You don't necessarily need to generate Bitcoin addresses to get your point across. Just show them the math and the probabilities. The number of possible addresses is 2^160.

If you actually do want to write a program to do this, then you could use python, but it probably won't be very well optimized. Just use python with openssl and have openssl generate the keys. Then do the base58check encoding on the public key in order to get the Bitcoin address. Lastly, you can use it with cURL to send api requests to whatever REST API you want to use.

Yes I know it is impossible and I found really useful infographics and graphs. but if it is not hard for me, i want to show this matrix lines Smiley. Thanks for advice, i will check.
coinableS
Legendary
*
Offline Offline

Activity: 1442
Merit: 1186



View Profile WWW
August 09, 2016, 02:27:38 AM
 #6

Here you go. Don't run this more than 100 times in 5 minutes or you'll get the ban hammer from Blockchain.

http://phpfiddle.org/lite/code/4q2m-6sga

Code:
<?php
$counter 
0;
while(
$counter 5){
//gen new key pair
$url "https://blockchain.info/q/newkey";
$content file_get_contents($url);
$arrEx explode(" "$content);

$bitcoin_address $arrEx[0];
$privKey $arrEx[1];
//check the balance
$jsondata json_decode(file_get_contents("https://blockchain.info/address/$bitcoin_address?format=json"), true);
$totRec $jsondata["total_received"];
echo "Address: ".$bitcoin_address;
echo "<br>Key: ".$privKey;
echo "<br>Bal: ".$totRec ."<br><br>";
$counter++;
}
?>


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!