You

advertisement
Voice Encryption Project
The project: is to encrypt the voice and decrypting it using
hardware.
The main steps:
1.
2.
3.
4.
5.
6.
Take the voice from microphone.
Convert it to digital value.
Encrypt it using Encryption algorithm with secret key.
Send the voice to second site digitally.
The other site will receive the cipher (encrypted voice).
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:
1.
2.
3.
4.
5.
The project passes through five stages the stages areGet voice from the microphone.
Sampling the voice.
Encrypt the voice using algorithm.
Synchronization between to two connected sites to
guarantee reliability.
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
J1
Decryption Site
HEADER 4
HEADER 2
J2
SUB-D 9
1
2
U4
ICL232
R1OUT
R2OUT
4
3
2
1
T1OUT
T2OUT
5
9
4
8
3
7
2
6
1
Vcc
12
9
Vss
14
7
VB1
VDD
V+
V-
1
2
3
4
5
6
7
8
VDD
C11
VDD
1u
33
34
35
36
37
38
39
40
R1
C3
S10
C13
1u
MCLR
10p
X1
9.8304MHz
13
14
C14
0
0
0
1
10p
11
32
R2
S9
C2
40k
C9
16
U3
C8
DAC0808
COMP
2
4
DIODE
D1
2.5k
R11
10k
1u
VRV-
VR+
Vss
R12
2k
2.5k
15
3
V+
14
13
A8
A7
A6
A5
A4
A3
A2
A1
R14
15
16
17
18
23
24
25
26
12
11
10
9
8
7
6
5
RA0/AN0
RC0/T1OSO/T1CKI
RA1/AN1
RC1/T1OSI/CCP2
RA2/AN2
RC2/CCP1
RA3/AN3/VREF RC3/SCK/SCL
RA4/TOCKI
RC4/SDI/SDA
RA5/AN4/SS
RC5/SDO
RC6/TX/CK
RBO/INT
RC7/RX/DT
RB1
RB2
RD0/PSP0
RB3
RD1/PSP1
RB4
RD2/PSP2
RB5
RD3/PSP3
RB6
RD4/PSP4
RB7
RD5/PSP5
RD6/PSP6
OSC1/CLKIN
RD7/PSP7
OSC2/CLKOUT
RE0/RD/AN5
MCLR/VPP
RE1/WR/AN6
RE2/CS/AN7
VDD
VDD
12
31
VDD
0
Vcc
19
20
21
22
27
28
29
30
8
9
10
GND
GND
VDD
U5C
R13
HEADER 2
U1
40k
IOUT
2
1
2
3
4
5
6
7
LM324
8
R15
1k
J5
IOUT
1u
9
10
VDD
1u
8 HEADER
PIC16C77
VDD
1u
Title
MCLR
0
0
C12
1u
C10
11
J4
2.5k
4
C2+
C2-
2
6
C1+
C11
3
4
5
R1IN
R2IN
13
8
2.5k
R10
0
+
11
10
R9
C17
-
T1IN
T2IN
0
1u
0
<Title>
0
Size
A
Date:
Document Number
<Doc>
Thursday , May 18, 2006
Rev
<Rev Code>
Sheet
1
of
1
J1
Encryption Site
HEADER 4
HEADER 2
J2
SUB-D 9
1
2
U4
ICL232
R1OUT
R2OUT
4
3
2
1
HEADER 2
J3
T1OUT
T2OUT
5
9
4
8
3
7
2
6
1
Vcc
12
9
Vss
14
7
VB1
VDD
VDD
33
34
35
36
37
38
39
40
R1
C3
S10
C13
1u
10p
MCLR
X1
9.8304MHz
13
14
C14
0
0
0
1
10p
11
32
R2
S9
C2
40k
C9
MCLR
0
1u
V+
V-
C2+
C2-
11
2
6
C1+
C11
3
4
5
R1IN
R2IN
12
31
VDD
16
COMP
2
13
V+
VR-
R14
15
16
17
18
23
24
25
26
V-
R11
10k
Vss
3
2.5k
R12
2k
15
0
RA0/AN0
RC0/T1OSO/T1CKI
RA1/AN1
RC1/T1OSI/CCP2
RA2/AN2
RC2/CCP1
RA3/AN3/VREF RC3/SCK/SCL
RA4/TOCKI
RC4/SDI/SDA
RA5/AN4/SS
RC5/SDO
RC6/TX/CK
RBO/INT
RC7/RX/DT
RB1
RB2
RD0/PSP0
RB3
RD1/PSP1
RB4
RD2/PSP2
RB5
RD3/PSP3
RB6
RD4/PSP4
RB7
RD5/PSP5
RD6/PSP6
OSC1/CLKIN
RD7/PSP7
OSC2/CLKOUT
RE0/RD/AN5
MCLR/VPP
RE1/WR/AN6
RE2/CS/AN7
VDD
VDD
2.5k
1u
HEADER 2
U1
2
3
4
5
6
7
U3
C8
DAC0808
VR+
C15
2.5k
40k
DIODE
D1
R13
14
LM324
1u
0
2
1
1k
R3
0
12
11
10
9
8
7
6
5
1k
U2C
R15
1k
IOUT
R6
1
LM324
8
J4
Vcc
19
20
21
22
27
28
29
30
8
9
10
8
7
6
5
4
3
2
1
8 HEADER
GND
GND
-
1u
J5
4
4
+
2
1u
0
9
10
VDD
1u
U2A
11
R4
1k
LM324
U2B
4
R5
1k
VDD
IOUT
+
3
10n
VDD
C11
A8
A7
A6
A5
A4
A3
A2
A1
-
C16
C10
2.5k
0
C12
1u
6
5
0
4
11
R8
7
VDD
13
8
11
10
1
2
1k
2.5k
R10
+
R7
0
R9
C17
-
T1IN
T2IN
0
PIC16C77
VDD
1u
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.
Download