Bitcoin Forum
November 10, 2024, 01:04:18 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: uppercase private key?  (Read 3391 times)
CoinDiver (OP)
Hero Member
*****
Offline Offline

Activity: 778
Merit: 1002


View Profile
August 28, 2012, 02:37:38 AM
 #1

How would one go about generating creating custom private keys? My specific need is for one in all caps. The idea is to create a private key that can be punched in to a solid block of aluminum with a simple set of metal punches. That way the key is never out of my possession.

Thanks!

http://mises.org/daily/3229
BTC:1PEyEKyVZgUvV4moXvCD5rQN21QETGPpLc
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
August 28, 2012, 02:48:28 AM
 #2

private keys are simply random numbers encoded in various formats (there are more than one).  Understand you are significantly reducing the entropy of your private key by eliminating all the incompatible digits.

One method would be to randomly generate each digit (A-Z) and concatenate the values.
casascius
Mike Caldwell
VIP
Legendary
*
Offline Offline

Activity: 1386
Merit: 1140


The Casascius 1oz 10BTC Silver Round (w/ Gold B)


View Profile WWW
August 28, 2012, 02:55:06 AM
 #3

The checksum value at the end is outside of your control, but given that it's only 32 bits (~5 characters) you can simply try different keys until you get a value that meets your needs, which should be relatively easy.

Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable.  I never believe them.  If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins.  I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion.  Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice.  Don't keep coins online. Use paper or hardware wallets instead.
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1026



View Profile
August 28, 2012, 03:13:38 AM
 #4

Don't let anyone trick you into posting pictures here on the forums when you are done.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
payb.tc
Hero Member
*****
Offline Offline

Activity: 812
Merit: 1000



View Profile
August 28, 2012, 03:29:50 AM
 #5

private keys are simply random numbers encoded in various formats (there are more than one).  Understand you are significantly reducing the entropy of your private key by eliminating all the incompatible digits.

One method would be to randomly generate each digit (A-Z) and concatenate the values.

*very* rough code with lots of bugs:

Code:
function upper_key($num) {
  $key = '';

   while ($num > 26) {
       $char_num = $num % 26;
       $num = ($num - $char_num) / 26;

      $key = chr($char_num+65) . $key;
    }

   $key = chr($num+65) . $key;

   return $key;
}
casascius
Mike Caldwell
VIP
Legendary
*
Offline Offline

Activity: 1386
Merit: 1140


The Casascius 1oz 10BTC Silver Round (w/ Gold B)


View Profile WWW
August 28, 2012, 03:46:01 AM
 #6

Here is an example private key:

5JABCDEFGHJKLMNPQRSTUVWXYZABCDEFGHJKLMNPQRSTPRQDTCD

Its corresponding Bitcoin address:

16XGpiDjnSq6H7bXuxAJiYQYGjpvz4BCh6

To get it, I just used the sequential letters you see as a private key (ignoring the invalid checksum at first), and then incremented it until it satisfied the capital letter condition with its correctly computed checksum.

I assume you don't mind the leading 5, you can't really get rid of it if you want to use this format.

Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable.  I never believe them.  If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins.  I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion.  Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice.  Don't keep coins online. Use paper or hardware wallets instead.
CoinDiver (OP)
Hero Member
*****
Offline Offline

Activity: 778
Merit: 1002


View Profile
August 28, 2012, 04:53:57 AM
 #7

Thanks everyone. Letters and numbers are fine, but the stamps/punches come in uppercase.

I will take a look at the code tomorrow at my desk. I'm sure I can whip something up real quick to generate a key.

I will be happy to post the final result... Without the private or public key of course.

http://mises.org/daily/3229
BTC:1PEyEKyVZgUvV4moXvCD5rQN21QETGPpLc
casascius
Mike Caldwell
VIP
Legendary
*
Offline Offline

Activity: 1386
Merit: 1140


The Casascius 1oz 10BTC Silver Round (w/ Gold B)


