diff --git a/diceware/__init__.py b/diceware/__init__.py index 01cd5660c0baccbbe2ed2d1c9202f96f0d79b463..91975cbf6475cf8ded64829d9afc901e76cf1c77 100644 --- a/diceware/__init__.py +++ b/diceware/__init__.py @@ -177,6 +177,9 @@ def get_passphrase(options=None): The passphrase returned will contain `options.specials` special chars. + For the passphrase generation we will use the random source + registered under the name `options.randomsource`. + If `options.capitalize` is ``True``, all words will be capitalized. If `options.infile`, a file descriptor, is given, it will be used @@ -188,7 +191,8 @@ def get_passphrase(options=None): if options.infile is None: options.infile = open(get_wordlist_path("en"), 'r') word_list = get_wordlist(options.infile) - rnd = SystemRandom() + rnd_source = get_random_sources()[options.randomsource] + rnd = rnd_source(options) words = [rnd.choice(word_list) for x in range(options.num)] if options.capitalize: words = [x.capitalize() for x in words]