Skip to content

bugfix: incorrect raw byte conversion to string #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

IdrisHanafi
Copy link

@IdrisHanafi IdrisHanafi commented Mar 5, 2025

Summary & Motivation (Problem vs. Solution)

This PR fixes an issue where decrypted private keys were incorrectly converted to UTF-8 strings instead of the expected hexadecimal format...The current implementation works for regular text like a mnemonic.

This change introduces a new flag in the decrypt command called --hex-output which ensures that raw bytes are correctly converted as hexadecimal string representations.

Test

(Don't worry below is a throwaway ETH account purely for testing)
Before:

$ turnkey decrypt --export-bundle-input test.json --organization $ORG_ID --signer-quorum-key $SIGNER_QUORUM_KEY
"\ufffd[\ufffd.\ufffd\ufffd|\ufffd\u0005\ufffd\ufffd\ufffda\u003eό\ufffd5y9....<Redacted>"

After:

$ go run main.go decrypt --export-bundle-input ~/dev/turnkey-test/test.json --organization $ORG_ID --signer-quorum-key $SIGNER_QUORUM_KEY --hex-output
"fc5b812e96...<Redacted>"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant