Ethereum: Get uncompressed public key from compressed form

Anti -thickets from the crushed forms, unbearable public key

Social keys ethereum, as it was powered, chronicled in the shattered byte. This is a lung decompression and a transaction for different attachments, such as the transaction or intersection with the intrateical counteract. The topic does not, Ponimania, can help with the more efficient work with a given ethereum.

Reply on the Bitcointalk Forum

Similar question was the task on the Bitcointalk Forum: [https: //bitcointalk.org/index.php? …] (https: //bitcointalk.org/index.php? …). Answer prefare that OpenSSL can unpack the covered key. Here’s the primer that, how to make it in python:

`Python

Import X509 from crypto

Import base64

Download the boiled wrench with memory

compressed_public_key = b '\ x8c \ x7d \ x05 \ x15 \ x00 \ x01 \ x00 \ x03 \ x04 \ x1e \ x09 \ x0b \ x12 \ x13 \ x08 \ X0B \ X11 \ X12 \ X13 \ X15 \ X16 \ X17 '

Create the object of the X.509 Certificate Cutting Key

PUBLIC_KEY = X509. LOAD_PEM_X509_CERTIFICATE (Compressed_public_key)

Converted sertfits in the weighted Pem code

Pem_string = Public_key.public_bytes (

Coding = Base64,

Format = x509er_cert_raw

) .Decode ("UTF-8")

Pack (Pem_string)

Enlightenment

  • Turns over the loading of the cooled key from the memory in X509. LOAD_PEM_X509_CERTIFICATE () with the use of. This function is entered in the shades of general byte bytes in the quality of the entrance.

  • The Zatom we make the facility of the X.509 Certification Certification, and the X509.L_X509_certicate ().

  • Exposing the desception of the stack, the coding PEM, is used for the use of public_key.public_bytes (encoding = base64, format = x509er_raw). This function of the beret on the sertifits and the byte, which is assigned to the non -tested binar data.

  • Adeneous, the inappropriate public key is baked in a six -tine format.

Uspolzing OpenSSL for decompressy public key

To unveiled the coat open key, use the OpenSSL, to use the Komandy StrokiOpenssl. That's the Primer:

Bash

$ OpenSSL X509 -D -D -out Compressed_publy_key.Pem

`

Cserélje ki a -t tömörítetttttttttttttttttttttttttttttttt kulcs bájt karakterláncárara.

Entertainment

This technique is predicted that the well -covered key is in the format that is the standard for the X.509 certification. If the open key is christed in the second form, you can use the second method to unite it.

Ponima, as to unpack the well -proof keys, use openssl and python, you can make your work more efficient and plenty with this ethereum.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *