Blowfish
Blowfish and Blowfish 2 Encryption Algorithm Implementation in CPP.
Install / Use
/learn @avinal/BlowfishREADME
Blowfish and Blowfish2 Encryption Algorithm
Blowfish is a symmetric block cipher that can be used as a drop-in replacement for DES or IDEA. It takes a variable-length key, from 32 bits to 448 bits, making it ideal for both domestic and exportable use. Blowfish was designed in 1993 by Bruce Schneier as a fast, free alternative to existing encryption algorithms. Since then it has been analyzed considerably, and it is slowly gaining acceptance as a strong encryption algorithm. Blowfish is not patented and license-free, and is available free for all uses.
Blowfish 2 was released in 2005. It has exactly the same design but has twice as many S tables and uses 64-bit integers instead of 32-bit integers. It no longer works on 64-bit blocks but on 128-bit blocks like AES. 128-bit block, 64 rounds, key up to 4224 bits.
About this project
This is a C++ implementation of the encryption algorithm.
How to use this in your project?
-
You may fork it and use it like any other source file in your project. You only need blowfish.hpp and blowfish.cpp files. Just modify the header as per your convenience.
-
If you are using CMake, the work is lot easier. You can add this as a git submodule. It isolates your project from this dependency.
# In your project root type these commands
git submodule add https://github.com/avinal/blowfish
# considering this addition is your only change
git commit -m "blowfish submodule added"
git push origin main
Add this to your CMakeLists.txt as well.
Building
This library has no dependencies on any other code. Just a C++ compiler should be enough to build this. Although this library is supposed to be used under some other project, sometimes you may need to build this. Here are the prerequisites:
- CMake
- G++ or Clang
- Make or Ninja Build or any other CMake compatible generator.
Here is how I install them on Fedora:
sudo dnf install clang cmake g++ make ninja-build
Configure CMake, enabled debug for development purposes:
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
Build using configured generator:
cmake --build build --config Debug
References
Related Skills
node-connect
349.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
