Bitcoin Forum
November 09, 2024, 10:38:06 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Advice needed with java public key/address creation  (Read 1140 times)
daveyrobinsonuk (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
January 20, 2014, 11:49:44 AM
 #1

Hi guys.

I'm trying to create a java app which uses a secret (to the user) hash to salt a passphrase before creating a bitcoin address.

I've done most of the work and it is in theory much more secure than normal brain wallets.
The only problem I am having is in creating the public key and address.

For example my app so far does the following:

1. turns the passphrase into an indecipherable passphrase of 500 letters and numbers using the users secret.
2. turns that passphrase into the secret exponent. eg. affc875700667e07a53bea72fdd1d946561a523a0bee0170daedc79151ad0526
3. turns this into the WIF Private key eg. 5K9nvFWdpdJQukRWZEHVz2ThVH2uQwXAoL4VdcUxH8UGYYmxUoZ

I can then import this into a wallet and use it as it shows me the public key and address, I know that, BUT...

I want to write my own code in java to display the public key and address for me. I have tried using bouncycastle libraries and for some reason it keeps giving me a totally random pubkey and address each time which has nothing to do with private key. I think thats something to do with SecureRandom which seeds it with random numbers so that sucks.

If anybody has any ideas I'd be very grateful, thankyou

1AyEvwKXjKZdqpm7a2zLRzRGSs4gBLoTXM
Mezzmarr
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
January 20, 2014, 08:58:16 PM
 #2

Hi guys.

I'm trying to create a java app which uses a secret (to the user) hash to salt a passphrase before creating a bitcoin address.

I've done most of the work and it is in theory much more secure than normal brain wallets.
The only problem I am having is in creating the public key and address.

For example my app so far does the following:

1. turns the passphrase into an indecipherable passphrase of 500 letters and numbers using the users secret.
2. turns that passphrase into the secret exponent. eg. affc875700667e07a53bea72fdd1d946561a523a0bee0170daedc79151ad0526
3. turns this into the WIF Private key eg. 5K9nvFWdpdJQukRWZEHVz2ThVH2uQwXAoL4VdcUxH8UGYYmxUoZ

I can then import this into a wallet and use it as it shows me the public key and address, I know that, BUT...

I want to write my own code in java to display the public key and address for me. I have tried using bouncycastle libraries and for some reason it keeps giving me a totally random pubkey and address each time which has nothing to do with private key. I think thats something to do with SecureRandom which seeds it with random numbers so that sucks.

If anybody has any ideas I'd be very grateful, thankyou

1AyEvwKXjKZdqpm7a2zLRzRGSs4gBLoTXM

What is your objective?
empoweoqwj
Hero Member
*****
Offline Offline

Activity: 518
Merit: 500


View Profile
January 21, 2014, 02:37:35 AM
 #3

I think he's just trying to create a bunch of bitcoin addresses, for a wallet for example. The OP can tell us if that isn't the case.
Patel12
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
March 11, 2015, 07:44:39 AM
Last edit: March 30, 2015, 12:53:55 PM by Patel12
 #4

I can then import this into a wallet and use it as it shows me the public key and address, I know that, BUT...





____________________
We offer best quality http://www.spanishprograms.com/ test papers and  dumps materials. You can spanishprograms - do you speak english in spanish get our 100% guaranteed questions BBC’s languages to help you in passing the real exam of Foreign Service Institute
emrebey
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250


View Profile
March 11, 2015, 08:01:44 AM
 #5

why not just use the bitcoind RPC?
EcuaMobi
Legendary
*
Offline Offline

Activity: 1876
Merit: 1475



View Profile
March 11, 2015, 11:29:17 AM
 #6

Here's the source code of an Android app that can generate address from a random private key, among other things.
Since Android is 100% java you'll be able to usa that code on any java application.

https://github.com/ValleZ/Paper-Wallet
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!