Developer documentation


Multi-platform console/gui passphrase generator


Entry point and handler of command options and arguments

Parameters :
  • argv: List of command arguments

Print help / usage information


class dispass.cli.CLI[source]

Command Line Interface handling


Start interactive prompt, generating and showing the passprase(s)

Parameters :
  • labels: List or dict of labels to use for passprase generation
passphraseLength = 30

Length of output passphrase, default is 30


Prompt for password. Returns password

promptDouble = False

Boolean. Prompt for password twice


Optionally override self.useCurses

Parameters :
  • useCurses: Boolean

Optionally override length of output passphrase

Parameters :
  • length: Integer. Length of output passphrase

Set options for the passwordPrompt)

Parameters :
  • promptDouble: Boolean. Prompt 2x and compare passwords


dispass.digest.digest(message, length=30)[source]

Create and return secure hash of message

A secure hash/message digest formed by hashing the message with the sha512 algorithm, encoding this hash with base64 and stripping it down to the first length characters.

Parameters :
  • message: The string from which to form the digest
  • length: Length of output hash (optional)
Return :
  • The secure hash of message
dispass.digest.digestPasswordDict(indentifierDict, password)[source]

Creat secure hashes of a dict of identifier:length and a password

A secure hash/message digest formed by hashing the message with the sha512 algorithm, encoding this hash with base64 and stripping it down to the first length characters.

Parameters :
  • indentifierDict: A dict of {identifier: length,} entries
  • password: The password to use for hashing entries
Return :
  • The secure hash of message


class dispass.gui.GUI[source]

Houses all GUI related objects and interactions


Clear all input fields


Create and align widgets

font = 'Verdana'

Default font (Verdana)

fontsize = 10

Default fontsize (10 pt.)


Get font and fontsize, optionally differ from default fontsize

Parameters :
  • sizediff: The difference in pt. from the default fontsize
Return :
  • Tuple of (font, fontsize) to be used when creating widgets

Set font and fontsize; not used at this moment


Toggle checking of input password


Check user input

Warn when user input is insufficient or wrong. Create digest and display the generated password if user input is OK.

warn(message, warning_type='soft', box_title='')[source]

Prototype for warning user

  • soft warnings display a message in the passwordout field
  • hard warnings do the same and also display a messagebox
Parameters :
  • message: The message string for warning the user
  • warning_type: Either ‘soft’ (default value) or ‘hard’
  • box_title: Optional title for tkMessageBox on hard warnings


class dispass.labelfile.FileHandler(write=False, file_location='~/.dispass')[source]

Parsing of labelfiles and writing to labelfiles

default_hashname = 'dispass1'

Name of hash to use by default

default_length = 30

Default passphrase length

file_found = None

Boolean value set on init

file_location = None

String of labelfile location, set on init

file_stripped = []

Labelfile contents with comments and blank lines removed

filehandle = None

File object, set on init if labelfile is found

labels = None

Dict of {label: length}


Create dictionary of labels = {label: length, ...}

Table Of Contents

Previous topic

dispass.el Emacs wrapper

This Page