corrected a mistake when generating the private files under python3, the output has to be in a binary format, and added a possibility to generate a masterkey encrypted using a provided key