# Path: DPAPI/Core/masterkey.py
# class MasterKey(eater.DataStruct):
# class CredHist(eater.DataStruct):
# class DomainKey(eater.DataStruct):
# class MasterKeyFile(eater.DataStruct):
# class MasterKeyPool(object):
#     def __init__(self, raw=None):
#     def __getstate__(self):
#     def __setstate__(self, d):
#     def parse(self, data):
#     def decryptWithHash(self, userSID, pwdhash):
#     def decryptWithPassword(self, userSID, pwd):
#     def setKeyHash(self, h):
#     def setDecryptedKey(self, data):
#     def decryptWithKey(self, pwdhash):
#     def __repr__(self):
#     def __init__(self, raw=None):
#     def parse(self, data):
#     def __repr__(self):
#     def __init__(self, raw=None):
#     def parse(self, data):
#     def __repr__(self):
#     def __init__(self, raw=None):
#     def parse(self, data):
#     def decryptWithHash(self, userSID, h):
#     def decryptWithPassword(self, userSID, pwd):
#     def decryptWithKey(self, pwdhash):
#     def addKeyHash(self, guid, h):
#     def addDecryptedKey(self, guid, data):
#     def get_key(self):
#     def __repr__(self):
#     def __init__(self):
#     def addMasterKey(self, mkey):
#     def addMasterKeyHash(self, guid, h):
#     def getMasterKeys(self, guid):
#     def addSystemCredential(self, blob):
#     def addCredhist(self, sid, cred):
#     def addCredhistFile(self, sid, credfile):
#     def loadDirectory(self, directory):
#     def pickle(self, filename=None):
#     def __getstate__(self):
#     def __setstate__(self, d):
#     def unpickle(data=None, filename=None):
#     def try_credential_hash(self, userSID, pwdhash):
#     def try_credential(self, userSID, password):
#     def __repr__(self):
# 
# Path: DPAPI/Core/crypto.py
# class CryptoAlgo(object):
#     class Algo(object):
#         def __init__(self, data):
#         def __getattr__(self, attr):
#     def add_algo(cls, algnum, **kargs):
#     def get_algo(cls, algnum):
#     def __init__(self, i):
#     def do_fixup_key(self, key):
#     def __repr__(self):
# def des_set_odd_parity(key):
# def CryptSessionKeyXP(masterkey, nonce, hashAlgo, entropy=None, strongPassword=None, verifBlob=None):
# def CryptSessionKeyWin7(masterkey, nonce, hashAlgo, entropy=None, strongPassword=None, verifBlob=None):
# def CryptDeriveKey(h, cipherAlgo, hashAlgo):
# def decrypt_lsa_key_nt5(lsakey, syskey):
# def decrypt_lsa_key_nt6(lsakey, syskey):
# def SystemFunction005(secret, key):
# def decrypt_lsa_secret(secret, lsa_keys):
# def pbkdf2(passphrase, salt, keylen, iterations, digest='sha1'):
# def derivePwdHash(pwdhash, userSID, digest='sha1'):
# def dataDecrypt(cipherAlgo, hashAlgo, raw, encKey, iv, rounds):
# def DPAPIHmac(hashAlgo, pwdhash, hmacSalt, value):
#         U = salt + struct.pack("!L", i)
# 
# Path: DPAPI/Core/blob.py
# class DPAPIBlob(eater.DataStruct):
#     def __init__(self, raw=None):
#     def parse(self, data):
#     def decrypt(self, masterkey, entropy=None, strongPassword=None):
#     def __repr__(self):


import unittest
from DPAPI.Core import masterkey
from DPAPI.Core import crypto
from DPAPI.Core import blob
## circulated without prior licence                                        ##
##                                                                         ##
##  Author: Jean-Michel Picod <jmichel.p@gmail.com>                        ##
##                                                                         ##
## This program is distributed under GPLv3 licence (see LICENCE.txt)       ##
##                                                                         ##
#############################################################################



class BlobXPSimpleTest(unittest.TestCase):
    def setUp(self):
        self.raw = ("01000000d08c9ddf0115d1118c7a00c0"
                    "4fc297eb010000002f44b69f6a628049"
                    "9c85d238be955b3c000000003c000000"
                    "4400500041005000490063006b002000"
                    "730069006d0070006c00650020006200"
                    "6c006f0062002000670065006e006500"
                    "7200610074006f007200000003660000"
                    "a80000001000000055d9d46709e463db"
                    "53c783ec1edd69dc0000000004800000"
                    "a00000001000000038d39c66910558b6"
                    "a4e961b5de40e84918000000eae8acdd"
                    "f984a8efae7701754baf9f844c9f1cbd"
                    "df818a9f14000000be5c65c109be3c7f"
                    "d4787df81e923b596f635d0f").decode("hex")
        self.mkey = ("f1cd9c3915428d12c0e9bf5ac0c44dda"
                     "647e6e387118c09eb00a294e485a3f6e"
                     "fe47f16686ad5f60fbd740164de87711"
                     "6eb70d35445b22ddebdb02b0d55ee613").decode("hex")

