Documentation ¶
Overview ¶
Package sealbox implements web3 secrets storage.
https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition
Index ¶
Constants ¶
View Source
const ( // StandardScryptN is the N parameter of Scrypt encryption algorithm, using 256MB // memory and taking approximately 1s CPU time on a modern processor. StandardScryptN = 1 << 18 // StandardScryptP is the P parameter of Scrypt encryption algorithm, using 256MB // memory and taking approximately 1s CPU time on a modern processor. StandardScryptP = 1 // LightScryptN is the N parameter of Scrypt encryption algorithm, using 4MB // memory and taking approximately 100ms CPU time on a modern processor. LightScryptN = 1 << 12 // LightScryptP is the P parameter of Scrypt encryption algorithm, using 4MB // memory and taking approximately 100ms CPU time on a modern processor. LightScryptP = 6 )
Variables ¶
View Source
var ErrDecrypt = errors.New("could not decrypt key with given passphrase")
ErrDecrypt - Error returned on failed decryption attempt.
Functions ¶
This section is empty.
Types ¶
type CipherParams ¶
type CipherParams struct {
IV string `json:"iv,omitempty"`
}
CipherParams - Sealed box params JSON structure.
type Crypto ¶
type Crypto struct { Cipher string `json:"cipher,omitempty"` CipherText string `json:"ciphertext,omitempty"` CipherParams CipherParams `json:"cipherparams,omitempty"` KDF string `json:"kdf,omitempty"` KDFParams KDFParams `json:"kdfparams,omitempty"` MAC string `json:"mac,omitempty"` }
Crypto - Sealed JSON structure.
type KDFParams ¶
type KDFParams struct { N int `json:"n,omitempty"` R int `json:"r,omitempty"` P int `json:"p,omitempty"` C int `json:"c,omitempty"` DKLen int `json:"dklen,omitempty"` Salt string `json:"salt,omitempty"` PRF string `json:"prf,omitempty"` }
KDFParams - Sealed box KDF parameters.
type SealedBox ¶
type SealedBox struct { Version int `json:"version,omitempty"` Crypto Crypto `json:"crypto,omitempty"` }
SealedBox - Sealed box JSON structure version 3.
func EncryptLight ¶
EncryptLight - Encrypts a box using light scrypt parameters.
func EncryptStandard ¶
EncryptStandard - Encrypts a box using standard scrypt parameters.
Click to show internal directories.
Click to hide internal directories.