You are on page 1of 2

Report #1

Implementation of Blowfish Algorithm

Abdul Waqeel, Farhan Khan, and Waleed Khan from the Department of Communication System
Engineering of National University of Science and Technology, Islamabad
for operations. The signal is passed through an Analog to
Abstract— In this report we have implemented blowfish Digital converter for this purpose. The output of the signal is
algorithm’s encryption. In this report we’ll discuss the a Digital signal which is ready for encryption. The digital
encryption method we followed in our project. form of the base band signal is shown in fig.2.

B lowfish is a block cipher which uses a key which varies

up to 448 bits. As said above it is a fiestal network, it
uses a simple encrypting function and repeats it 16 times. It
also uses 64-bit block size. It keeps two sub keys: 18-entry P-
array and four 256-entry S-boxes The S-boxes accept a 8-bit
input and gives a 32-bit output. 1 entry of P-array is used
after every round and passed through the fiestal network and
after final round; each half of the data block is XORed with
one of the two remaining unused P-entries as shown in fig.1
Fig.2 shows the implementation of the fiestal function. It
splits the input 32-bits value to four 8-bit values which are
then passed as inputs to the S-boxes and then their outputs
are added to modulus of 232 to get the final output of 32-bits.
For Decryption the same process is reversed. The most
common and basic mistake while decrypting is using it in
inverse order i.e. taking XOR of P18 and P17 entries with the
text block and then using the P-entries in reverse order.
The P-array and S-boxes are initialized by hexadecimal Fig.2 shows the signal when converted from analog to digital
values of (pi) at the start. These values have no pattern. A 64- from,
bit zero blocks is encrypted and so the values of P1, P2 are
entered. This process continues 521 times until all sub keys
The digital signal is passed through the encrypter. To encrypt
are generated and 4KB of data is processed during the whole
the signal we first XORed the generated key with the first
sample of the signal, the result is stored in a temporary
variable. Then the value of the same sample is XORed with
II.ENCRYPTION PROCESS the fiestal function of the system. When both values are
Fig.1 shows a base band signal in analog form, obtained, they are swapped and this process is repeated for
rest of the values of the fiestal and the generated key. When
the process finishes, the resultant values are stored in the new
ENCRYPTED SIGNAL. This process continues until all
values of the signal are encrypted. The encrypted signal in
digital form is shown in fig.3 with sample rate Ts=1.

Fig.1 Base Band

The base band signal is input to the system shown in fig.1.

Signal to be encrypted is first converted to its Digital form

Report #1

Fig.3 encrypted signal Ts=1

This encrypted signal is converted back to its analog form by

a Discrete to analog converter for transmission over a link.
The analog form of the signal is shown in the fig.4