Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encryptor ¶
type Encryptor struct {
// contains filtered or unexported fields
}
Encryptor is an encryptor that follows the Ethereum keystore V4 specification.
func New ¶
New creates a new keystore V4 encryptor. This takes the following options: - cipher: the cipher to use when encrypting the secret, can be either "pbkdf2" (default) or "scrypt" - costPower: the cipher key cost to use as power of 2, default is 18 (ie. 2^18).
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option gives options to New
func WithCipher ¶
WithCipher sets the cipher for the encryptor.
func WithCost ¶ added in v1.3.0
WithCost sets the cipher key cost for the encryptor to 2^power overriding the default value of 18 (ie. 2^18=262144). Higher values increases the cost of an exhaustive search but makes encoding and decoding proportionally slower. This should only be in testing as it affects security. It panics if t is nil.