-- Edit 2 ---
This question is different from Connect STM32 BLUEPILL to the TRRS connector on the computer
But just in case for not falling into double posting I deleted that post. (This post hes more explanation on what I try to do , on the actual hardware setup, and the answer here will be a lot more useful for the coming after me then the old post , so I deleted the old one so this one will be the main one.)
I hope this o.k. , if not please tell me in comments and I will restore the old post back (even do on my opinion he wasn't helpful or elaborate as this one).
-- Edit ---
This project is for learning purposes, I know that voice over Bluetooth is already encrypted, and there is a few outer off the shelf voice encryption, I don't need to encrypt voice , I want to encrypt voice my self for learning purposes.
I am very grateful to anyone who helped and helps and answers my questions. It helps me to learn and move forward.
Although in the question I'm talking about encryption but does a simple xor with constant value, I know that this is not a real encryption, it is only for the example. (Because if we assume that it is possible to do this simple xor, there is nothing that prevents me from performing proper stream cipher encryption (I assume that I will be able to establish a key using some protocol at this stage in some way, I will actually solve the protocol issue when I will be there...))
I want to encrypt a voice that goes over the TRRS headset.
xor 0x19 for the example) and on the other side will have another earphone that will receive the information (again via standard TRRS connection) decode it (in our example
xor 0x19) and play it.
The way I thought to implement the idea was to connect the headset with
STM32 Blue pill or
TEENSY 3.2 or similar cheap board, within the microcontroller to perform the encryption and then send the encrypted information away through another TRRS.
On the other side repeat the same idea when this time the microcontroller decodes the data before passing the information to the second TRRS.
In another question I asked here I have been told that this is not the right way to go because I will have severe synchronization problems and because I won't sample the same "byte" twice because of synchronization problems and other problems so I will get different results that will make everything screw.
What is the right way to make such an idea work?