Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: daveyrobinsonuk on January 20, 2014, 11:49:44 AM



Title: Advice needed with java public key/address creation
Post by: daveyrobinsonuk on January 20, 2014, 11:49:44 AM
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


Title: Re: Advice needed with java public key/address creation
Post by: Mezzmarr on January 20, 2014, 08:58:16 PM
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?


Title: Re: Advice needed with java public key/address creation
Post by: empoweoqwj on January 21, 2014, 02:37:35 AM
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.


Title: Re: Advice needed with java public key/address creation
Post by: Patel12 on March 11, 2015, 07:44:39 AM
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/ (http://www.spanishprograms.com/) test papers and  dumps materials. You can spanishprograms - do you speak english in spanish (http://www.spanishprograms.com/learning_module/tutorial_index.htm) get our 100% guaranteed questions BBC’s languages (http://www.bbc.co.uk/languages/other/quickfix/) to help you in passing the real exam of Foreign Service Institute (http://fsi-language-courses.org/Content.php)


Title: Re: Advice needed with java public key/address creation
Post by: emrebey on March 11, 2015, 08:01:44 AM
why not just use the bitcoind RPC?


Title: Re: Advice needed with java public key/address creation
Post by: EcuaMobi on March 11, 2015, 11:29:17 AM
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