Exemplo n.º 1
0
 def username(cls):
     uname = getattr(getattr(cls, 'profile', None), 'username', None)
     if uname:
         from util.primitives.strings import to_hex, string_xor
         uname = to_hex(string_xor(x='digsbygrid', y=uname.encode('utf-8'), adjustx=True), '')
         return ['-u', uname]
     return []
Exemplo n.º 2
0
def cipher_functions(username, password):
    from sysident import sysident

    mach_key = sysident()
    digest = sha1(username + password).digest()
    assert len(mach_key) == len(digest)
    key = strings.string_xor(digest, mach_key)
    return crypto.cipher_functions(key[-16:], mode=crypto.Mode.CBC)