0% found this document useful (0 votes)
11 views5 pages

Custom PolyAlphebetic Cipher Documentation

The Crypzenox project aims to develop a lightweight, custom encryption algorithm that transforms plaintext into an unintelligible format using a pseudo-random keystream generated from a secret key, suitable for low-security scenarios. It is designed for simple message obfuscation in non-critical applications, prototyping, and low-resource environments like embedded systems. The algorithm is easy to implement, resource-efficient, and offers potential future enhancements for stronger security and broader applicability.

Uploaded by

patelvishw596
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views5 pages

Custom PolyAlphebetic Cipher Documentation

The Crypzenox project aims to develop a lightweight, custom encryption algorithm that transforms plaintext into an unintelligible format using a pseudo-random keystream generated from a secret key, suitable for low-security scenarios. It is designed for simple message obfuscation in non-critical applications, prototyping, and low-resource environments like embedded systems. The algorithm is easy to implement, resource-efficient, and offers potential future enhancements for stronger security and broader applicability.

Uploaded by

patelvishw596
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

CNS Project 220170116016

220170116050

Crypzenox – PolyAlphabetic Cipher

 Aim of the Project

The aim of this algorithm is to develop a lightweight, custom encryption mechanism that
converts plaintext into an unintelligible format using a character-level transformation based on a
pseudo-random keystream. The keystream is deterministically generated from a secret key,
enabling reversible encryption and decryption. This algorithm is intended low-security scenarios,
such as obfuscating messages in non-critical applications.

 Significance and Real-world Applicability

 Usefulness
1. Simple Message Obfuscation:
• Low Security Use Cases: If you're working on a non-critical application
where you want to obscure the text and aren’t concerned about strong
cryptographic security, this algorithm might suffice. For example:
• Personal Projects: If you're developing an app where privacy is not
paramount but you still want to add an extra layer of obfuscation, this
algorithm could work.
• Non-Sensitive Communication: If you need to protect sensitive
information that's not highly important, this method could serve as a basic
deterrent against casual viewers.

1
2. Prototyping:
• Quick Encryption Solution: For a quick proof of concept where security is
not the top priority (such as in early-stage projects or testing
environments), this could be useful. It could also be applied in applications
that require lightweight encryption for short-lived or non-sensitive data.
3. Lightweight Encryption in Controlled Environments:
• Embedded Systems or IoT: In certain low-resource environments where
heavy cryptographic algorithms (like AES) might be too computationally
expensive, this algorithm can provide a very basic form of encryption.

 Feasibility
Complexity: The algorithm is relatively simple to implement and can be coded with
minimal effort. It uses basic concepts such as character-to-number mapping, a pseudo-
random number generator (Mersenne Twister), and simple arithmetic operations. This
makes the implementation straightforward for a developer with basic knowledge of C++
(or similar languages).

Resource Usage: The algorithm uses relatively low resources (CPU, memory), making it suitable
for environments with constrained resources. It doesn’t require much storage or heavy
computations, so it's feasible to run on embedded systems or devices with limited hardware
capabilities.

 Core Technical Workflow

 charToNum: Converts characters ('a'–'z', space) to numbers (0–26).


 numToChar: Converts numbers (0–26) back to characters.
 simpleHash: Computes the sum of ASCII values of a string.
 getKeystream: Generates a random keystream using a seed based on the average character
value and key hash.
 encrypt: Encrypts plaintext by adding the keystream, average value, and position index.
 decrypt: Reverses encryption by using the same keystream to retrieve the original message.
 Final Output: Displays either the encrypted or decrypted message based on the selected
mode.

 Components
- main.cpp – Code for both encryption and descryption.

 Step-by-Step Flow (with Code Snippets)


Phase 1: user select encryption or decryption

2
int mode;
cout << "press 1.encrypt 2.decrypt: ";
cin >> mode;
string text, secret;
cout << "Enter the text: ";
getline(cin, text);
cout << "Enter the secret key: ";
getline(cin, secret);

Phase 2: Encryption

string encrypt(const string &plaintext, const string &key){

vector<int> nums;

for (char c : plaintext)

nums.push_back(charToNum(c));

int avg = accumulate(nums.begin(), nums.end(), 0) /

nums.size();

int seed = avg + simpleHash(key); // for different secret

key generate different key-stream

vector<int> keystream = getKeystream(seed, nums.size());

string encrypted;

for (size_t i = 0; i < nums.size(); ++i)

encrypted += numToChar((nums[i] + 27 - keystream[i] -

static_cast<int>(i)) % 27);

char avgChar = numToChar(avg); // store average as char (0–

26 → a–z + space)

return avgChar + encrypted; // add average becuase

receiver need same key stream

Decryption

string decrypt(const string &ciphertext, const string &key)


3
{

if (ciphertext.empty())

return "";

int avg = charToNum(ciphertext[0]); // saparate avg from

cipher text

string actualCipher = ciphertext.substr(1);

vector<int> nums;

for (char c : actualCipher)

nums.push_back(charToNum(c));

int seed = avg + simpleHash(key);

vector<int> keystream = getKeystream(seed, nums.size());

string decrypted;

for (size_t i = 0; i < nums.size(); ++i)

decrypted += numToChar((nums[i] + keystream[i] +

static_cast<int>(i)) % 27);

return decrypted;

 Output

4
 Operational Scope and Technological Relevance
 Future Scope
- Instead mt19937 can use cryptographically secure random number generator for stronger
security.
- Use a robust hash function like SHA-256 instead of simple ASCII summation.
- Convert the algorithm into a reusable library or RESTful API for cross-platform use.

 Key Benefits
- Simplicity – Easy to understand and implement for beginners in cryptography.
- Custom Keystream – Generates a dynamic keystream based on the key and input, adding
variability.
- Lightweight – Does not require external libraries, making it suitable for small-scale use.

You might also like