Libbacon
A C implementation of the Baconian Cipher ! BACON
Install / Use
/learn @jwerle/LibbaconREADME
libbacon
A C implementation of the Baconian Cipher ! BACON
about
Inspired by bacon-cipher !
Encode or decodes a message with each letter of the plaintext replaced by a group of five of the letters consisting of either an A or B. This replacement is a binary encoding and is done according to the alphabet of the Baconian cipher.
The default translation table is shown below:
a AAAAA g AABBA n ABBAA t BAABA
b AAAAB h AABBB o ABBAB u-v BAABB
c AAABA i-j ABAAA p ABBBA w BABAA
d AAABB k ABAAB q ABBBB x BABAB
e AABAA l ABABA r BAAAA y BABBA
f AABAB m ABABB s BAAAB z BABBB
install
clib:
$ clib install jwerle/libbacon
source:
$ git clone git@github.com:jwerle/libbacon.git
$ cd libbacon
$ make
$ make install
usage
Command line utility:
encode:
$ echo abc | bacon --encode
AAAAAAAAABAAABA
$ { echo abc && echo def && echo ghi; } | bacon --encode
AAAAAAAAABAAABA
AAABBAABAAAABAB
AABBAAABBBABAAA
decode:
$ echo AAAAAAAAABAAABA | bacon --decode
ABC
$ { echo 'AAAAAAAAABAAABA' && echo 'AAABBAABAAAABAB' && echo 'AABBAAABBBABAAA'; } | bacon --decode
ABC
DEF
GHI
C Library:
encode:
#include <bacon.h>
#include <stdio.h>
int
main (void) {
printf("%s\n", bacon_encode("foo bar", NULL));
return 0;
}
...yields:
AABABABBABABBAB AAAABAAAAABAAAA
decode:
#include <bacon.h>
#include <stdio.h>
int
main (void) {
char *buf = "AA AA AA AAA BAAAB AAAABBA ABAAA.ABAB#AABBA@AABB+BABAA/AABAAAABAABABABAA"
"B_ABBABBAAABBABABBB AABBBBBAAAABAAABBAABABAAB<BBAABBBABAABABABBA>BBABABB"
"B";
printf("%s\n", bacon_decode(buf, NULL));
return 0;
}
...yields:
A B CD E F G H IIKL MNO PQRST UUWX YZ
api
See bacon.h
license
MIT
Related Skills
node-connect
341.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.5kCommit, push, and open a PR