# Path: DPAPI/Core/masterkey.py
# class MasterKey(eater.DataStruct):
# class CredHist(eater.DataStruct):
# class DomainKey(eater.DataStruct):
# class MasterKeyFile(eater.DataStruct):
# class MasterKeyPool(object):
#     def __init__(self, raw=None):
#     def __getstate__(self):
#     def __setstate__(self, d):
#     def parse(self, data):
#     def decryptWithHash(self, userSID, pwdhash):
#     def decryptWithPassword(self, userSID, pwd):
#     def setKeyHash(self, h):
#     def setDecryptedKey(self, data):
#     def decryptWithKey(self, pwdhash):
#     def __repr__(self):
#     def __init__(self, raw=None):
#     def parse(self, data):
#     def __repr__(self):
#     def __init__(self, raw=None):
#     def parse(self, data):
#     def __repr__(self):
#     def __init__(self, raw=None):
#     def parse(self, data):
#     def decryptWithHash(self, userSID, h):
#     def decryptWithPassword(self, userSID, pwd):
#     def decryptWithKey(self, pwdhash):
#     def addKeyHash(self, guid, h):
#     def addDecryptedKey(self, guid, data):
#     def get_key(self):
#     def __repr__(self):
#     def __init__(self):
#     def addMasterKey(self, mkey):
#     def addMasterKeyHash(self, guid, h):
#     def getMasterKeys(self, guid):
#     def addSystemCredential(self, blob):
#     def addCredhist(self, sid, cred):
#     def addCredhistFile(self, sid, credfile):
#     def loadDirectory(self, directory):
#     def pickle(self, filename=None):
#     def __getstate__(self):
#     def __setstate__(self, d):
#     def unpickle(data=None, filename=None):
#     def try_credential_hash(self, userSID, pwdhash):
#     def try_credential(self, userSID, password):
#     def __repr__(self):
# 
# Path: DPAPI/Core/crypto.py
# class CryptoAlgo(object):
#     class Algo(object):
#         def __init__(self, data):
#         def __getattr__(self, attr):
#     def add_algo(cls, algnum, **kargs):
#     def get_algo(cls, algnum):
#     def __init__(self, i):
#     def do_fixup_key(self, key):
#     def __repr__(self):
# def des_set_odd_parity(key):
# def CryptSessionKeyXP(masterkey, nonce, hashAlgo, entropy=None, strongPassword=None, verifBlob=None):
# def CryptSessionKeyWin7(masterkey, nonce, hashAlgo, entropy=None, strongPassword=None, verifBlob=None):
# def CryptDeriveKey(h, cipherAlgo, hashAlgo):
# def decrypt_lsa_key_nt5(lsakey, syskey):
# def decrypt_lsa_key_nt6(lsakey, syskey):
# def SystemFunction005(secret, key):
# def decrypt_lsa_secret(secret, lsa_keys):
# def pbkdf2(passphrase, salt, keylen, iterations, digest='sha1'):
# def derivePwdHash(pwdhash, userSID, digest='sha1'):
# def dataDecrypt(cipherAlgo, hashAlgo, raw, encKey, iv, rounds):
# def DPAPIHmac(hashAlgo, pwdhash, hmacSalt, value):
#         U = salt + struct.pack("!L", i)
# 
# Path: DPAPI/Core/blob.py
# class DPAPIBlob(eater.DataStruct):
#     def __init__(self, raw=None):
#     def parse(self, data):
#     def decrypt(self, masterkey, entropy=None, strongPassword=None):
#     def __repr__(self):


# Path: tests/blob.py
import unittest
from DPAPI.Core import masterkey
from DPAPI.Core import crypto
from DPAPI.Core import blob

## circulated without prior licence                                        ##
##                                                                         ##
##  Author: Jean-Michel Picod <jmichel.p@gmail.com>                        ##
##                                                                         ##
## This program is distributed under GPLv3 licence (see LICENCE.txt)       ##
##                                                                         ##
#############################################################################



class BlobXPSimpleTest(unittest.TestCase):
    def setUp(self):
        self.raw = ("01000000d08c9ddf0115d1118c7a00c0"
                    "4fc297eb010000002f44b69f6a628049"
                    "9c85d238be955b3c000000003c000000"
                    "4400500041005000490063006b002000"
                    "730069006d0070006c00650020006200"
                    "6c006f0062002000670065006e006500"
                    "7200610074006f007200000003660000"
                    "a80000001000000055d9d46709e463db"
                    "53c783ec1edd69dc0000000004800000"
                    "a00000001000000038d39c66910558b6"
                    "a4e961b5de40e84918000000eae8acdd"
                    "f984a8efae7701754baf9f844c9f1cbd"
                    "df818a9f14000000be5c65c109be3c7f"
                    "d4787df81e923b596f635d0f").decode("hex")
        self.mkey = ("f1cd9c3915428d12c0e9bf5ac0c44dda"
                     "647e6e387118c09eb00a294e485a3f6e"
                     "fe47f16686ad5f60fbd740164de87711"
                     "6eb70d35445b22ddebdb02b0d55ee613").decode("hex")

        self.blob = blob.DPAPIBlob(self.raw)