I have a private key which I would like to encrypt so that storing it locally is safer. I would like to use the commonly used encryption method so that I can decrypt the result with the available tezos client packages. Is there a tool that can do this for me? I can see a lot of info about decrypting, which pytezos can do for example, I want to do the opposite.
This may answer your question: https://tezos.stackexchange.com/a/334/318
from pytezos.crypto import Key print(Key('edsk2juUM8ZMUkaCKHWVnzWhp9DxrK93YK1rQjYk3pTEq2ThXpBxkX').secret_key(passphrase="1234")) # edesk1GztKe2KkTsWBB1DbnAjxS7hMFrffHLgUnxRcqtjw3o8oHVqnS1RuesZremQ9GYnNKrETSiRh4WWSu5hibT