Skip to content
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

Tag SecretKey export as distinct type #67

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

Conversation

mratsim
Copy link
Contributor

@mratsim mratsim commented Jul 24, 2020

This follows a discussion with an auditor on ED25519 in libp2p.

We need to use all measures possible to prevent leaking private keys, hence I recommend that all private keys use distinct byte.
We should also prevent toHex, == on them or for toHex output a SecretHex / SecretString.

In nim-beacon-chain this should prevent introducing private key logging by mistake:
https://github.com/status-im/nim-beacon-chain/blob/40c2714ff30c811978fcc234f438ddd473851009/beacon_chain/spec/crypto.nim#L312-L314

Even though some thoughts was given to prevent that:
https://github.com/status-im/nim-beacon-chain/blob/40c2714ff30c811978fcc234f438ddd473851009/beacon_chain/spec/crypto.nim#L186-L187

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