7

I can't find any way to get the unencrypted private key from an encrypted private key from the tezos client.

I have found a way using tezbox. You import a private key into tezbox and then show the private key. The key that it shows you is unencrypted. I am unable to import an encrypted private key into tezbox that has a 'blank' password so this method is not available to me.

I have been told I can use eztz using:

eztz.crypto.extractEncryptedKeys('edesk','password')`

And I have been told I can use pytezos using:

Key(key='edesk...', passphrase='123456').secret_key()

I can't figure out how to get the above options to work, though. I have tried the eztz node.js method, but I would appreciate an example of how to do this.

  • 2
    You need to import eztz lib first and then use this: eztz.crypto.extractEncryptedKeys(encryptedPrivateKey, password) It will return a full set of extracted keys. – RoMarQ Feb 10 at 16:31
  • Btw, that function is used on client side, will not work if you are using it on backend as it needs the window obj. You need to change it to work on backend. – RoMarQ Feb 10 at 16:55
4

You may want to read this guide. There is some Python code inside.

2

With pytezos

import pytezos
print(pytezos.Key('edesk...', passphrase='yourpassword').secret_key())
  • im getting this error : ``` File "/Users/user/Desktop/privkeyconvert/pytezos.py", line 54 def __init__(self, key: str, passphrase: str = None, email: str = None): ^ SyntaxError: invalid syntax``` – Mr Z Feb 10 at 17:46
  • How are you running it? – Arthur B Feb 10 at 21:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.