Skip to content

trendev/crypt4kids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crypt4kids

Test, Build and Save

codecov

A simple crypto tool for kids 📚

⚡ Run (using golang)

Clone the repo and execute the following command:

go run ./cmd

When stdin and stdout are connected to a terminal, crypt4kids starts in a full-screen cyberpunk arcade mode powered by Bubble Tea and Lip Gloss.

The arcade mode renders a neon 8-bit terminal cabinet with pixel-art city graphics, cartridge-style algorithm buttons, a plaintext panel, and a cipher output panel.

Arcade controls:

  • 1, 2, 3, 4: select an algorithm
  • t: enter type mode
  • Enter: leave type mode, or encrypt from command mode
  • e: encrypt from command mode
  • c: clear the text and output
  • q: quit

Type mode controls:

  • regular text keys: edit the plaintext buffer
  • left/right arrows: move the input cursor
  • Backspace / Delete: edit text
  • Esc: leave type mode without encrypting

You can also use crypt4kids as a plain stdin/stdout tool:

printf 'Trendev rox\n' | go run ./cmd

Using the default rot13 algorithm, this prints:

crypt4kids
Algorithm is "ROT13"

Enter your text and it will be translated:
Geraqri ebk

To force plain mode while running from an interactive terminal:

go run ./cmd -plain

When using -plain interactively, press Ctrl-D to finish the input stream.

🎮 Browser arcade

Run the local browser arcade:

go run ./cmd -web

Then open:

http://127.0.0.1:8787

The browser arcade is an 80s security-game interface with pixel-art operator portraits, a faux-3D vault view, cipher cartridges, and CRT-style plaintext/output panels. Encryption is served by the same local Go cipher code used by the CLI.

Browser controls:

  • choose a cipher cartridge: ROT13, ATBASH, A+B, or B+A
  • type plaintext in the CRT input panel
  • ENCRYPT: translate the current text
  • COPY: copy the latest cipher output
  • CLEAR: reset the input and output panels

Use a different address if needed:

go run ./cmd -web -addr 127.0.0.1:9090

🚀 Run (using docker)

Just run:

docker run -it --rm ghcr.io/trendev/crypt4kids

For plain streaming mode:

printf 'Trendev rox\n' | docker run -i --rm ghcr.io/trendev/crypt4kids

For browser arcade mode with Docker:

docker run --rm -p 8787:8787 ghcr.io/trendev/crypt4kids -web -addr :8787

😅 Need Help ?

Run the following command if you need to get app usage:

docker run -it --rm ghcr.io/trendev/crypt4kids -h

Available flags:

  • -alg: set the algorithm. Supported values are rot13, atbash, atbashrot13, and rot13atbash. The default is rot13.
  • -addr: set the browser arcade server address. The default is 127.0.0.1:8787.
  • -plain: use the line-oriented stdin/stdout interface instead of arcade mode.
  • -web: serve the browser arcade interface.

Examples:

go run ./cmd -alg atbash
printf 'ABC xyz 123\n' | go run ./cmd -alg atbash
go run ./cmd -web

About

crypto for kids

Topics

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors