#MetaHash private key

#MetaHash
#MetaHash
Published in
3 min readApr 26, 2019

--

Friends, let’s talk about encryption on the #MetaHash network. This process plays a crucial role in confirming transactions, identifying senders and recipients and protecting the network. But it all starts with clicking “create a new #MHC Wallet”. At this very moment, private key and public one are automatically generated for you. The open key is a set of letters and numbers, formed on the basis of a private key and is used to identify the sender or recipient of funds. But the secret key is a strictly confidential code that gives access to the funds stored on the wallet.

Since it is impossible to guess or select the code because of its complexity, fraudsters often try to steal the key from your storage or communication channels. That is why it is so important to secure the storage location of your private key. The user can take additional key protection by creating a special password, or, in other words, by encrypting his individual cipher again. However, some are afraid to forget the password and prefer to keep the key unencrypted.

Let’s look at one of the most popular encryption methods for our private key. #MetaHash private key is stored only in an encrypted file. To encrypt the private key file the symmetric block cipher algorithm is issued — Advanced Encryption Standard with a block size of 128 bits and Cipher block chainingmode.

Here is the list of OpenSSL commands to work with key encryption using the AES-128-CBC method:

Generate a private key:

openssl ecparam -genkey -name secp256k1 -out test.pem

View a private key:

openssl ec -in test.pem -outform DER | xxd -p

read EC key

writing EC key

307402010104204fd8da7797691335ab201250b3559c631a8b35fadb4b02

21f2ce953ae7446b28a00706052b8104000aa144034200040a7b6609296b

662dfe7d8b025231f04422488b954c9fa36ffa3778aca9f94525811ef1b8

7250446b7cf837bfbc1b4f6927648fe2f7e11dd5a674afebe863ee3f

Encrypt key file:

openssl ec -in ./test.pem -out enc.pem -aes-128-cbc

read EC key

writing EC key

Enter PEM pass phrase: // please enter password, it must be 4–1024 characters long

Verifying — Enter PEM pass phrase: // re-enter password

Decrypt key file to view a private key:

openssl ec -in enc.pem -outform DER | xxd -p

read EC key

Enter PEM pass phrase: // please re-enter the password you entered earlier

writing EC key

307402010104204fd8da7797691335ab201250b3559c631a8b35fadb4b02

21f2ce953ae7446b28a00706052b8104000aa144034200040a7b6609296b

662dfe7d8b025231f04422488b954c9fa36ffa3778aca9f94525811ef1b8

7250446b7cf837bfbc1b4f6927648fe2f7e11dd5a674afebe863ee3f

As shown above, in order to create a wallet address, the network first generates a private key. Then, based on a private key, it generates a public key by hashing that fits exclusively with the first one. That is why the name of the file with the private key matches the wallet address. With the secret key, you can easily determine the public one, but the calculation of the private key only on the basis of the public one is completely impossible. Therefore, in order to guarantee the security of funds in your wallet, please do not attempt to modify or open the private key with unverified applications and keep the storage of your key in safety.

Our website
#MetaGate
Telegram
Twitter

--

--