Beispiel #1
0
print '[+] Generating Master Key...'
MASTER_KEY = crypto.genOptimalKey()

print '[+] Creating "seeker" account...'

while True:
    password = getpass.getpass('Please enter "seeker" password: '******'Repeat: ')

    if password==password2:
        break

print '[+] Encrypting Master Key for "seeker"...'

KDFSalt = crypto.randomBytes(crypto.SALT_LENGTH)
keyFromPassword = crypto.keyFromText(password, KDFSalt)
EMK = crypto.encrypt(MASTER_KEY, keyFromPassword)

print '[+] Storing Master Key checksum...'
cksum = checksum(MASTER_KEY)
gc = GlobalConfig(
            key = 'master_key_checksum',
            value = cksum
            )
session.add(gc)

del MASTER_KEY

u = User(
            username = '******',
            password = hashPassword(password),
Beispiel #2
0
print '[+] Generating Master Key...'
MASTER_KEY = crypto.genOptimalKey()

print '[+] Creating "seeker" account...'

while True:
    password = getpass.getpass('Please enter "seeker" password: '******'Repeat: ')

    if password == password2:
        break

print '[+] Encrypting Master Key for "seeker"...'

KDFSalt = crypto.randomBytes(crypto.SALT_LENGTH)
keyFromPassword = crypto.keyFromText(password, KDFSalt)
EMK = crypto.encrypt(MASTER_KEY, keyFromPassword)

print '[+] Storing Master Key checksum...'
cksum = checksum(MASTER_KEY)
gc = GlobalConfig(key='master_key_checksum', value=cksum)
session.add(gc)

del MASTER_KEY

u = User(username='******',
         password=hashPassword(password),
         email='root@localhost',
         active=True,
         encrypted_master_key=EMK,
         b64_kdf_salt=base64.b64encode(KDFSalt))
Beispiel #3
0
session = sessionmaker(bind=engine)()

print '[+] Generating Master Key...'
MASTER_KEY = crypto.genOptimalKey()

print '[+] Creating "seeker" account...'

while True:
    password = getpass.getpass('Please enter "seeker" password: '******'Repeat: ')

    if password==password2:
        break

print '[+] Encrypting Master Key for "seeker"...'
keyFromPassword = crypto.keyFromText(password)
EMK = crypto.encrypt(MASTER_KEY, keyFromPassword)

print '[+] Storing Master Key checksum...'
cksum = checksum(MASTER_KEY)
gc = GlobalConfig(
            key = 'master_key_checksum',
            value = cksum
            )
session.add(gc)

del MASTER_KEY

u = User(
            username = '******',
            password = hashPassword(password),