-
Notifications
You must be signed in to change notification settings - Fork 4.6k
solana-keygen - Poor mans keypair encryption #6259
solana-keygen - Poor mans keypair encryption #6259
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6259 +/- ##
========================================
- Coverage 73.3% 71.1% -2.3%
========================================
Files 219 219
Lines 44022 45403 +1381
========================================
- Hits 32306 32289 -17
- Misses 11716 13114 +1398 |
@CriesofCarrots RE the |
Hmm, on my terminal (iTerm2), the mnemonic phrase and passphrase prompt actually seem to behave properly. I do still like the recommendation of |
Which |
The GUI one. Ah, that's the difference? |
Thanks. Ugh, gross. |
I think documenting that |
deff131
to
f46b9a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this much better!
Just need a little fixup to "recover"
keygen/src/keygen.rs
Outdated
let serialized_keypair = write_keypair(&keypair, outfile)?; | ||
let serialized_keypair = write_keypair_file(&keypair, outfile)?; | ||
if outfile == "-" { | ||
println!("{}", serialized_keypair); | ||
} else { | ||
println!("Wrote recovered keypair to {}", outfile); | ||
eprintln!("Wrote recovered keypair to {}", outfile); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section needs to be rewritten to match your changes in "new"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! I must've lost that in my, "Oh just let me make history pretty..." rebase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
864c3b8 oughta do it
Split file opening and data writing operations Drop filename == "-" stdio signal. It is an app-level feature
f46b9a5
to
864c3b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
r+ if CI is happy
Problem
There's no mechanism to encrypt a keypair generated by
solana-keygen
Summary of Changes
stdin
inread_keypair
stderr
insolana-keygen
This allows a poor man's keypair encryption via tools such as
gpg
without the keypair plaintext ever touching disk.May require
$ export GPG_TTY=$(tty)
on a Mac. You'll see an error along the lines ofInappropriate ioctl for device
.Caveat
When using
gpg
, the phase phrase prompt gets spammed by the mnemonic output AND the mnemonic output is cleared when the pass phrase prompt updates. Be sure to copy the mnemonic before entering the passphrase.