UNPKG

franbac

Version:

tiny utility to decode bacon cipher texts

61 lines (45 loc) β€’ 1.84 kB
# franbac πŸ₯“ helps encode/decode strings that use two different characters to represent A's and B's. more info about the bacon cipher [here](https://en.wikipedia.org/wiki/Bacon%27s_cipher) it will try to decode with letter 1 = A and letter 2 = A. if one of those decoded texts results in an invalid plaintext, it will discard it. it will try with the default alphabet and the alternate alphabet (both are in that wikipedia page). ## install + use easist to use `npx` to run on-demand ### decode `franbac decode <ciphertext>` ```bash $ npx franbac decode aaaaaaaaabaaaba ABC ``` decode emojis ```bash $ npx franbac decode 🌸🌿🌸🌿🌿🌿🌸🌿🌿🌸🌿🌸🌸🌸🌿🌿🌸🌸🌿🌿🌸🌿🌿🌸🌸🌸🌸🌸🌸🌸🌸🌿🌿🌸🌸🌸🌸🌸🌿🌿🌿🌸🌸🌸🌿🌿🌸🌸🌿🌸🌸🌸🌸🌸🌸🌿🌸🌸🌸🌸🌿🌸🌸🌸🌿 MYSVNANDSTARS ``` ### encode `franbac encode <a> <b> <plaintext>` ```bash $ npx franbac encode t s hello world ttsssttstttststtststtsstsststttsstsstttttststtttss ``` encode emojis ```bash $ npx franbac encode πŸ₯“ πŸŽ‰ hello world πŸ₯“πŸ₯“πŸŽ‰πŸŽ‰πŸŽ‰πŸ₯“πŸ₯“πŸŽ‰πŸ₯“πŸ₯“πŸ₯“πŸŽ‰πŸ₯“πŸŽ‰πŸ₯“πŸ₯“πŸŽ‰πŸ₯“πŸŽ‰πŸ₯“πŸ₯“πŸŽ‰πŸŽ‰πŸ₯“πŸŽ‰πŸŽ‰πŸ₯“πŸŽ‰πŸ₯“πŸ₯“πŸ₯“πŸŽ‰πŸŽ‰πŸ₯“πŸŽ‰πŸŽ‰πŸ₯“πŸ₯“πŸ₯“πŸ₯“πŸ₯“πŸŽ‰πŸ₯“πŸŽ‰πŸ₯“πŸ₯“πŸ₯“πŸ₯“πŸŽ‰πŸŽ‰ ``` ### files encoding: `franbac file encode <a> <b> <filename>` decoding: `franbac file decode <filename>` encode and decode file ```bash $ echo "hello world" > helloworld.txt $ npx franbac file encode 6 9 helloworld.txt > helloworld.enc $ cat helloworld.enc 66999669666969669696699699696669969966666969666699 $ npx franbac file decode helloworld.enc HELLOWORLD ``` ## roadmap - [x] support decoding - [x] support encoding given A and B substitutions - [x] support encoding/decoding a file ## license MIT