# BR-STO-07

Quand la clé de chiffrement ne fait pas 16, 24 ou 32 octets une fois décodée du base64, alors la construction échoue avec InvalidKeyLengthError.

Défini dans [Stocker les conversations et protéger les traces](https://docs.piighost.dev/fr/domain/operations/storage-and-encryption/#br-sto-07).

## Où vit la règle

- [`AesGcmCipher.__init__()`](https://github.com/Athroniaeth/piighost/blob/master/src/piighost/crypto/cipher/aesgcm.py#L46)

## Tests directs

- [`tests/acceptance/test_ops.py::TestSharedMemory::test_two_instances_agree_on_a_thread`](https://github.com/Athroniaeth/piighost/blob/master/tests/acceptance/test_ops.py#L59)
- [`tests/conversation_memory/test_redis.py::TestAtRestProtection::test_detections_are_encrypted_at_rest`](https://github.com/Athroniaeth/piighost/blob/master/tests/conversation_memory/test_redis.py#L159)
- [`tests/conversation_memory/test_redis.py::TestAtRestProtection::test_message_text_is_not_stored_in_any_key`](https://github.com/Athroniaeth/piighost/blob/master/tests/conversation_memory/test_redis.py#L148)
- [`tests/conversation_memory/test_redis.py::TestBatchingAndAtomicity::test_concurrent_identical_remembers_do_not_duplicate`](https://github.com/Athroniaeth/piighost/blob/master/tests/conversation_memory/test_redis.py#L64)
- [`tests/conversation_memory/test_redis.py::TestBatchingAndAtomicity::test_union_reads_in_a_single_mget`](https://github.com/Athroniaeth/piighost/blob/master/tests/conversation_memory/test_redis.py#L46)
- [`tests/conversation_memory/test_redis.py::TestConformance::test_satisfies_the_port`](https://github.com/Athroniaeth/piighost/blob/master/tests/conversation_memory/test_redis.py#L37)
- [`tests/conversation_memory/test_redis.py::TestForget::test_forget_leaves_other_threads`](https://github.com/Athroniaeth/piighost/blob/master/tests/conversation_memory/test_redis.py#L137)
- [`tests/conversation_memory/test_redis.py::TestForget::test_forget_purges_and_reports`](https://github.com/Athroniaeth/piighost/blob/master/tests/conversation_memory/test_redis.py#L124)
- [`tests/conversation_memory/test_redis.py::TestForget::test_forget_unknown_thread_reports_nothing`](https://github.com/Athroniaeth/piighost/blob/master/tests/conversation_memory/test_redis.py#L132)
- [`tests/conversation_memory/test_redis.py::TestGetDetections::test_clean_message_is_a_hit_with_no_detections`](https://github.com/Athroniaeth/piighost/blob/master/tests/conversation_memory/test_redis.py#L89)
- [`tests/conversation_memory/test_redis.py::TestGetDetections::test_overwriting_a_message_does_not_duplicate_in_union`](https://github.com/Athroniaeth/piighost/blob/master/tests/conversation_memory/test_redis.py#L103)
- [`tests/conversation_memory/test_redis.py::TestGetDetections::test_round_trip_for_a_message`](https://github.com/Athroniaeth/piighost/blob/master/tests/conversation_memory/test_redis.py#L77)
- [`tests/conversation_memory/test_redis.py::TestGetDetections::test_union_in_first_seen_order`](https://github.com/Athroniaeth/piighost/blob/master/tests/conversation_memory/test_redis.py#L95)
- [`tests/conversation_memory/test_redis.py::TestGetDetections::test_unknown_message_is_a_miss`](https://github.com/Athroniaeth/piighost/blob/master/tests/conversation_memory/test_redis.py#L84)
- [`tests/conversation_memory/test_redis.py::TestProvenance::test_default_role_is_user`](https://github.com/Athroniaeth/piighost/blob/master/tests/conversation_memory/test_redis.py#L180)
- [`tests/conversation_memory/test_redis.py::TestProvenance::test_records_first_occurrence_role`](https://github.com/Athroniaeth/piighost/blob/master/tests/conversation_memory/test_redis.py#L171)
- [`tests/conversation_memory/test_redis.py::TestProvenance::test_unknown_thread_has_no_provenance`](https://github.com/Athroniaeth/piighost/blob/master/tests/conversation_memory/test_redis.py#L186)
- [`tests/conversation_memory/test_redis.py::TestThreadIsolation::test_threads_do_not_leak`](https://github.com/Athroniaeth/piighost/blob/master/tests/conversation_memory/test_redis.py#L113)
- [`tests/conversation_memory/test_sqlalchemy.py::TestCrypto::test_encrypted_round_trip`](https://github.com/Athroniaeth/piighost/blob/master/tests/conversation_memory/test_sqlalchemy.py#L128)
- [`tests/crypto/cipher/test_aesgcm.py::TestUsableWhenInstalled::test_ciphertext_hides_the_plaintext`](https://github.com/Athroniaeth/piighost/blob/master/tests/crypto/cipher/test_aesgcm.py#L23)
- [`tests/crypto/cipher/test_aesgcm.py::TestUsableWhenInstalled::test_conforms_to_the_port`](https://github.com/Athroniaeth/piighost/blob/master/tests/crypto/cipher/test_aesgcm.py#L10)
- [`tests/crypto/cipher/test_aesgcm.py::TestUsableWhenInstalled::test_encryption_is_randomized`](https://github.com/Athroniaeth/piighost/blob/master/tests/crypto/cipher/test_aesgcm.py#L29)
- [`tests/crypto/cipher/test_aesgcm.py::TestUsableWhenInstalled::test_round_trip_restores_plaintext`](https://github.com/Athroniaeth/piighost/blob/master/tests/crypto/cipher/test_aesgcm.py#L16)
- [`tests/crypto/cipher/test_aesgcm.py::TestUsableWhenInstalled::test_tampered_ciphertext_is_rejected`](https://github.com/Athroniaeth/piighost/blob/master/tests/crypto/cipher/test_aesgcm.py#L36)
- [`tests/crypto/cipher/test_aesgcm.py::TestUsableWhenInstalled::test_wrong_key_length_is_rejected`](https://github.com/Athroniaeth/piighost/blob/master/tests/crypto/cipher/test_aesgcm.py#L48)

## Tests indirects

Aucun test indirect trouvé.

## Utilisé par

Aucun appelant trouvé.

Lu dans le graphe du code que construit graphify, aux emplacements que donne la documentation métier.
