Documentation
¶
Index ¶
- func Decrypt(data *EncryptedData, password []byte) ([]byte, error)
- func InitMasterPassword(password []byte) error
- func MarshalEncrypted(data *EncryptedData) (string, error)
- func MasterPasswordInitialized() bool
- func ReadPassword() (string, error)
- func VerifyMasterPassword(password []byte) error
- type EncryptedData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitMasterPassword ¶
func MarshalEncrypted ¶
func MarshalEncrypted(data *EncryptedData) (string, error)
func MasterPasswordInitialized ¶
func MasterPasswordInitialized() bool
func ReadPassword ¶
ReadPassword reads a password from the terminal with echo disabled. The caller is responsible for printing the prompt.
func VerifyMasterPassword ¶
Types ¶
type EncryptedData ¶
type EncryptedData struct {
Salt string `json:"salt"`
Nonce string `json:"nonce"`
Ciphertext string `json:"ciphertext"`
Version int `json:"version,omitempty"` // 0 = legacy (t=1), 1 = current (t=3)
}
EncryptedData holds the encrypted payload with versioning for parameter migration.
func Encrypt ¶
func Encrypt(plaintext, password []byte) (*EncryptedData, error)
func UnmarshalEncrypted ¶
func UnmarshalEncrypted(s string) (*EncryptedData, error)
Click to show internal directories.
Click to hide internal directories.