Developer documentation

dispass.dispass

Multi-platform console/gui passphrase generator

dispass.dispass.main(argv)[source]

Entry point and handler of command options and arguments

Parameters :
  • argv: List of command arguments
dispass.dispass.usage()[source]

Print help / usage information

dispass.cli

class dispass.cli.CLI[source]

Command Line Interface handling

interactive(labels)[source]

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

passwordPrompt()[source]

Prompt for password. Returns password

promptDouble = False

Boolean. Prompt for password twice

setCurses(useCurses)[source]

Optionally override self.useCurses

Parameters :
  • useCurses: Boolean
setLength(length)[source]

Optionally override length of output passphrase

Parameters :
  • length: Integer. Length of output passphrase
setPrompt(promptDouble=False)[source]

Set options for the passwordPrompt)

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

dispass.digest

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

dispass.gui

class dispass.gui.GUI[source]

Houses all GUI related objects and interactions

clearInput()[source]

Clear all input fields

createWidgets(master)[source]

Create and align widgets

font = 'Verdana'

Default font (Verdana)

fontsize = 10

Default fontsize (10 pt.)

getFont(sizediff=0)[source]

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
setFont()[source]

Set font and fontsize; not used at this moment

toggleCheck()[source]

Toggle checking of input password

validateAndShow()[source]

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

dispass.labelfile

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}

parse()[source]

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

Table Of Contents

Previous topic

dispass.el Emacs wrapper

This Page