Shape preserving encoding, part 2 of 2

Better disguises in plain sight …

Last time I gave a (too) simple example of how we might disguise a message so that people could read it but computers couldn’t (at a first pass). That example was too clever, forgetting the Ogden Nash‘s adage:

Here’s a rule of thumb:
Too clever is dumb.

If you recall, those clever programmers at Apple and Google (at least) were way ahead of me. I think I can do better, though.

Leonardo da Vinci famously wrote most of his notes in mirror-image reversed writing. Here’s the same passage as last time, in simple writing and then reversed.

 

One thing was certain, that the WHITE kitten had had nothing to do with it: — it was the black kitten’s fault entirely. For the white kitten had been having its face washed by the old cat for the last quarter of an hour (and bearing it pretty well, considering); so you see that it COULDN’T have had any hand in the mischief.

 

One thing was certain, that the WHITE kitten had had nothing to do with it: — it was the black kitten’s fault entirely. For the white kitten had been having its face washed by the old cat for the last quarter of an hour (and bearing it pretty well, considering); so you see that it COULDN’T have had any hand in the mischief.

 

There are 2 problems with the Leonardo approach as I’ve done here. First, it is a nuisance to read without a mirror (which is what Leonardo intended). The other problem is that the mirror-image text above is just presented in mirror image. The BigCo computers would still read it as normal text, so it’s not disguised for them, just for us — exactly the opposite of what we want. Oops!

However, we can do something similar, which is to reverse the text, either by reversing the order of the words in each line, (A) below, or reversing the order of the letters in each word, (B), or both (C), below.

 

A B
WHITE the that , certain was thing One
— : it with do to nothing had had kitten
entirely fault kitten’s black the was it
having been had kitten white the For .
the for cat old the by washed face its
it bearing and ( hour an of quarter last
see you so ; ) considering , well pretty
in hand any had have COULDN’T it that
. mischief the
enO gniht saw niatrec , taht eht ETIHW
nettik dah dah gnihton ot od htiw ti : —
ti saw eht kcalb s’nettik tluaf yleritne
. roF eht etihw nettik dah neeb gnivah
sti ecaf dehsaw yb eht dlo tac rof eht
tsal retrauq fo na ruoh ( dna gniraeb ti
ytterp llew , gniredisnoc ) ; os uoy ees
taht ti T’NDLUOC evah dah yna dnah ni
eht feihcsim .

 

C
ETIHW eht taht , niatrec saw gniht enO
— : ti htiw od ot gnihton dah dah nettik
yleritne tluaf s’nettik kcalb eht saw ti
gnivah neeb dah nettik etihw eht roF .
eht rof tac dlo eht yb dehsaw ecaf sti
ti gniraeb dna ( ruoh na fo retrauq tsal
ees uoy os ; ) gniredisnoc , llew ytterp
ni dnah yna dah evah T’NDLUOC ti taht
. feihcsim eht

 

What do you think? For me, (A) is definitely the easiest to read, (B) is harder, and (C) is a little bit harder still. One advantage to (B) is that it doesn’t require explicit lines — we can just reverse the words as we go along, so it would be easier to type. Even though I cheated and wrote a program to make these examples, the point is that it could be easier to type (B) manually.

As for the BigCo computers, (A) would be a little bit of a challenge: the letters of the words are in the right order, and words that are adjacent in the original are adjacent in the disguised form, so the computers would only be a little bit confused. However (B) and (C) would definitely be more of a challenge. Could they do it? Probably: they could look for reversed words and just reverse those. There would be some mistakes with words that are other words when they are reversed, like was and saw in the passage above, but overall it would work reasonably well. The main thing is that the BigCo computers would have to be instructed by the clever programmers to be on the lookout for reversed words.

A nice thing to point out is that the (C) example is just writing right to left, like many other scripts, including Arabic, Hebrew, and N’Ko, so it really isn’t that strange, and actually less strange than (A) and (B), as a writing technique. Let’s see how we can draw on other writing techniques to come up with other disguises for English.

Some writing systems don’t put spaces between words. When we apply that to our passage, we get this:

 

D
Onethingwascertain,thattheWHITE
kittenhadhadnothingtodowithit:—
itwastheblackkitten’sfaultentirely
.Forthewhitekittenhadbeenhaving
itsfacewashedbytheoldcatforthe
lastquarterofanhour(andbearingit
prettywell,considering);soyousee
thatitCOULDN’Thavehadanyhandin
themischief.

 

