def _encrypt_password(self, password):
        """encrypt the password for given mode """
        if self.encryption_mode.lower() == 'crypt':
            return self._crypt_password(password)
        elif self.encryption_mode.lower() == 'md5':
            return self._md5_password(password)
        elif self.encryption_mode.lower() == 'md5-base':
            return self._md5_base_password(password)
        else:
            raise UnknownEncryptionMode(self.encryption_mode)
def _encrypt_password ( self , password ) : if self . encryption_mode . lower ( ) == 'crypt' : return self . _crypt_password ( password ) elif self . encryption_mode . lower ( ) == 'md5' : return self . _md5_password ( password ) elif self . encryption_mode . lower ( ) == 'md5-base' : return self . _md5_base_password ( password ) else : raise UnknownEncryptionMode ( self . encryption_mode )
encrypt the password for given mode