You are on page 1of 10

Voice Encryption Project

The project: is to encrypt the voice and decrypting it using


hardware.

The main steps:


1. Take the voice from microphone.
2. Convert it to digital value.
3. Encrypt it using Encryption algorithm with secret key.
4. Send the voice to second site digitally.
5. The other site will receive the cipher (encrypted voice).
6. Using the encryption algorithm with secret key to
decrypt the voice.
7. Play it again.

Hardware used:
1. Two pic16F877.
for encryption and decryption operation.
2. Two DAC0808P.
For converting from digital to analog.
3. Microphone.
To take voice.
4. Band pass filter.
to get rid of un needed frequencies.
5. Four LM324 Op-amp.
To loud the voice and buffering.
6. LED bar and JAC connectors straight throw cable.
Make connection and show status.
The Project Stages:
The project passes through five stages the stages are-
1. Get voice from the microphone.
2. Sampling the voice.
3. Encrypt the voice using algorithm.
4. Synchronization between to two connected sites to
guarantee reliability.
5. Decryption the voice again.

1. Get the voice from microphone.


In this stage the voice is taken from microphone then
passing throw high pass filter with cut off frequency 70-80
Hz this stage is only to get ride of low frequency noises.
After that the signal pass throw pre-amplifier circuit in
order to amplify the voice with amplifying factor 10.

After this stage the voice become ready to amplifying it with


second stage amplifier circuit to make the voice signal
varies from 0-3.4 volt.
|low pass filter needed to get ride of high frequency with cut
off frequency 4 KHz.
After that Voice signal ready to second stage.

2. Sampling the voice.


After the first stage the voice signaling varies in its
magnitude between 0-3.4 volts. using PIC16F877 ADC to
convert the voice signal from analog to digital value in
order to process it.
Each analog value converted to digital value with ADC
bit resolution 10 bit with reference voltage 3.5 volt.
Voice samples varies between 0-1023. the sampling rate
8000 sample/second. We take more that this rate in order to
increase the voice quality.
3. Encrypt samples using Encryption algorithm with secret
key.
In this stage each sample encrypted with different sub
key.
In voice encryption stream cipher algorithm used to
encrypt. One time Pad algorithm with some changes is used.
This algorithm used initial key Ks to generate sub keys
using sub keys generator. Each sample ciphered with
different value (sub key) using simple XOR operation.
On the receiver site the same value (sub key) is used to
decrypt the sample.

The initial key (k) which is used for function generator


The function is k=((k*k)+1)%255;

The cipher :
Ci= Pi XOR k

4. Synchronization between to two connected sites to


guarantee reliability.
Synchronization between sender and receiver is an
important issue. Recoding to the encryption algorithm each
sample ciphered with different sub key on the sender site
the receiver must have the same value to decrypt the
original sample. You know that sender and receiver have
the same generator. If any ciphered packet lost it means
that the next ciphered packet will decrypt using wrong sub
key which makes the voice in receiver site unacceptable.

To make synchronize we use two control lines. One


return to the sender and the other to receiver as follows.
1. Before the sender transmits any packet it must check
receiver to be ready. If receiver ready means that control
line 1 is set else it is cleared.
2. After the sender transmits the packet it makes line
control 2 set.
3. Receiver accepts the first packet and set control line 1
during processing.
4. Receiver don’t generate new sub key until check sender
control line to be set. This means anew value had been
sent. This prevents receiver from reading the previous
value and treats it as new one.

5. Decryption the voice again.


Same algorithm used in the sender site is used in the
receiver site. Receiver must know the initial key to
generate the other sub keys. Again simple XOR operation
with the ciphered packet is done to get the original
packet.

Code for synchronization:


