Peach :: Transformers :: crypto :: Crypt :: Class Crypt
[hide private]

Class Crypt

source code


UNIX style crypt. If no salt is specified will use first two chars of data, ala pwd style.

This transform uses a pure Python implementation of the crypt function which had been ported from an old C version. See fcrypt.py for licensing differences.

From underlying docs:

Generate an encrypted hash from the passed password. If the password is longer than eight characters, only the first eight will be used.

The first two characters of the salt are used to modify the encryption algorithm used to generate in the hash in one of 4096 different ways. The characters for the salt should be upper- and lower-case letters A to Z, digits 0 to 9, '.' and '/'.

The returned hash begins with the two characters of the salt, and should be passed as the salt to verify the password.

Instance Methods [hide private]
 
__init__(self, salt=None)
Create Transformer object.
source code
string
realEncode(self, data)
Override this to implement your transform.
source code

Inherited from transformer.Transformer: decode, encode, getAnotherTransformer, realDecode, setAnotherTransformer, transform

Static Methods [hide private]
 
unittest() source code
Class Variables [hide private]
  _salt = None
Method Details [hide private]

__init__(self, salt=None)
(Constructor)

source code 

Create Transformer object.

Parameters:
  • salt (string) - Salt for crypt (optional)
Overrides: transformer.Transformer.__init__

realEncode(self, data)

source code 

Override this to implement your transform.

Parameters:
  • data - Data to transform
Returns: string
transformed data
Overrides: transformer.Transformer.realEncode
(inherited documentation)