Custom PolyAlphebetic Cipher Documentation
Custom PolyAlphebetic Cipher Documentation
220170116050
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.
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.
Components
- main.cpp – Code for both encryption and descryption.
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
vector<int> nums;
nums.push_back(charToNum(c));
nums.size();
string encrypted;
static_cast<int>(i)) % 27);
26 → a–z + space)
Decryption
if (ciphertext.empty())
return "";
cipher text
vector<int> nums;
nums.push_back(charToNum(c));
string decrypted;
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.