snarkOS icon indicating copy to clipboard operation
snarkOS copied to clipboard

[Proposal] entering private key in plaintext raise concerns

Open B0-B opened this issue 3 years ago • 2 comments

💥 Proposal

Entering private key in plaintext in terminal and yields potential threats, instead a signature derived from private key file would be much more secure I suppose.

B0-B avatar Dec 08 '22 12:12 B0-B

Seems like a duplicate of https://github.com/AleoHQ/snarkOS/issues/1583? In any case, I agree :+1:.

Edit: ah no, that one was the RPC password; in any case, it's a related matter.

ljedrz avatar Dec 15 '22 16:12 ljedrz

Also #1888

HarukaMa avatar Dec 16 '22 07:12 HarukaMa

Thanks for the lookup! :)

B0-B avatar Dec 25 '22 00:12 B0-B

I also agree with the concerns about security of the private keys thus far.

I noticed the Signature struct is indeed a challenge/response and compute key. It is not a signature in terms of private key signing, and this may require additional work to designate a signature which is derived from the private key and can be confirmed with the public key (Address).

Also the private key should never be exposed to a computer with an internet connection. At the moment the library relies on the std library quite heavily, and a lot of embedded devices require being able to compile with the #![no_std] macro.

Ideally an embedded system without ethernet hardware should store the key and there should be a mechanism for encrypting values provided over the device's serial connection and supplying a signature, at least with a derived compute key or by encrypting those values to a delegated prover in the prover pool's public address. It seems that perfect key management requires the use of a hardware device with the ability to partially kick off the zkSNARK inputs and have the remaining computation performed on an internet connected device, then relayed to the verifier network.

arosboro avatar Dec 25 '22 22:12 arosboro

Hey arosboro, fully agree to what I can grasp. Best practive would be hardware encryption (PSP or external HW token for signing), since this is not the default the next best step would be encryption on kernel level. Instead of clipboard pasting there are better methods such as protected RSA/DSA reading from file or ECDSA signature/fingerprint as you mentioned.

B0-B avatar Jan 16 '23 11:01 B0-B

Closing as this issue has been resolved.

Private keys can now be provided via a file.

howardwu avatar Oct 09 '23 23:10 howardwu