Author

Topic: Private key (DER) convert to ...? (Read 2210 times)

legendary
Activity: 1400
Merit: 1005
March 27, 2013, 02:10:10 AM
#8
Quote
EDIT:  Also, question.  The OCTET STRING is "C4BBCB1FBEC99D65BF59D85C8CB62EE2DB963F0Fundefined".  This does not import to blockchain.info.  What's with the "undefined" bit at the end as well?
lapo.it seems to have a bug when it displays the octet string.  Hover over it and look on the right where it has highlighted the hex dump.  Copy that part of the hex dump, except for the beginning "04 20".

If you want to do it manually, without lapo.it, just search your DER encoded private key from the beginning for "04 20" and grab the following 32 bytes (64 hex characters).  Example:

Code:
30820113020101
0420
c4bbcb1fbec99d65bf59d85c8cb62ee2db963f0fe106f483d9afa73bd4e39a8a     <<<< Give this to blockchain.info
a081a53081a2020101302c06072a8648ce3d0101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f300604010004010704410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020101a1440342000478d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71a1518063243acd4dfe96b66e3f2ec8013c8e072cd09b3834a19f81f659cc3455

EDIT: I'm assuming you're getting the DER encoded key from somewhere other than brainwallet, as obviously if you already have it on brainwallet you can simply copy the Secret Exponent directly into blockchain.info.
Oh, dang, that's easy.  I didn't know the bit I needed was right in the string from the start.  0.2 BTC coming your way!
hero member
Activity: 560
Merit: 517
March 27, 2013, 12:45:18 AM
#7
Quote
EDIT:  Also, question.  The OCTET STRING is "C4BBCB1FBEC99D65BF59D85C8CB62EE2DB963F0Fundefined".  This does not import to blockchain.info.  What's with the "undefined" bit at the end as well?
lapo.it seems to have a bug when it displays the octet string.  Hover over it and look on the right where it has highlighted the hex dump.  Copy that part of the hex dump, except for the beginning "04 20".

If you want to do it manually, without lapo.it, just search your DER encoded private key from the beginning for "04 20" and grab the following 32 bytes (64 hex characters).  Example:

Code:
30820113020101
0420
c4bbcb1fbec99d65bf59d85c8cb62ee2db963f0fe106f483d9afa73bd4e39a8a     <<<< Give this to blockchain.info
a081a53081a2020101302c06072a8648ce3d0101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f300604010004010704410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020101a1440342000478d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71a1518063243acd4dfe96b66e3f2ec8013c8e072cd09b3834a19f81f659cc3455

EDIT: I'm assuming you're getting the DER encoded key from somewhere other than brainwallet, as obviously if you already have it on brainwallet you can simply copy the Secret Exponent directly into blockchain.info.
legendary
Activity: 1400
Merit: 1005
March 26, 2013, 11:35:48 PM
#6
Those (DER) keys are ASN-encoded, try http://lapo.it/asn1js/
It contains both private and public keys along with a generator OID description (in this case, 1.2.840.10045.1.1).
First OCTET STRING (32-bytes) is usually a secret exponent, which you may convert to Base58Check ver. 128 or import as is.
Forgot to say thank you Joric!  Will send a small tip your way.  Wink

EDIT:  Also, question.  The OCTET STRING is "C4BBCB1FBEC99D65BF59D85C8CB62EE2DB963F0Fundefined".  This does not import to blockchain.info.  What's with the "undefined" bit at the end as well?

EDIT2:  0.2 BTC bounty to anyone who can provide a start-to-finish of converting the above DER key to something I can import into blockchain.info!
member
Activity: 67
Merit: 130
February 19, 2013, 12:33:57 PM
#5
just remove spaces from the copypaste above (forum engine breaks line every 160 chararacters)
Code:
308201130201010420c4bbcb1fbec99d65bf59d85c8cb62ee2db963f0fe106f483d9afa73bd4e39a8aa081a53081a2020101302c06072a8648ce3d0101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f300604010004010704410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020101a1440342000478d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71a1518063243acd4dfe96b66e3f2ec8013c8e072cd09b3834a19f81f659cc3455
hero member
Activity: 812
Merit: 587
Space Lord
February 19, 2013, 09:45:59 AM
#4
lapo.it won't work.
member
Activity: 67
Merit: 130
February 19, 2013, 09:35:38 AM
#3
Those (DER) keys are ASN-encoded, try http://lapo.it/asn1js/
It contains both private and public keys along with a generator OID description (in this case, 1.2.840.10045.1.1).
First OCTET STRING (32-bytes) is usually a secret exponent, which you may convert to Base58Check ver. 128 or import as is.
hero member
Activity: 812
Merit: 587
Space Lord
February 19, 2013, 03:06:26 AM
#2
I don't know. Maybe you could try the converter: http://brainwallet.org/#converter

But you actually have a normal private key when you generate: http://brainwallet.org/#generator
legendary
Activity: 1400
Merit: 1005
February 19, 2013, 01:17:25 AM
#1
How do I convert a Private Key (DER) (as shown at http://brainwallet.org/) to a private key that is importable into, say, blockchain.info?

Example private key:  308201130201010420c4bbcb1fbec99d65bf59d85c8cb62ee2db963f0fe106f483d9afa73bd4e39 a8aa081a53081a2020101302c06072a8648ce3d0101022100ffffffffffffffffffffffffffffff fffffffffffffffffffffffffefffffc2f300604010004010704410479be667ef9dcbbac55a0629 5ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b4 48a68554199c47d08ffb10d4b8022100fffffffffffffffffffffffffffffffebaaedce6af48a03 bbfd25e8cd0364141020101a1440342000478d430274f8c5ec1321338151e9f27f4c676a008bdf8 638d07c0b6be9ab35c71a1518063243acd4dfe96b66e3f2ec8013c8e072cd09b3834a19f81f659c c3455
Jump to: