Documentation ¶
Overview ¶
Package kdbcrypt encrypts and decrypts data using the KeePass1 encryption scheme.
Index ¶
Constants ¶
const BlockSize = 16
Block size in bytes.
Variables ¶
var ( ErrUnknownCipher = errors.New("keepass: unknown cipher") ErrSize = errors.New("keepass: data size not a multiple of 16") )
Errors
Functions ¶
func NewDecrypter ¶
NewDecrypter creates a new reader that decrypts and strips padding from r.
func NewEncrypter ¶
NewEncrypter creates a new writer that encrypts to w. Closing the new writer writes the final, padded block but does not close w.
Types ¶
type ComputedKey ¶
type ComputedKey []byte
A ComputedKey is the encryption key that is directly passed to the cipher, derived from a Key. Since computing a key is slow by design, if you intend to decrypt and encrypt a database multiple times in quick succession, this will be much faster.
type Key ¶
type Key struct { Password []byte // optional KeyFileHash []byte // must be nil or length 16 MasterSeed [16]byte TransformSeed [32]byte TransformRounds uint32 }
A Key is the set of parameters used to build the cipher key.
func (*Key) Compute ¶
func (k *Key) Compute() ComputedKey
Compute derives the actual cipher key from the user-specifiable parameters.