6
\$\begingroup\$

Introduction

By steganography we mean hiding a message along an existing text or image so the result would be unsuspicious of the existence of the original message. This challenge is about hiding data in Unicode variants of a grapheme called homoglyphs. For instance: cyrillic Е (ye) appears the same as latin E which appears the same as greek Ε (epsilon). They are all glyphs from an archetypical E grapheme and several fonts renders them the same. This allows us to hide three units of information (0 1 2) in just one character. A whole text makes room for a complex message.

Terms: A package (steganographic unsuspicious text) is a payload (message) encoded into a carrier (raw text)

Challenge

  1. Create an steganographic encoder (SE) and decoder (SD) in your chosen golfing language. It must be capable of steganographically encoding its own code by defining its coded character set.

    SE(payload, carrier) -> package
    SD(package) -> payload

  2. Create a package by encoding the encoder itself as payload in the carrier below. Then provide package and decoder. Decoder should retrieve encoder inside package.

    SE(SE, carrier) -> package
    SD(package) -> SE

  3. SHORTEST PACKAGE WINS! truncate it!

Challenge input

A. Coded character set

Create a coded character set with 6 bits, 7 bits,... as much as characters your chosen language requires. You can use ASCII (8 bits) but be aware of wasting carrier capacity.

Pyth for instance requires 7 bits because it maps from 32 to 126 ASCII codes.

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ <newline>

B. Homoglyph mapping

IMPORTANT NOTE: this is NOT BINARY MAPPING. For instance there are five 'M' and 'v' homoglyphs (0 1 2 3 4). Binary mapping QQ (0 1) is almost trivial (less than 100 bytes of steganographic encoder size)

!! "″" $$ %% && (( )) ++ ,‚, -‐- .. /⁄/ 00 11 22 33 44 55 66 77 88 99 :: ;;; << == >> ?? @@ AΑАA BΒВB CϹСⅭC DⅮD EΕЕE FϜF GԌG HΗНH  IΙІⅠI JЈJ KΚКKK LⅬL MΜМⅯM NΝN OΟОO PΡРP QQ RR SЅS TΤТT UU VѴⅤV WW XΧХⅩ YΥҮY ZΖZ [[ \\ ]] ^^ __ `` aаa bЬb cϲсⅽc dԁⅾd eеe ff gg hһh iіⅰi jјj kk lⅼl mⅿm nn oοоo pрp qq rr sѕs tt uu vνѵⅴv wѡw xхⅹ yуy zz {{ || }} ~~ ÄӒ ÖӦ ßβ äӓ öӧ

C. Carrier

“De Chamilly obeyed; he reached Basle, and on the day and at the hour appointed, stationed himself, pen in hand, on the bridge. Presently a market-cart drives by; then an old woman with a basket of fruit passes; anon, a little urchin trundles his hoop by; next an old gentleman in blue top-coat jogs past on his gray mare. Three o'clock chimes from the cathedral tower. Just at the last stroke, a tall fellow in yellow waistcoat and breeches saunters up, goes to the middle of the bridge, lounges over, and looks at the water; then he takes a step back and strikes three hearty blows on the footway with his staff. Down goes every detail in De Chamilly's book. At last the hour of release sounds, and he jumps into his carriage. Shortly before midnight, after two days of ceaseless travelling, De Chamilly presented himself before the minister, feeling rather ashamed at having such trifles to record. M. de Louvois took the portfolio with eagerness, and glanced over the notes. As his eye caught the mention of the yellow-breeched man, a gleam of joy flashed across his countenance. He rushed to the king, roused him from sleep, spoke in private with him for a few moments, and then four couriers who had been held in readiness since five on the preceding evening were despatched with haste. Eight days after, the town of Strasbourg was entirely surrounded by French troops, and summoned to surrender: it capitulated and threw open its gates on the 30th of September 1681. Evidently the three strokes of the stick given by the fellow in yellow costume, at an appointed hour, were the signal of the success of an intrigue concerted between M. de Louvois and the magistrates of Strasbourg, and the man who executed this mission was as ignorant of the motive as was M. de Chamilly of the motive of his.”

If you run out of carrier characters (very unlikely and maybe you'll need to optimize further, but I'm not sure) duplicate the carrier.


Challenge output example

NOTE: Please be aware this solution is based on binary mapping (each char carries a 0 or 1 value) so it is far easier than the challenge.

This is the package: a steganographic encoder encoded by itself into the challenge carrier. It could be retrieved again by means of its steganographic decoder (Pyth at footnote) and its coded character set. It is rendered here by an adverse font to contrast homoglyphs.

metasteganographic package


Simplest example

