def main(args): ORM.init() pwd = getpass() tmp = b64decode(MASTER_HASH) salt = tmp[:8] _hash = tmp[8:] assert pbkdf2(pwd, salt, i=100000)[1] == _hash k = KinaStorage(pwd) if args.e: k.add_dir(args.path, args.r) elif args.d: k.rm_dir(args.path, args.r) elif args.l: k.list_dir(args.path) elif args.z: k.del_dir(args.path, args.r) k.session.commit()
def __init__(self, key): self.key = pbkdf2(key, SALT, i=100000, keylen=32)[1] self.session = ORM.session()