if ( (flag==1) && (! input(PIN_C5)) )
{

OUTPUT_D(mic);
output_low(PIN_C4);
flag=0;
break;

}
if ( (flag==0) && (input(PIN_C5)) )
{
OUTPUT_D(mic);
output_high(PIN_C4);
flag=1;
break;
Project circuit diagram using Orcad

Decryption Site
J1

H E A D E R 4 V B 1 J 2 H E A D E R 2
V D D V s s
V c c S U B - D 9

14

12
7

5
9
4
8
3
7
2
6
1
U 4

T 2O U T
T1O U T

R 1O U T
R 2O U T
4
3
2
1

I C L 2 3 2

1
2
0

R 1 IN
R 2 IN
T 1 IN
T 2 IN
R 9

C 1+

C 2+
C 1-

C 2-

V+
V-
2 . 5 k
R 1 0
C 1 7 0
11
10

13
8

1
3

4
5

2
6
2 . 5 k
J 4

11
9 - L M 3 2 4
1 0 8
2 1C u 1 2 V D D 1 0
C 1 0 C 1 1
+
3 V D D U 5 C
4
V D D

4
5
6 1 u
7 1 u 1 u R 1 5 0
J 5
8 1 k
R 1 3

16
2

2
1 U 3
8 H E A D E R D I O D E

IO U T

IO U T

C O M P
D A CC 0 8 8 0 8
D 1 2 . 5 k R 1 1
1 u 1 0 k
U 1 H E A D E R 2 R 1 4
2 1 5
3 R A 0 / A RN C0 0 / T 1 O S 1 O6 / T 1 C K I V s s
R A 1 / A NR 1 C 1 / T 1 O 1S 7I / C C P 2

VR +
4 R 1 2

VR -
R A 2 / A N 2 R C 2 / C 1 C8 P 1 2 . 5 k

8
7

4
3
6
5

2
1

V-
5 1 3 2 k

A
A
A
A
A
A
A
A
6 R A 3 / A N 3R / CV R3 / ES F C 2 K 3 / S C L V +
R A 4 / T O CR KC I 4 / S D 2 I 4/ S D A

12
11
10
9
8
7
6
5

14

15
3
7
R A 5 / A N 4 / SR S C 5 / S 2 D5 O
V D D 3 3 R C 6 / T 2X 6/ C K
3 4 R B O / I N T R C 7 / R X / D T V c c
3 5 R B 1 1 9
4 0 k R 1 3 6 R B 2 R D 0 / P 2 S0 P 0
3 7 R B 3 R D 1 / P 2 S1 P 1
3 8 R B 4 R D 2 / P 2 S2 P 2
C 3 3 9 R B 5 R D 3 / P 2 S7 P 3
S 1 0 C 1 3 4 0 R B 6 R D 4 / P 2 S8 P 4
1 u R B 7 R D 5 / P 2 S9 P 5
1 0 p R D 6 / P S0 P 6
M C L R X 1 1 3 3
9 . 8 3 0 4 M H z 1 4 O S C 1 / C L KR I DN 7 / P S P 7
C 1 4 O S C 2 / C L K O U T 8
R E 0 / R D9 / A N 5
0 0 1 0 p
1
M C L R / V PR P E 1 / W R1 0/ A N 6
0 R E 2 / C S / A N 7
1 1
2 V D D
G N D
G N D

3
V D D V D D
P I C 1 6 C 7 7
12
31

R 2
S 9
C 2
V D D
4 0 k 1 u
C 9
T i t l e
M C L 1R u
0 < T i t l e >

S iz e D o c u m e n t N u m b e r R e v
0 0 A < D o c > < R e v C o d e >

D a t e : T h u r s d a y , M a y S1 8h ,e e2 t01 0 6 o f 1
Encryption Site

J1
H E A D E R 4 V B 1 J 2 H E A D E R 2
V D D V s s
V c c S U B - D 9

14

12
7

5
9
4
8
3
7
2
6
1
J 3 H E A D E R 2 U 4

T1O U T
T 2O U T

R 2O U T
R 1O U T
4
3
2
1
I C L 2 3 2

1
2
0

R 2 IN
R 1 IN
T 1 IN
T 2 IN
1
2

R 9

C 1+

C 2+
C 1-

C 2-

V+
V-
2 . 5 k
R 1 0
C 1 7 0

11
10

13
R 7

1
3

4
5

2
6
2 . 5 k

11
0
9 L M 3 2 4
0
-
11

1 k R 8 8
- 6 1C u 1 2 V D D 1 0 +
C 1 0 C 1 1 V D D
7 U 2 C
+ 5 1 k
V D D

4
V D D L M 3 2 4 1 u
1 u 1 u 0
4

U 2 B R 1 5
J 5
C 1 6 1 k
U 2 A 0
4

R 1 3

16
3 R 6 2

2
+
1 0 n 1 1 U 3
D I O D E

C O M P
IO U T

IO U T
R 5 2 - D A CC 0 8 8 0 8
1 k R 4 1 k D 1 2 . 5 k R 1 1
1 u 1 0 k
H E A D E R 2
11

L M 3 2 4 C 1 5 U 1 R 1 4
1 k R 3 2 1 5
1 u 3 R A 0 / A RN C0 0 / T 1 O S 1 O6 / T 1 C K I V s s
R A 1 / A NR 1 C 1 / T 1 O S1 7I / C C P 2

VR +
0 4 R 1 2

VR -
R A 2 / A N 2 R C 2 / C 1 C8 P 1 2 . 5 k

1
8
7

3
2
2 . 5 k 5 1 3 3 2 k

A
A
A
A
A
A
A
A
6 R A 3 / A N 3R / CV R3 / ES FC 2 K 3 / S C L V + V -
R A 4 / T O CR KC I 4 / S D 2 I 4/ S D A

12
11
10
9
8
7
6
5

14

15
0 7
R A 5 / A N 4 / SR S C 5 / S 2 D5 O
V D D R C 6 / T 2X 6/ C K J 4
3 3
3 4 R B O / I N T R C 7 / R X / D T V c c
3 5 R B 1 1 9 8
4 0 k R 1 3 6 R B 2 R D 0 / P 2 S0 P 0 7
3 7 R B 3 R D 1 / P 2 S1 P 1 6
3 8 R B 4 R D 2 / P 2 S2 P 2 5
C 3 3 9 R B 5 R D 3 / P 2 S7 P 3 4
S 1 0 C 1 3 4 0 R B 6 R D 4 / P 2 S8 P 4 3
1 u R B 7 R D 5 / P 2 S9 P 5 2
1 0 p R D 6 / P S0 P 6
M C L R X 1 1 3 3 1
9 . 8 3 0 4 M H z 1 4 O S C 1 / C L KR I ND 7 / P S P 7
C 1 4 O S C 2 / C L K O U T 8
R E 0 / R D9 / A N 5
0 0 0 1 0 p
1
M C L R / V PR P E 1 / W R1 0/ A N 6 8 H E A D E R
1 1 R E 2 / C S / A N 7
2 V D D
G N D
G N D

3
V D D V D D
P I C 1 6 C 7 7
12
31

R 2
S 9
C 2
V D D
4 0 k 1 u
C 9
M C L 1R u
0

0 0

Project Layout:
Using EasyPC layout to draw the print circuit layout for sender
and receiver.
Receiver layout
Sender layout

Advantages:
Encrypting voice is useful for using in unsecured channel. You
can encrypt your voice no one can decrypt it because of the
following:
1. Need the initial key or seed key.
2. The algorithm it self which used to encrypt.
3. The sample rate which is a big problem.
Another advantage that sender and receiver use the same algorithm
structure for ciphering and deciphering.

You might also like