cosmos-sdk: github.com/cosmos/cosmos-sdk/crypto Index | Files | Directories

package crypto

import "github.com/cosmos/cosmos-sdk/crypto"

Index

Package Files

armor.go

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

func ArmorInfoBytes Uses

func ArmorInfoBytes(bz []byte) string

Armor the InfoBytes

func ArmorPubKeyBytes Uses

func ArmorPubKeyBytes(bz []byte, algo string) string

Armor the PubKeyBytes

func EncryptArmorPrivKey Uses

func EncryptArmorPrivKey(privKey crypto.PrivKey, passphrase string, algo string) string

Encrypt and armor the private key.

func UnarmorDecryptPrivKey Uses

func UnarmorDecryptPrivKey(armorStr string, passphrase string) (privKey crypto.PrivKey, algo string, err error)

UnarmorDecryptPrivKey returns the privkey byte slice, a string of the algo type, and an error

func UnarmorInfoBytes Uses

func UnarmorInfoBytes(armorStr string) ([]byte, error)

Unarmor the InfoBytes

func UnarmorPubKeyBytes Uses

func UnarmorPubKeyBytes(armorStr string) (bz []byte, algo string, err error)

UnarmorPubKeyBytes returns the pubkey byte slice, a string of the algo type, and an error

Directories

PathSynopsis
codec
hdPackage hd provides support for hierarchical deterministic wallets generation and derivation.
keyringPackage keys provides common key management API.
keys/ed25519
keys/internal/benchmarking
keys/multisig
keys/secp256k1
ledger
types
types/multisig

Package crypto imports 9 packages (graph) and is imported by 9 packages. Updated 2020-09-29. Refresh now. Tools for package owners.