def xor_encrypt_decrypt(message: str, key: int) -> str:
	return ''.join(chr(ord(c) ^ key) for c in message)

# Message original
message = "HELLO"
key = 42 # Clé secrète partagée

# Chiffrement
ciphertext = xor_encrypt_decrypt(message, key)
print("Chiffré :", ciphertext)

# Déchiffrement
decrypted = xor_encrypt_decrypt(ciphertext, key)
print("Déchiffré :", decrypted)
