Recovery of the original Blowfish P-table and Key from a known expanded P-table based on Richard Schroeppel’s report.pdf
Procedure for Recovery:
To recover the starting P (i.e., pi^KKKk), follow these steps:
- Set P17 and P18 to 0, and substitute A-D with the pi bits.
- Encrypt P15 and P16 using the modified P-table. XOR the resulting encryption with P17 and P18 to retrieve the original P17 and P18 values.
- Continue this process working backwards through the P-table, retrieving values for P13, P14, and so on.
- XOR away the pi-bits at each step to deduce the key fragment KKKk.
- From the recovered key fragments, select the longest consistent key as the correct K.
The code is based on the original Blowfish implementation: blowfish-koc.zip.
For license and usage information, please refer to the comments in the blowfish.c file.