Exemplo n.º 1
0
   def test_too_many_words_requested(self):
      '''
      Test for problems with too little "entropy"

      Words are chosen with a fraction of the bytes from scrypt.
      The more words requested, the smaller the number of bytes each.
      If too small, only a portion of the vocabulary could be reached,
      and that would be uncool.
      '''

      vocabulary = map(str, range(2**16))

      # OK: each word is chosen with >=2 bytes - OK for 2**16
      generate(vocabulary, 'one', 'two', n=32)

      # BAD: each word is chosen with <=1 byte - BAD for 2**16
      self.assertRaises(Exception, generate, vocabulary, 'one', 'two', n=33)
Exemplo n.º 2
0
 def gen(self, key0, key1, n=5, hexSep=False):
     return generate(self.words, key0, key1, n, hexSep)