How to use the andriller.cracking.PasswordCrackError function in andriller

To help you get started, we’ve selected a few andriller examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github den4uk / andriller / andriller / cracking.py View on Github external
def get_salt(salt: int) -> bytes:
        if not salt:
            raise PasswordCrackError('Must enter SALT value as integer')
        if not isinstance(salt, int):
            raise PasswordCrackError('Salt must be an integer')
        return (
            f'{salt:x}'.encode()
            if salt > 0
            else binascii.hexlify(struct.pack(">q", salt))
        )
github den4uk / andriller / andriller / cracking.py View on Github external
def get_salt(salt: int) -> bytes:
        if not salt:
            raise PasswordCrackError('Must enter SALT value as integer')
        if not isinstance(salt, int):
            raise PasswordCrackError('Salt must be an integer')
        return (
            f'{salt:x}'.encode()
            if salt > 0
            else binascii.hexlify(struct.pack(">q", salt))
        )
github den4uk / andriller / andriller / cracking.py View on Github external
def _get_feed(self):
        if not self.alpha:
            return self._feed_pins()
        elif self.dict_file:
            return self._feed_dict()
        elif self.alpha_range:
            return self._feed_alpha()
        else:
            raise PasswordCrackError('Attack method was not chosen.')
github den4uk / andriller / andriller / cracking.py View on Github external
def _feed_alpha(self):
        if not self.alpha_range:
            raise PasswordCrackError('Range of characters not specified')
        for i in range(self.min_len, self.max_len + 1):
            for prod in itertools.product(self.alpha_range, repeat=i):
                yield ''.join(prod).encode()
github den4uk / andriller / andriller / cracking.py View on Github external
def get_hash(key: str) -> bytes:
        if not key or not utils.is_hex(key) or not (len(key) in [40, 72]):
            raise PasswordCrackError('Must enter HASH value.')
        return binascii.unhexlify(key[:40])