-
Notifications
You must be signed in to change notification settings - Fork 9
Blowfish cipher
🚧 This page is a work in progress
Blowfish is a symmetric cipher algorithm that works in block sizes of 8 bytes. The encrypted and decrypted data is always the of the same length. It is used to decrypt V_CODEs and KIF Archive entries/entry data, encrypt Key Files, and presumably more...
Important Note: Setting the key for a Blowfish cipher is much more expensive than the decryption process. It's highly recommend you keep a copy of your seeded Blowfish class handy so that you do not need to set the key every time.
Because Blowfish works in blocks of 8 bytes, the cipher may only decrypt lengths of bytes that are divisible by 8.
- For KIF Archives, any remaining bytes are not passed when decrypted.
- For V_CODEs, the V_CODE data buffer size must be rounded up to the next 8 bytes in size. (with zero-padding)
The initial values of the Blowfish cipher are the HEX digits of pi in order, from the start of the passes array (PArray
) to the end of the substitution boxes (SBlocks
).
The exposed class structure during code samples using Blowfish will look as such:
class Blowfish {
// Constructs and initializes a blowfish cipher with the specified key
public Blowfish(byte[] key);
// Set the new key for the blowfish cipher
void SetKey(byte[] key);
// Encrypt/Decrypt the buffer and output to the same buffer
public void Encrypt(byte[] buffer);
public void Decrypt(byte[] buffer);
}