Documentation ¶
Index ¶
- Variables
- func ArmorInfoBytes(bz []byte) string
- func ArmorPubKeyBytes(bz []byte, algo string) string
- func DecryptArmorPrivKey(armorStr string, passphrase string) (privKey crypto.PrivKey, algo string, err error)
- func EncryptArmorPrivKey(privKey crypto.PrivKey, passphrase string, algo string) string
- func UnarmorInfoBytes(armorStr string) ([]byte, error)
- func UnarmorPubKeyBytes(armorStr string) (bz []byte, algo string, err error)
- type KeyManager
Constants ¶
This section is empty.
Variables ¶
var BcryptSecurityParameter = 12
BcryptSecurityParameter is security parameter var, and it can be changed within the lcd test. Making the bcrypt security parameter a var shouldn't be a security issue: One can't verify an invalid key by maliciously changing the bcrypt parameter during a runtime vulnerability. The main security threat this then exposes would be something that changes this during runtime before the user creates their key. This vulnerability must succeed to update this to that same value before every subsequent call to the keys command in future startups / or the attacker must get access to the filesystem. However, with a similar threat model (changing variables in runtime), one can cause the user to sign a different tx than what they see, which is a significantly cheaper attack then breaking a bcrypt hash. (Recall that the nonce still exists to break rainbow tables) For further notes on security parameter choice, see README.md
Functions ¶
func DecryptArmorPrivKey ¶
func DecryptArmorPrivKey(armorStr string, passphrase string) (privKey crypto.PrivKey, algo string, err error)
DecryptArmorPrivKey returns the privkey byte slice, a string of the algo type, and an error
func EncryptArmorPrivKey ¶
----------------------------------------------------------------- encrypt/decrypt with armor Encrypt and armor the private key.
func UnarmorInfoBytes ¶
Unarmor the InfoBytes
Types ¶
type KeyManager ¶
type KeyManager interface { Generate() (string, crypto.PrivKey) Sign(data []byte) ([]byte, error) ExportPrivKey(password string) (armor string, err error) ImportPrivKey(armor, passphrase string) (crypto.PrivKey, string, error) ExportPubKey() crypto.PubKey }
func NewAlgoKeyManager ¶
func NewAlgoKeyManager(algo string) (KeyManager, error)
func NewKeyManager ¶
func NewKeyManager() KeyManager
func NewMnemonicKeyManager ¶
func NewMnemonicKeyManager(mnemonic string, algo string) (KeyManager, error)
func NewPrivateKeyManager ¶
func NewPrivateKeyManager(priv []byte, algo string) (KeyManager, error)
Directories ¶
Path | Synopsis |
---|---|
keys
|
|
secp256k1/internal/secp256k1
nolint:gocritic Package secp256k1 wraps the bitcoin secp256k1 C library.
|
nolint:gocritic Package secp256k1 wraps the bitcoin secp256k1 C library. |