<commit_before>from Crypto.Protocol.KDF import PBKDF1
from Crypto.Cipher import AES
from Crypto import Random

from aes import encode_message, decode_message


# Test to check if pycrypto is working well
def test_pycrypto_aes():
    prng = Random.new()
    key = prng.read(16)
    iv = prng.read(AES.block_size)

    assert len(iv) == 16
    assert len(key) == 16

    cipher = AES.new(key, AES.MODE_CFB, iv)

    # Assert result is a multiple of 16
    assert len(cipher.encrypt('Test Text')) % 16 == 0


def test_integrity():
    key = PBKDF1('Password1', '<PASSWORD>', 16)
    plaintext = 'Test Text'

    # Ensure that E(k, D(k, p)) == p
    assert decode_message(key, encode_message(key, plaintext)) == plaintext<commit_msg>Removed useless test (Due to using CFB)<commit_after>from Crypto.Protocol.KDF import PBKDF1
from Crypto.Cipher import AES
from Crypto import Random

from aes import encode_message, decode_message


def test_integrity():
    key = PBKDF1('Password1', '<PASSWORD>', 16)
    plaintext = 'Test Text'

    # Ensure that E(k, D(k, p)) == p
    assert decode_message(key, encode_message(key, plaintext)) == plaintext
{'fraction_non_alphanumeric': 0.11159929701230228, 'fraction_numerical': 0.01845342706502636, 'mean_word_length': 4.0176211453744495, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6493555', 'n_tokens_mistral': 410, 'n_tokens_neox': 377, 'n_words': 117}