Documentation ¶
Index ¶
Constants ¶
const ( DefaultMax = -1 DefaultLength = 24 DefaultSymbolSet = "~!@#$%^*_+-=;,./?" )
const ( Number = iota Upper Lower Symbol )
const AppName = "dpass"
const LatestGenVersion = uint64(1)
This is the version of the generator. It is encoded into the output blob for reverse compatibility if the generation algorithm has changed
Variables ¶
This section is empty.
Functions ¶
func BlobIndexPrefix ¶
Given a domain and password, return the blob index prefix which can be used by an interface to look up all blobs for that domain
Types ¶
type GenOpts ¶
type GenOpts struct { Domain string `json:"d"` Username string `json:"u"` Iteration uint64 `json:"i"` Length uint64 `json:"c"` GenVersion uint64 `json:"pwv"` Numbers uint64 `json:"n"` MaxNumbers int `json:"mn"` Uppers uint64 `json:"U"` MaxUppers int `json:"mU"` Lowers uint64 `json:"l"` MaxLowers int `json:"ml"` Symbols uint64 `json:"s"` MaxSymbols int `json:"ms"` SymbolSet string `json:"ss"` // contains filtered or unexported fields }
func (*GenOpts) Blob ¶
Blob returns a base32 encoded encrypted blob of the json encoded options. First the json is compressed, then encrypted using the sha512_256 sum of the scrypt master password hash + the domain name. This makes the encryption key unique for each domain, but allows decrypting all entries for a single domain with a single key so that an interface can allow choosing from entries in a domain.
func (*GenOpts) BlobIndex ¶
BlobIndex returns the index string which can identify an encrypted options blob. The first 22 characters are the base32 double sha512_128 sum of the domain name and mphash. The remaining 6 characters are a hash of the json encoded options to uniquely identify this entry for the domain. This makes searching for entries for a given domain possible before decryption.
func (*GenOpts) GenPW ¶
GenPW will generate a deterministic password based on the initialized options and hashed master password.