View Profile WWW
August 28, 2012, 06:20:20 AM
 #8

A hidden feature of Casascius Bitcoin Utility: add a question mark to the end of any Base58-encoded string to disregard the checksum.

https://casascius.com/btcaddress.zip

Quick way to generate an uppercase private key:

1. generate a normal private key
2. manually change all the lowercase letters to uppercase (except O and I, which are not allowed as uppercase but are allowed as lowercase - change them to something else of your choice)... make sure the length is not changed.
3. Add a question mark to the end (that increases the length by 1)
4. Convert it to hex by clicking the button
5. Convert it back to a WIF private key (which calculates the correct checksum)
6. If correcting the checksum caused lowercase letters to be added, then start changing (incrementing) the last hex digit or two, and convert to WIF again, until you find something without lowercase letters.

Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable.  I never believe them.  If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins.  I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion.  Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice.  Don't keep coins online. Use paper or hardware wallets instead.
etotheipi
Legendary
*
expert
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
August 28, 2012, 03:07:11 PM
 #9

Just a comment:

Addresses and keys are usually expressed as Base58.  This doesn't have to be the case.

Take your regular key, and instead of encoding it as base 58, encode it as Base26, with [A-Z] ~ [0-25].  Or Base36:  [A-Z,0-9]~[0,35].  Add an extra line or in parentheses "BASE26" to the plate, to identify how it was created.  Regardless of whether it is Base58 or Base26, it still needs to end up in Base256 before it is interpreted by the computer.  If someone knows it's a private key, it will be recoverable...

Also, if you are etching this in metal, the checksum isn't quite as important:  I imagine this is going to be extremely resilient, so the extra checksum characters won't make much of a difference -- you're much more likely to lose the whole thing, or have it completely destroyed by accident, than somehow losing only one or two characters.  But you can add it anyway: just start with your binary (Base256) private key, add the four-byte checksum, then convert all 36 bytes to Base26.  Done.

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
MatthewLM
Legendary
*
Offline Offline

Activity: 1190
Merit: 1004


View Profile
August 28, 2012, 03:13:07 PM
 #10

An easy way may be to convert to hex and then modify the hex so that 0-9 becomes A-J and A-F becomes K-P.
casascius
Mike Caldwell
VIP
Legendary
*
Offline Offline

Activity: 1386
Merit: 1140


The Casascius 1oz 10BTC Silver Round (w/ Gold B)


View Profile WWW
August 28, 2012, 03:27:47 PM
 #11

An easy way may be to convert to hex and then modify the hex so that 0-9 becomes A-J and A-F becomes K-P.

I am guessing he has access to print numbers, so he could just as well express the entire key in hex.

Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable.  I never believe them.  If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins.  I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion.  Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice.  Don't keep coins online. Use paper or hardware wallets instead.
thebaron
Sr. Member
****
Offline Offline

Activity: 434
Merit: 250



View Profile
August 28, 2012, 03:31:40 PM
 #12

Thanks everyone. Letters and numbers are fine, but the stamps/punches come in uppercase.

Then just turn them sideways for lowercase.
CoinDiver (OP)
Hero Member
*****
Offline Offline

Activity: 778
Merit: 1002


View Profile
August 28, 2012, 04:06:29 PM
 #13

An easy way may be to convert to hex and then modify the hex so that 0-9 becomes A-J and A-F becomes K-P.

I am guessing he has access to print numbers, so he could just as well express the entire key in hex.

Yep, A-Z, 0-9.

http://mises.org/daily/3229
BTC:1PEyEKyVZgUvV4moXvCD5rQN21QETGPpLc
maaku
Legendary
*
expert
Offline Offline

Activity: 905
Merit: 1012


View Profile
August 29, 2012, 12:42:26 AM
 #14

base32?

I'm an independent developer working on bitcoin-core, making my living off community donations.
If you like my work, please consider donating yourself: 13snZ4ZyCzaL7358SmgvHGC9AxskqumNxP
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!