def test_backward_compatibility_sym_decrypt_cfb_128(self): # sym_encrypt_cfb_128('secret', 'something nobody knows') git@f6688dde6 crypt = { 'aes_iv_64': b'azm8m1zKYDQ/uuCGzqxMGA==', 'ciphertext_64': b'1n3rGiH4AXBQyz4EGT6+0ruhf3ev9A==', 'hmac_algo': 'sha256', 'hmac_hex': 'ef849dedefc26b45c1d13cd50de5487159f9af9fccf987318217491f47287588', 'kdf_algo': 'PBKDF2', 'kdf_iter': 1, 'kdf_salt_64': b'J0E0RKe0r+w=' } self.assertEqual( force_text(sym_decrypt_cfb_dict('secret', crypt)), 'something nobody knows' )
def test_crypto_dict_roundtrip(self): crypt = sym_encrypt_cfb_128('secret', 'sauce') self.assertEqual(force_text(sym_decrypt_cfb_dict('secret', crypt)), 'sauce')