Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: BitcoinGirl325 on January 07, 2015, 06:17:17 PM



Title: Tech question: creating a Bitcoin private key with FileMaker or Access?
Post by: BitcoinGirl325 on January 07, 2015, 06:17:17 PM
Please excuse the very beginner level technical question here, but is there a way to create a Bitcoin private key with a simple consumer database app such as FileMaker Pro or Microsoft Access?

My guess is that there IS such a way, since both database apps include a "random number generator" function.

I suppose I just don't know where to find the information on:
1. What SPECIFIC criteria makes up a valid private key, including the checksum at the end of the key?
2. Once I have generated the private key, how do I translate that into the public key to distribute publicly to others?

My goal is to have my company's internal invoicing system (which prints out invoices on old-fashioned paper) automatically generate a brand new Bitcoin address (public key) on each printed invoice, so that clients can have the option of paying their invoices with Bitcoin.

Thanks in advance for any help or guidance that you can provide!


Title: Re: Tech question: creating a Bitcoin private key with FileMaker or Access?
Post by: ncsupanda on January 07, 2015, 06:25:18 PM
https://en.bitcoin.it/wiki/Private_key

https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses

These two references used together more than explain your first question.
The second may also explain the second question.

Read through these - they are very good for learning about the technical aspects of Bitcoin.



Title: Re: Tech question: creating a Bitcoin private key with FileMaker or Access?
Post by: hhanh00 on January 07, 2015, 06:31:39 PM
Please excuse the very beginner level technical question here, but is there a way to create a Bitcoin private key with a simple consumer database app such as FileMaker Pro or Microsoft Access?

My guess is that there IS such a way, since both database apps include a "random number generator" function.

The random number generator of these apps is not good enough for bitcoin applications. It will produce a number that is too easy to guess and you will lose your money.


Title: Re: Tech question: creating a Bitcoin private key with FileMaker or Access?
Post by: cr1776 on January 07, 2015, 06:32:49 PM
Hi,
One thing to greatly consider is the actual randomness of the random number generator in them before relying on them (edit: as hhanh00 said at almost the same time).   It might also be useful to explore this to potentially avoid the issue:
http://tools.ietf.org/html/rfc6979




The second question is the difficulty of doing the ECC and hashing within those applications.  They may have that functionality built in or you might need some external libraries, that is something you'd have to research.  

However, the links provided above should give a good start on researching it more, but remember, rolling your own can be dangerous.

:-)




Title: Re: Tech question: creating a Bitcoin private key with FileMaker or Access?
Post by: DeathAndTaxes on January 07, 2015, 10:32:34 PM
Crypto is one of those things you don't want to "roll yourself".  It is very easy to make a system which you believe is secure and isn't.   As pointed out a RNG is insufficient what you need is a cryptographically secure random number generator (CSRNG).   The RNG in database applications (and many other places) are not designed or verified to produce numbers which can't be broken.

What I would recommend is you some existing wallet export just the public keys and import those into your database.   Then assign them to customers invoices as needed.   There is no reason for the database to hold private keys.


Title: Re: Tech question: creating a Bitcoin private key with FileMaker or Access?
Post by: BitcoinGirl325 on January 08, 2015, 03:25:18 AM
Thanks so much, everyone, for the excellent advice! :) I didn't realize that a random number generator isn't the exact same thing as a cryptographically secure random number generator?? So the random number generator within database applications isn't truly random?


Title: Re: Tech question: creating a Bitcoin private key with FileMaker or Access?
Post by: hhanh00 on January 08, 2015, 03:35:00 AM
They are pseudo random number generators. Some of better than others. For a database function, most people don't care about a high quality PRNG. So they implemented a simple and fast one. In cryptographic usage, we need a better one even if they are slower.
For an even better RNG, you could purchase special hardware that specializes in delivering random numbers (for ex: http://www.entropykey.co.uk/)

Edit: In your case, you could consider using a deterministic wallet like BIP32. They start with a seed that you must generate with a crypto secure RNG. But then all the subsequent keys are produced by a non random method from the starting point and there is no need for any RNG after the seed.



Title: Re: Tech question: creating a Bitcoin private key with FileMaker or Access?
Post by: jl2012 on January 08, 2015, 10:59:15 AM
"Random number" generated by MS Windows:

https://www.random.org/analysis/randbitmap-wamp.png


Title: Re: Tech question: creating a Bitcoin private key with FileMaker or Access?
Post by: hhanh00 on January 08, 2015, 11:04:38 AM
Source?


Title: Re: Tech question: creating a Bitcoin private key with FileMaker or Access?
Post by: jl2012 on January 08, 2015, 02:59:21 PM
Source?

https://www.random.org/analysis/


Title: Re: Tech question: creating a Bitcoin private key with FileMaker or Access?
Post by: ncsupanda on January 08, 2015, 03:53:07 PM
Thanks so much, everyone, for the excellent advice! :) I didn't realize that a random number generator isn't the exact same thing as a cryptographically secure random number generator?? So the random number generator within database applications isn't truly random?

It's my understanding that technically no RNG is TRULY random.


Title: Re: Tech question: creating a Bitcoin private key with FileMaker or Access?
Post by: hhanh00 on January 08, 2015, 03:56:39 PM
Source?

https://www.random.org/analysis/

Thanks. To be 100% clear, it's not specific to Windows. You can obviously have good PRNG on Windows and bad ones everywhere.
That picture is a particularly bad combination: PHP, rand() and Windows.


Title: Re: Tech question: creating a Bitcoin private key with FileMaker or Access?
Post by: samson on January 10, 2015, 11:19:41 AM
"Random number" generated by MS Windows:

https://www.random.org/analysis/randbitmap-wamp.png

As opposed to this which was generated using a small hardware device I have :

http://s13.postimg.org/x7fqu8tdj/randombits.jpg


Title: Re: Tech question: creating a Bitcoin private key with FileMaker or Access?
Post by: BitcoinGirl325 on January 14, 2015, 07:16:53 AM
Whoa. This is very useful information. Thanks so much, everybody!