• Home
  • Raw
  • Download

Lines Matching refs:crypt

6     import crypt
11 crypt = None variable
16 @unittest.skipIf(crypt, 'import succeeded')
23 @unittest.skipUnless(crypt, 'crypt module is required')
27 cr = crypt.crypt('mypassword')
28 cr2 = crypt.crypt('mypassword', cr)
30 cr = crypt.crypt('mypassword', 'ab')
32 cr2 = crypt.crypt('mypassword', cr)
36 self.assertEqual(len(crypt._saltchars), 64)
37 for method in crypt.methods:
38 salt = crypt.mksalt(method)
44 for method in crypt.methods:
45 cr = crypt.crypt('assword', method)
47 cr2 = crypt.crypt('assword', cr)
49 cr = crypt.crypt('assword', crypt.mksalt(method))
53 self.assertTrue(len(crypt.methods) >= 1)
55 self.assertEqual(crypt.methods, [crypt.METHOD_BLOWFISH])
57 self.assertEqual(crypt.methods[-1], crypt.METHOD_CRYPT)
60 crypt
62 crypt.METHOD_SHA256 in crypt.methods or crypt.METHOD_SHA512 in crypt.methods
67 for method in (crypt.METHOD_SHA256, crypt.METHOD_SHA512):
69 salt = crypt.mksalt(method, rounds=rounds)
73 cr = crypt.crypt('mypassword', salt)
75 cr2 = crypt.crypt('mypassword', cr)
79 crypt and crypt.METHOD_BLOWFISH in crypt.methods, 'requires support of Blowfish'
83 salt = crypt.mksalt(crypt.METHOD_BLOWFISH, rounds=1 << log_rounds)
85 self.assertIn(len(salt) - crypt.METHOD_BLOWFISH.salt_chars, {6, 7})
86 cr = crypt.crypt('mypassword', salt)
88 cr2 = crypt.crypt('mypassword', cr)
92 for method in (crypt.METHOD_SHA256, crypt.METHOD_SHA512,
93 crypt.METHOD_BLOWFISH):
95 crypt.mksalt(method, rounds='4096')
97 crypt.mksalt(method, rounds=4096.0)
100 crypt.mksalt(method, rounds=rounds)
102 crypt.mksalt(crypt.METHOD_BLOWFISH, rounds=1000)
103 for method in (crypt.METHOD_CRYPT, crypt.METHOD_MD5):
105 crypt.mksalt(method, rounds=4096)