Alternatively, we could put spaces between every character, like this:

 

E
O n e t h i n g w a s c e r t a i n , t h a t t h e W H I T E
k i t t e n h a d h a d n o t h i n g t o d o w i t h i t : —
i t w a s t h e b l a c k k i t t e n ’ s f a u l t e n t i r e l y
. F o r t h e w h i t e k i t t e n h a d b e e n h a v i n g
i t s f a c e w a s h e d b y t h e o l d c a t f o r t h e
l a s t q u a r t e r o f a n h o u r ( a n d b e a r i n g i t
p r e t t y w e l l , c o n s i d e r i n g ) ; s o y o u s e e
t h a t i t C O U L D N ’ T h a v e h a d a n y h a n d i n
t h e m i s c h i e f .

 

I can’t really say that one is easier for me to read than the other. For BigCo’s computers, it wouldn’t make any difference: if they saw the one with spaces like (D), they could just remove all the spaces and turn it into (C). They’d still have the issue of splitting the passage into words, though. For some languages (like Chinese), that’s a very hard problem, but it’s somewhat easier for English. Of course, I mean it’s a challenge for computers, not for us. It’s nice that there are still some things we humans can do better than computers.

One more technique we could borrow from other languages (like older Chinese, Japanese, and Korean) is writing top to bottom (which English also does on signs). Here are two versions, both writing top to bottom and then left to right (to make it easier for English readers; older Chinese, Japanese, and Korean would go right to left).

 

F

Oki.ilptt
nit tarhh
et Fsseae
 two ttt 
tearf t m
hns aqyii
i  tcu ts
nhtheaw c
gahe reCh
 de wtlOi
w  waelUe
ahbhsr Lf
salih ,D 
 dateo N.
c cedfc’ 
enk   oT 
ro kban  
ttkiynsh 
ahit  ia 
iittthdv 
nntehoee 
 geneur  
, n  rih 
 t’ho na 
tosal(gd 
h  dd    
adf  a)a 
toabcn n 
  uead;y 
twlet    
hitn bsh 
et  feoa 
 hehoa n 
W narryd 
Hitv io  
Itiitnui 
T rnhg n 
E:ege s  
  l  ie  
 —y  te  

 

G

O    k    i    .    i    l    p    t    t
n    i    t         t    a    r    h    h
e    t         F    s    s    e    a    e
     t    w    o         t    t    t     
t    e    a    r    f         t         m
h    n    s         a    q    y    i    i
i              t    c    u         t    s
n    h    t    h    e    a    w         c
g    a    h    e         r    e    C    h
     d    e         w    t    l    O    i
w              w    a    e    l    U    e
a    h    b    h    s    r         L    f
s    a    l    i    h         ,    D     
     d    a    t    e    o         N    .
c         c    e    d    f    c    ’     
e    n    k                   o    T     
r    o         k    b    a    n          
t    t    k    i    y    n    s    h     
a    h    i    t              i    a     
i    i    t    t    t    h    d    v     
n    n    t    e    h    o    e    e     
     g    e    n    e    u    r          
,         n              r    i    h     
     t    ’    h    o         n    a     
t    o    s    a    l    (    g    d     
h              d    d                    
a    d    f              a    )    a     
t    o    a    b    c    n         n     
          u    e    a    d    ;    y     
t    w    l    e    t                    
h    i    t    n         b    s    h     
e    t              f    e    o    a     
     h    e    h    o    a         n     
W         n    a    r    r    y    d     
H    i    t    v         i    o          
I    t    i    i    t    n    u    i     
T         r    n    h    g         n     
E    :    e    g    e         s          
          l              i    e          
     —    y              t    e          

 

I don’t know about you, but I find that the spread out version (G) is easier to read than one without spaces (F), and since the spaces don’t make much difference to the BigCo computers, I’d just go with (G). As with the reversing techniques, the vertical writing technique isn’t hard to transform back into horizontal writing, once it has been identified. Of course, it isn’t too hard to identify: just look at a couple vertical lines and see if they look like they have words. If they do, you have vertical writing. The thing is, just as with the reversal technique, the clever BigCo programmers would have to think of telling the computers to look for the vertical writing. Shh, don’t tell them, and we can use it for disguising our important messages:

N   y   g   d
o   o   o   o
w   u       u
        f   g
w   w   o   h
h   a   r   n
e   n       u
r   t       t
e           s
    t        
d   o        
o            

 

Posted in FMOA