## 4 Proposed Blowfish Hybridized Weight Attribute-Based Encryption
### Algorithm Level Operations  
Blowfish is a symmetric encryption algorithm [29]. It consists of a single key that is used for both encryption and decryption process. This blowfish encryption scheme's secret key ranges from 32 to 448 bits. If the range of key is 448 bits, then it needs 2448 groupings to define all the entire keys. Furthermore, this key has a fixed 64-bit block size with variable-length key block cipher. The cipher is a 16-round Feistel network, which uses password-dependent S-boxes to develop the structure by which the encryption and decryption process has taken place. This cipher divides messages into 64 bits blocks and then encrypts them separately.  
The algorithm possesses two main sub-key groups, namely, the 18-entry P-boxes (permutation boxes) to perform bit-shuffling and four 256-entry S-boxes (substitution boxes) to perform simple nonlinear functions. Here, the S-boxes receive 8-bit as input and yield 32-bit output. The working principle of a single blowfish round is shown in Figure 2. The function \(F\) is the Feistel Function of Blowfish that splits half the 32-bit block in 8-bit chunks (quarters) and employs this quarter as input to the S-box. Subsequently, the outcomes of S-boxes are supplemented with the dropped carry, consequential in MOD 232 addition, and finally XOR operation has been performed. Conversely, the decryption process has been carried out by reversing the blowfish algorithm and is simply done by inverting \(P_{17}\) and \(P_{18}\) cipher blocks as well as by employing the \(P\)-entries in reverse order. Blowfish algorithm is generally divided into two sections, namely key-expansion and data encryption.  
Key-expansion: In the Key expansion part, a 448-bit key is converted into numerous sub-key groups of 4168 bytes in aggregate. Normally, P-array is composed of 18 and 32-bit sub-keys (\(P_{1},P_{2},\ldots\ldots\ldots P_{18}\)) and four 32-bit S-Boxes, each containing 256 entries.  
The procedures that involved in the key expansion process are given as follows:  
1. Set and Initialize S-box and P-box with values from the hexadecimal numbers of pi (<initial 3)
2. The variable length of the user input key is \(XOR^{ed}\) with the P-entries until the entire P-array has been \(XOR^{ed}\) with input key bits.
3. A block of zeroes is encrypted; subsequently the results are applied for P\({}_{1}\) and P\({}_{2}\) entries.
4. Again, encrypt the ciphertext obtained from the encrypted zero block, then utilize for P\({}_{3}\) and P\({}_{4}\).
5. Continue the process till each P-box entry and the S-box entry have been exchanged thus; totally, 521 iterations are necessary to generate all the essential sub-keys (i.e., 521 key generations).  
Data-Encryption: Data encryption is carried out through 16 rounds. Further, each round performs key-based permutation and a key- and data-based replacement using XORs. Moreover, the addition operation (four indexed array data lookup tables) is performed on 32-bit words. Blowfish sums up all these features into a proficient and a dominant algorithm and it is illustrated below.  
\begin{tabular}{l} \hline \hline Blowfish Encryption Algorithm \\ \hline
**Input:**\(Y\) \\
**Output:** Recombined \(Y\) \\ Splits \(Y\) into 2, 32-bit halves: \(Y_{l},Y_{r}\) \\
**For**\(i=1\) to 16 \\ \(Y_{l}=y_{l}\ XOR\ P_{l}\) \\ \(Y_{r}=F(y_{l})\ XOR\ Y_{r}\) \\
**Swap**\(y_{l}\) and \(Y_{r}\) (Undo the last swap) \\ \(Y_{r}=Y_{r}\ XOR\ P_{l7}\) \\ \(Y_{l}=Y_{l}\ XOR\ P_{18}\) \\
**Recombine**\(Y_{l}\) and \(Y_{r}\) \\
**End** \\ \hline \hline \end{tabular}  
The high optimisms and large assurances afforded by the blowfish algorithm produced much activity regarding a potential cryptanalysis.