Documentation
¶
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 ¶
This section is empty.
Functions ¶
func DecryptData ¶
func DecryptData(cj CryptoJSON, auth string) ([]byte, error)
Types ¶
type CryptoJSON ¶
type CryptoJSON struct {
Cipher string `json:"cipher"`
CipherText string `json:"ciphertext"`
CipherParams cipherParamsJSON `json:"cipherParams"`
KDF string `json:"kdf"`
KDFParams map[string]interface{} `json:"kdfParams"`
MAC string `json:"mac"`
}
func EncryptData ¶
func EncryptData(data, auth []byte, scryptN, scryptP int) (CryptoJSON, error)
type EncryptedKeyJSON ¶
type EncryptedKeyJSON struct {
Address string `json:"address"`
Crypto CryptoJSON `json:"crypto"`
ID string `json:"id"`
Version int `json:"version"`
}
Click to show internal directories.
Click to hide internal directories.