How to generate secrets in Python 3.6 and later