コード例 #1
0
ファイル: test_camcrypt.py プロジェクト: gtback/camcrypt
 def test_quick_init(self):
     key="\x80" + "\x00" * 15
     c = CamCrypt(keylen=128, key=key)
     expected = "6c227f749319a3aa7da235a9bba05a2c"
     self.assertEqual(expected, c.encrypt(ZERO_BUF).encode("hex"))
コード例 #2
0
ファイル: test_camcrypt.py プロジェクト: gtback/camcrypt
 def test_decrypt_block(self):
     c = CamCrypt()
     c.keygen(128, "\x80" + "\x00" * 15)
     encrypted = "6c227f749319a3aa7da235a9bba05a2c".decode("hex")
     self.assertEqual(ZERO_BUF, c.decrypt_block(encrypted))
コード例 #3
0
ファイル: test_camcrypt.py プロジェクト: gtback/camcrypt
 def test_errors(self):
     c = CamCrypt()
     c.keygen(128, "\x80" + "\x00" * 15)
     self.assertRaises(ValueError, c.encrypt_block, 'a')
コード例 #4
0
ファイル: test_camcrypt.py プロジェクト: gtback/camcrypt
 def test_encrypt_block(self):
     c = CamCrypt()
     c.keygen(128, "\x80" + "\x00" * 15)
     expected = "6c227f749319a3aa7da235a9bba05a2c"
     self.assertEqual(expected, c.encrypt_block(ZERO_BUF).encode("hex"))