e12ba8faf7 · 2026-01-19 00:46:01 +07:00
9 Commits
2025-07-22 16:34:23 +07:00
2025-05-16 21:48:17 +07:00
2026-01-19 00:46:01 +07:00
2026-01-19 00:46:01 +07:00
2025-07-23 04:19:48 +07:00

asscryption

Proof-of-concept random key-based text transformer.

Usage

you can use -o <FILE> to write to file.

Encrypt

python main.py encrypt <filein> <target> [--seed SEED] > keyfile
  • filein: Input text file (plaintext)
  • target: Target text file (what you want to transform to)
  • --seed: (Optional) Random seed for reproducibility
  • keyfile: Output key file (redirect stdout)

Decrypt

python main.py decrypt <filein> <keyfile>
  • filein: Input text file (should match the input used in encrypt)
  • keyfile: Key file produced during encryption

Output as bytes

For both encryption and decryption, use -b or --bytes to output or read the key as a compact bytearray of N bytes for the index (usize) plus 1 byte (u8) for the offset.

  • Use -b or --bytes alone for the default size (8 bytes for index).
  • Optionally specify a size after -b (e.g. -b 4 or --bytes=4) to customize the index size in bytes.
  • Important: When decrypting, you must specify the same byte size as was used for encryption.

Example

encryption:

python main.py encrypt message.txt target.txt --seed 42 > mykey.txt
python main.py encrypt filein.txt target.txt -b > keyfile.bin       # 8-byte index (default)
python main.py encrypt filein.txt target.txt -b 4 > keyfile.bin
python main.py encrypt filein.txt target.txt --seed 123 -b=4 > keyfile.bin

decryption:

python main.py decrypt message.txt mykey.txt > reconstructed_target.txt
python main.py decrypt filein.txt keyfile.bin -b 4 > out.txt         # must match key size
python main.py decrypt filein.txt keyfile.bin --bytes=4 > out.txt

NOTE: This is a proof-of-concept. The "key" is printed to stdout during encryption. The target file must exist.


Version 1.2

S
Description
i demand a gist service rn
Readme MIT
45 KiB
0 Stars 1 Watchers 0 Forks
Languages
Python 100%