/// <summary> /// Blowfish is a keyed, symmetric block cipher, designed in 1993 by Bruce Schneier and included in a large /// number of cipher suites and encryption products. Blowfish provides a good encryption rate in software and no /// effective cryptanalysis of it has been found to date. However, the Advanced Encryption Standard now receives /// more attention. Schneier designed Blowfish as a general-purpose algorithm, intended as an alternative to the /// aging DES and free of the problems and constraints associated with other algorithms. Schneier has stated that, /// "Blowfish is unpatented, and will remain so in all countries. The algorithm is hereby placed in the public /// domain, and can be freely used by anyone." The implementation type in use is CFB64. /// </summary> public BlowfishCipher() { _encryptionLock = new object(); _decryptionLock = new object(); _encryptionIncrementor = 0; _decryptionIncrementor = 0; _encryptionIV = (byte *)NativeFunctionCalls.malloc(BF_BLOCK_SIZE); _decryptionIV = (byte *)NativeFunctionCalls.malloc(BF_BLOCK_SIZE); NativeFunctionCalls.memset(_encryptionIV, 0, BF_BLOCK_SIZE); NativeFunctionCalls.memset(_decryptionIV, 0, BF_BLOCK_SIZE); KeySchedule(InitialKey); }