Package paramiko :: Module util
[show private | hide private]
[frames | no frames]

Module paramiko.util

Useful functions used by the rest of paramiko.
Function Summary
  bit_length(n)
  deflate_long(n, add_sign_padding)
turns a long-int into a normalized byte string (adapted from Crypto.Util.number)
  format_binary(data, prefix)
  format_binary_line(data)
  format_binary_weird(data)
string generate_key_bytes(hashclass, salt, key, nbytes)
Given a password, passphrase, or other human-source key, scramble it through a secure hash into some keyworthy bytes.
  hexify(s)
turn a string into a hex sequence
  inflate_long(s, always_positive)
turns a normalized byte string into a long-int (adapted from Crypto.Util.number)
  safe_string(s)
  tb_strings()

Function Details

deflate_long(n, add_sign_padding=1)

turns a long-int into a normalized byte string (adapted from Crypto.Util.number)

generate_key_bytes(hashclass, salt, key, nbytes)

Given a password, passphrase, or other human-source key, scramble it through a secure hash into some keyworthy bytes. This specific algorithm is used for encrypting/decrypting private key files.
Parameters:
hashclass - class from Crypto.Hash that can be used as a secure hashing function (like MD5 or SHA).
           (type=Crypto.Hash)
salt - data to salt the hash with.
           (type=string)
key - human-entered password or passphrase.
           (type=string)
nbytes - number of bytes to generate.
           (type=int)
Returns:
key data
           (type=string)

hexify(s)

turn a string into a hex sequence

inflate_long(s, always_positive=0)

turns a normalized byte string into a long-int (adapted from Crypto.Util.number)

Generated by Epydoc 2.0 on Sun Jan 4 02:33:11 2004 http://epydoc.sf.net