audio code to sync two audrino

As my college project i am making a voice encryption decryption system.

The encoder side encrypts voice and sends to decoder side. Encryption is such that at encoder side... Audio codec is taking 16 bit samples at 8kbps and giv8ng to audrino for encryption.... It encodes it wit with key 1 and sends to output audio codec wjich converts it to sound and we have realtimeencrypted audio. The catch is that every sample is encoded with separate key. Sample 1 with key 1 Sample 2 with key 2 Sample 3 with key 3 Sample 4 wuth key 4 And so on.....

So at decoder side the decryption should start exactly when sample 1 reached so that key 1 devodes it.... It is followed by sample 2 which is decoded by key 2.... And so on...

These keys are generated by a key generator... So the key generator needs to know when the first sample has arrived so that it can start its key generation..... Key 1 followed by key 2... Followed by key 3 and so on..

One way to do this is so send a tone signal before sending the encrypted sound which is detected at decoder side and marks the start of key generation....

This is where i am stuck..... Need a code which generates a tone signal.... And a code which can detect this tone at decoder to SYNC the encoder and decoder...

Help plz.

Cross-post. Thread locked. Please answer any questions here