A simple and fun cipher (Rust) https://crates.io/crates/sweecrypt
Find a file
2026-04-18 16:07:31 -07:00
.forgejo/workflows Update Cargo.lock and prevent lock from being updated in CI 2026-04-08 14:51:57 -07:00
src add stdin parsing, fix CLI parsing bug 2026-04-08 14:33:13 -07:00
.gitignore Update Cargo.lock and prevent lock from being updated in CI 2026-04-08 14:51:57 -07:00
Cargo.lock Update Cargo.lock and prevent lock from being updated in CI 2026-04-08 14:51:57 -07:00
Cargo.toml bump version for 1.1.5 2026-04-08 14:47:29 -07:00
CHANGELOG.md add changelog 2026-01-04 14:48:13 -08:00
LICENSE Initial commit 2025-10-26 17:07:13 -07:00
README.md update doc for 1.1.5 2026-04-18 16:07:31 -07:00

SweeCrypt-rs

A basic and fun cipher module for everyone. It converts regular text into symbols on a keyboard, kind of like a cipher. This is only for fun, using this module for cybersecurity is NOT ADVISED

This is a port of SweeCrypt-py to Rust.

Install

CLI

$ cargo install sweecrypt

Help page:

$ sweecrypt --help
SweeCrypt-rs v1.1.5 - https://git.swee.codes/swee/SweeCrypt-rs
An easy and fun encryption module and app
Copyright 2024-2026 Swee
This software is licensed with MIT license

Usage: sweecrypt [encrypt|decrypt] (--shift <n>) <msg>

Commands
    encrypt [str] Encodes a message from stdin or parameter
    decrypt [str] Decodes a message from stdin or parameter

Flags
    --help        Shows this message
    --shift <int> Specifies a database shift

Module

$ cargo add sweecrypt
[dependencies]
sweecrypt = "1.1.5"

Examples

Encrypt

using sweecrypt::encode;

fn main() {
    println!("{}", encode("hello, world!", 0));
}
$ sweecrypt encrypt "hello, world!"
!?~~(:,}(>~/a

Decrypt

using sweecrypt::decode; 

fn main() {
    println!("{}", decode("!?~~(:,}(>~/a", 0));       
}
$ sweecrypt decrypt '!?~~(:,}(>~/a'
hello, world!

Shifting DB

using sweecrypt::{decode,encode};

fn main() {
    let encoded = encode("hello, world!", 3);
    println!("{}", encoded);
    println!("{}", decode(encoded, 3)); // Correct output
    println!("{}", decode(encoded, 0)); // Wrong output
}
$ sweecrypt encrypt --shift 3 "hello, world"
\!((>ba_>](#
$ sweecrypt decrypt --shift 3 "\!((>ba_>](#"
hello, world

It will output a nonsense string if shifted incorrectly.

$ sweecrypt decrypt "\!((>ba_>](#"
khoor?!zruog

Encoding a file (new with a CLI feature)

$ cat test.txt
Lorem ipsum dolor
$ xxd -p test.txt | sweecrypt encrypt > test.swcr
$ cat test.swcr
j)l^mhlkl/hplompmimkl/hpljl^l)l^mhp`c
$ sweecrypt decrypt < test.swcr | xxd -rp
Lorem ipsum dolor