Character set                   > abcdefghijklmnñopqrstuvwxyz.,?!                           
Coded character set (5 bits)     0123456789ABCDEF0123456789ABCDEF
Mapping (0)                      !"$%&()+,-.;<=>?@ABCDEFGHIJKLMNOPSTVXYZ[]^`acdehijmopsvwxy{|}~ÄÖäö 
Mapping (1) homoglyphs           !″$%&()+‚‐.;<=>?@ΑΒϹⅮΕϜԌΗΙЈΚⅬΜΝΟΡЅΤⅤΧΥΖ[]^`аϲԁеһіјⅿοрѕνѡху{|}~ӒӦӓӧ     

Ϝοr you whο are rеаdіng thеsе lines dіdn't you rеalize soⅿеthing that lοoks like a key іn tһe kеyһole, thаt suѕрiϲiouѕ Ϝ? These linеs аren't јuѕt οrdinary tехt but а 'package' full of unіcode νarіаnts of ѕаme grapheⅿes whiϲh lοοk verу аlike (hοⅿοglурһs). A 'pаyloаԁ' is ѡitһheld by tһe pаckage. Copу and раѕte tһіs pаrаgraph in nοteраd аnd the differences bеtween glуpһs ѡіll be renԁered notіϲeable.

This is binary mapping: we will assign a 0 to latin ordinary graphemes, and 1 to their homoglyphs

Ϝοr you whο are rеаdіng thеsе lines dіdn't you rеalize soⅿеthing that lοoks like a key іn tһe kеyһole, thаt suѕрiϲiouѕ Ϝ? These linеs аren't јuѕt οrdinary tехt but а 'package' full of unіcode νarіаnts of ѕаme grapheⅿes whiϲh lοοk verу аlike (hοⅿοglурһs). A 'pаyloаԁ' is ѡitһheld by tһe pаckage. Copу and раѕte tһіs pаrаgraph in nοteраd аnd the differences bеtween glуpһs ѡіll be renԁered notіϲeable.
11r 00u 001 0r0 r1101ng t0101 l0n00 010n't 00u r10l0z0 0011t00ng t00t l10k0 l0k0 0 k00 1n t10 k1010l00 t01t 0u110100u1 10 00000 l0n10 1r0n't 1u1t 1r00n0r0 t11t but 1 '000k0g0' full 0f un10000 10r11nt0 0f 1100 gr0000100 00010 l11k 00r1 1l0k0 10111gl111000 0 '010l011' 00 10t100l0 b0 t10 010k0g00 0001 0n0 111t0 t110 01r1gr000 0n n1t0110 1n0 t00 00ff0r0n000 b1t000n gl1010 11ll b0 r0n10r00 n0t1100bl0.

11000 w 01001 i 10101 t  01000 h 01000 h 10000 o 01100 l 00100 d 00000   11010 y 10000 o 10110 u 10011 r 00000   00101 e 01110 n 00011 c 10000 o 00100 d 00101 e 10011 r  00000   01000 h 00101 e 10011 r 00101 e 11111 ! 00000   10011 R 00101 e 00001 a 00100 d 00000   10011 r 10110 u 01100 l 00101 e 10100 s 00000   00010 b 00101 e 01100 l 10000 o 11000 w

What is inside?

"withhold your encoder here! read rules below"


\$\endgroup\$
  • 1
    \$\begingroup\$ Welcome to Programming Puzzles and Code Golf! As it stands, it's not really clear what the task at hand is. At the very least some examples would be helpful. I recommend posting challenges to the Sandbox where they can get meaningful feedback before being posted to the main site. \$\endgroup\$ – Alex A. Nov 29 '15 at 0:14
  • \$\begingroup\$ t00t :D Already a favorite challenge. \$\endgroup\$ – Addison Crump Nov 29 '15 at 0:29
  • 1
    \$\begingroup\$ Welcome to PPCG. This is clever, but it is not genius. A true genius can think of something clever and explain it simply. Starting at the beginning, why do you have links marked "what is steganography" and "what are homoglyphs"? By all means include the links but give a brief explanation of these terms so we don't have to click on the links. The same applies to the rest of the post. I could go on, but I hope you get the idea. There might be something in here, but the spec needs to be thorough and clear. I suggest you read (and perhaps answer) some high rated challenges to see what's required \$\endgroup\$ – Level River St Nov 29 '15 at 0:57
  • 5
    \$\begingroup\$ I'm struggling to find the spec in among the examples. This format, where you put the full spec before examples, is more reader-friendly. \$\endgroup\$ – Peter Taylor Nov 29 '15 at 8:18
  • \$\begingroup\$ @AlexA. I hope it's clearer now. \$\endgroup\$ – EndingBeginningCycles Nov 30 '15 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.