Ejemplo n.º 1
0
 def test_pbkdf2_1round_sha1(self):
     # XP
     p = "732f73394364c930ba285063e5ff1ae49ebb3332"
     s = "2dd1662578e68d982e18f362452d448a"
     i = 1
     r = "b49f149f5dca24e46025fcc2fb8af8a6a19c849c7b61fcc5533c841f6eb10d8b"
     self.assertEquals(crypto.pbkdf2(p.decode("hex"), s.decode("hex"), len(r) / 2, i), r.decode('hex'))
Ejemplo n.º 2
0
 def test_pbkdf2_4000round_sha1(self):
     # XP
     p = "732f73394364c930ba285063e5ff1ae49ebb3332"
     s = "a432a7fe84cc5ff921eddfb645d22efc"
     i = 4000
     r = "0cb271e155eb6fd2f9c50e1c941a248d4a1d8b1cb765e0cdb8f80e144d3dfb03"
     self.assertEquals(crypto.pbkdf2(p.decode("hex"), s.decode("hex"), len(r) / 2, i), r.decode('hex'))
Ejemplo n.º 3
0
 def test_pbkdf2_4000round_sha1(self):
     # XP
     p = "732f73394364c930ba285063e5ff1ae49ebb3332"
     s = "a432a7fe84cc5ff921eddfb645d22efc"
     i = 4000
     r = "0cb271e155eb6fd2f9c50e1c941a248d4a1d8b1cb765e0cdb8f80e144d3dfb03"
     self.assertEquals(crypto.pbkdf2(p.decode("hex"), s.decode("hex"), len(r) / 2, i), r.decode('hex'))
Ejemplo n.º 4
0
 def test_pbkdf2_1round_sha1(self):
     # XP
     p = "732f73394364c930ba285063e5ff1ae49ebb3332"
     s = "2dd1662578e68d982e18f362452d448a"
     i = 1
     r = "b49f149f5dca24e46025fcc2fb8af8a6a19c849c7b61fcc5533c841f6eb10d8b"
     self.assertEquals(crypto.pbkdf2(p.decode("hex"), s.decode("hex"), len(r) / 2, i), r.decode('hex'))
Ejemplo n.º 5
0
 def test_pbkdf2_4000round_sha1(self):
     # XP
     p = binascii.unhexlify("732f73394364c930ba285063e5ff1ae49ebb3332")
     s = binascii.unhexlify("a432a7fe84cc5ff921eddfb645d22efc")
     i = 4000
     r = binascii.unhexlify(
         "0cb271e155eb6fd2f9c50e1c941a248d4a1d8b1cb765e0cdb8f80e144d3dfb03")
     self.assertEquals(crypto.pbkdf2(p, s, len(r), i), r)
Ejemplo n.º 6
0
 def test_pbkdf2_1round_sha1(self):
     # XP
     p = binascii.unhexlify("732f73394364c930ba285063e5ff1ae49ebb3332")
     s = binascii.unhexlify("2dd1662578e68d982e18f362452d448a")
     i = 1
     r = binascii.unhexlify(
         "b49f149f5dca24e46025fcc2fb8af8a6a19c849c7b61fcc5533c841f6eb10d8b")
     self.assertEquals(crypto.pbkdf2(p, s, len(r), i), r)
Ejemplo n.º 7
0
 def test_pbkdf2_5600round_sha512(self):
     # win7
     p = "84e40ab5bab2c5a2965fd185d60cf92fe2c1c9d2".decode("hex")
     s = "1f63ff38751365ec54748b13d962698e".decode("hex")
     i = 5600
     r = ("38d34e6a81f8d5f650403d01407e3127"
          "f987f986328ed9c1aacd527811dd53ac"
          "5a7b8d298e37e377daa03a3ee209e638").decode("hex")
     self.assertEquals(crypto.pbkdf2(p, s, len(r), i, 'sha512'), r)
Ejemplo n.º 8
0
 def test_pbkdf2_5600round_sha512(self):
     # win7
     p = "84e40ab5bab2c5a2965fd185d60cf92fe2c1c9d2".decode("hex")
     s = "1f63ff38751365ec54748b13d962698e".decode("hex")
     i = 5600
     r = ("38d34e6a81f8d5f650403d01407e3127"
          "f987f986328ed9c1aacd527811dd53ac"
          "5a7b8d298e37e377daa03a3ee209e638").decode("hex")
     self.assertEquals(crypto.pbkdf2(p, s, len(r), i, 'sha512'), r)