https://github.com/karusb/bazcryptlib
BazCrypt 4 Neighborhood Cellular Automata Encryption Algorithm C++ Library
https://github.com/karusb/bazcryptlib
algorithm bazcrypt bazcrypt-encryption c-plus-plus cellular-automata cpp cross-platform cryptography encryption library linux windows
Last synced: 9 months ago
JSON representation
BazCrypt 4 Neighborhood Cellular Automata Encryption Algorithm C++ Library
- Host: GitHub
- URL: https://github.com/karusb/bazcryptlib
- Owner: karusb
- License: gpl-3.0
- Created: 2017-11-07T15:35:29.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-05-29T21:41:11.000Z (over 3 years ago)
- Last Synced: 2025-01-08T07:42:23.772Z (11 months ago)
- Topics: algorithm, bazcrypt, bazcrypt-encryption, c-plus-plus, cellular-automata, cpp, cross-platform, cryptography, encryption, library, linux, windows
- Language: C++
- Homepage:
- Size: 648 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BazCryptLIB
BazCrypt Encryption C++ Library
Allows you to perform BazCrypt Encryption/Decryption with a simple function call.
BazCrypt is a symmetric XOR encryption algorithm that uses Cellular Automata to randomise the key that was initially provided as a password and provides extra security with generation number.
## Use Cases
- Text Encryption
- Data Encryption
- Communications Encryption (Only valid if password changes for each message)
## Pre-Compiled Binaries
### Command Line Interface and Library
- [[Linux] Download](https://github.com/karusb/BazCryptLIB/releases/download/1.2.0/BazCryptCLI-v1.2-Linux64.zip)
- [[Windows] Download](https://github.com/karusb/BazCryptLIB/releases/download/1.2.0/BazCryptCLI-v1.2-Windows64.zip)
#### Program Options
```sh
-f --file Path to file to encrypt/decrypt
-m --message Text data to encrypt
-p --password Password
-g --generations Generation number, or known as pincode, use 4 digits atleast
-o --output Path to output file, when specified input wont be overwritten
-a --algorithm Optional algorithm selection, use 0 or 1 or 2, default is 0
-L --license Prints software licence.
-h --help Prints this text.
File encryption/decryption example:
bazcrypt -f \\path\\to\\file.txt -p strongpassword -g 1324
Text encryption/decryption example:
bazcrypt -m \"Plain Text\" -p strongpassword -g 1324 -o plain.txt
bazcrypt -f plain.txt -p strongpassword -g 1324 -o plain.txt
```
## Convention
```c++
int BazCrypt(const char* MESSAGE, const char* password, char* output, unsigned long messageLength, unsigned long passwordLength, int generations, int algorithm);
```
Message = char(8bit) array data that is to be encrypted/decrypted.\
password = char(8bit) array password that is to generate the IV for the encryption.\
output = pre allocated char(8bit) array which has the same size as the message\
messageLength = length of the Message array\
passwordLength = length of the password array\
generations = Non 0 integer number that determines the cycles of the algorithm. Also referred as PIN number.\
algorithm = Preferred algorithm of choice. Default is 0.
- 0 = 57630b
- 1 = 57630z
- 2 = 39318
returns = Status after execution
- 0 OK = Finished succesfully.
- 1 NULLPARAM = One or more input arrays are nullptrs.
- 2 NULLSIZE = One or more Length parameters are zero.
## Build
### Linux
- Required build-essentials, cmake
- Run these in terminal within the source directory:
```bash
cmake .
make install
```
- Libraries are automatically installed i.e
- CLI(CommandLineInterface) is automatically installed as "bazcrypt"
### Windows
- Required Visual Studio and CMake
- Run BazCryptLIB.sln and choose Release or DLL configuration, right click solution and click build.
- Library will be located under x64/Release or x64/DLL depending on your preference
- CLI(CommandLineInterface) is automatically built as "bazcrypt.exe"
## Example BazCrypt Call
```c++
#include "BazCryptLIB.h"
using namespace BazCryptLIB;
int main()
{
const char* message = "This is a test plain text. This is also very important to hide!";
const char* key = "asimplepasswordtouse";
unsigned long keyLen = 21;
unsigned long msgLen = 64;
int generations = 1500;
// ENCRYPTION
char* encryptedMessage = new char[(int)msgLen];
BazCrypt(message, key, encryptedMessage, msgLen, keyLen, generations, 2);
// DECRYPTION
char* decryptedMessage = new char[(int)msgLen];
BazCrypt(encryptedMessage, key, decryptedMessage, msgLen, keyLen, generations, 2);
return 0;
}
```
