cypher_encrypt 0.0.1
cypher_encrypt: ^0.0.1 copied to clipboard
A simple, flexible Dart package for encrypting and decrypting strings using a customizable substitution cypher. Supports custom sequences, variable steps, and works with any UTF-8 string.
cypher_encrypt #
A simple, flexible Dart package for encrypting and decrypting strings using a customizable substitution cipher.
You can shift characters by a number of steps, define your own sequence, and safely encrypt/decrypt any UTF-8 text.
Characters not included in the sequence remain unchanged.
β¨ Features #
- π Encryption & decryption with a substitution cipher
- π Customizable steps (shift forward/backward by N)
- π Default sequence provided, but you can override with your own
- π Works with any UTF-8 string (letters, numbers, symbols, emojis)
- π‘οΈ Safe by design: no
FormatExceptionbecause we donβt rely on Base64
π¦ Installation #
Add this line to your pubspec.yaml under dependencies:
dependencies:
cypher_encrypt: ^0.0.1
Then run:
dart pub get
π Usage Example #
import 'package:cypher_encrypt/cypher_encrypt.dart';
void main() {
final text = "Cypher the like button!";
// Encrypt with steps = 3
final encrypted = cypherEncrypt(text, steps: 3);
print("Encrypted: $encrypted");
// Decrypt with the same steps
final decrypted = cypherDecrypt(encrypted, steps: 3);
print("Decrypted: $decrypted");
// Wrong steps β produces gibberish
final wrong = cypherDecrypt(encrypted, steps: 2);
print("Wrong decryption: $wrong");
}
π Example Output #
Encrypted: FBskhubwkhbolnhbexwwrq%
Decrypted: Cypher the like button!
Wrong decryption: Dzqifs-uif-mjlf-cvuupo@
π Default Sequence #
By default, cypher_encrypt uses this sequence:
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789=+!@#%&*()_ -
- β Works for letters, numbers, and common symbols
- β You can override with your own sequence
- β Characters not in the sequence remain unchanged
ππΌ Custom Sequence Example #
final encrypted = cypherEncrypt(
"Hello World!",
sequence: "zyxwvutsrqponmlkjihgfedcba", // reversed alphabet
steps: 5,
);
final decrypted = cypherDecrypt(
encrypted,
sequence: "zyxwvutsrqponmlkjihgfedcba",
steps: 5,
);
π License #
MIT License Β© 2025 Muhammad Rameez