PYTHON: generate master key