Documentation
¶
Overview ¶
Package masterpassword implements the MasterPassword algorithm (http://masterpasswordapp.com/algorithm.html).
Usage:
Create a session from the user name and the password using NewSession. Then, instantiate a site with NewSite or NewSiteWithCounter.
Finally, you can generate the password using the Password method on the Site. Password requires you to specify the type of password using a PasswordType.
*PasswordType implements the Value interface from the flags package, making it easy to use it as a command line parameter:
import "flag" var pwdType = PasswordTypeBasic func main() { flag.Var(&pwdType, "type", "password type") }
Index ¶
Constants ¶
const ( PasswordTypeMaximumSecurity = iota PasswordTypeLong PasswordTypeMedium PasswordTypeShort PasswordTypeBasic PasswordTypePIN )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PasswordType ¶
type PasswordType int
PasswordType is the type of password to generate. The available types are PIN, Short, Basic, Medium, Long and Maximum Security.
func (*PasswordType) Set ¶
func (t *PasswordType) Set(value string) (err error)
Set implements the Value interface for PasswordType and converts from a string value to an enum value. Shortcuts are supported, and the check is case insensitive. An error is returned when resolving fails.
func (*PasswordType) String ¶
func (t *PasswordType) String() (s string)
String implements the Value interface for PasswordType and converts the enum value to a human readable string value
type Session ¶
Session is an encryption session and holds the master key, as well as the user name. Note that the password is not stored.
func NewSession ¶
NewSession creates a new session for given username and password. This involves deriving the master key, which can be a little time consuming.
type Site ¶
Site is a site seed with site information
func (*Site) Password ¶
func (site *Site) Password(pwdType PasswordType) string
Password returns the password of type pwdType for this site
func (*Site) PasswordSheet ¶
func (site *Site) PasswordSheet(pwdType PasswordType) (passwords []string)
PasswordSheet ignores the first seed byte and returns all password variations for this site