30
CSCI 470: Web Science • Keith Vertanen • Copyright © 2014 Secret wri)ng LIVITCSWPIYVEWHEVSRIQMXLEYVEOIEWHRXEXIP FEMVEWHKVSTYLXZIXLIKIIXPIJVSZEYPERRGERI MWQLMGLMXQERIWGPSRIHMXQEREKIETXMJTPRGEV EKEITREWHEXXLEXXMZITWAWSQWXSWEXTVEPMRXR SJGSTVRIEYVIEXCVMUIMWERGMIWXMJMGCSMWXSJ OMIQXLIVIQIVIXQSVSTWHKPEGARCSXRWIEVSWII BXVIZMXFSJXLIKEGAEWHEPSWYSWIWIEVXLISXLI VXLIRGEPIRQIVIIBGIIHMWYPFLEVHEWHYPSRRFQ MXLEPPXLIECCIEVEWGISJKTVWMRLIHYSPHXLIQI MYLXSJXLIMWRIGXQEROIVFVIZEVAEKPIEWHXEAM WYEPPXLMWYRMWXSGSWRMHIVEXMSWMGSTPHLEVHP FKPEZINTCMXIVJSVLMRSCMWMSWVIRCIGXMWYMX

Secretwring - katie.cs.mtech.edu

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Secretwring - katie.cs.mtech.edu

CSCI  470:  Web  Science    •    Keith  Vertanen    •    Copyright  ©  2014  

Secret  wri)ng  

LIVITCSWPIYVEWHEVSRIQMXLEYVEOIEWHRXEXIPFEMVEWHKVSTYLXZIXLIKIIXPIJVSZEYPERRGERIMWQLMGLMXQERIWGPSRIHMXQEREKIETXMJTPRGEVEKEITREWHEXXLEXXMZITWAWSQWXSWEXTVEPMRXRSJGSTVRIEYVIEXCVMUIMWERGMIWXMJMGCSMWXSJOMIQXLIVIQIVIXQSVSTWHKPEGARCSXRWIEVSWIIBXVIZMXFSJXLIKEGAEWHEPSWYSWIWIEVXLISXLIVXLIRGEPIRQIVIIBGIIHMWYPFLEVHEWHYPSRRFQMXLEPPXLIECCIEVEWGISJKTVWMRLIHYSPHXLIQIMYLXSJXLIMWRIGXQEROIVFVIZEVAEKPIEWHXEAMWYEPPXLMWYRMWXSGSWRMHIVEXMSWMGSTPHLEVHPFKPEZINTCMXIVJSVLMRSCMWMSWVIRCIGXMWYMX

Page 2: Secretwring - katie.cs.mtech.edu

Overview  •  Secret  wri+ng  – Steganography    – Cryptography  

•  Keys,  plaintext,  ciphertext  •  Codes  vs.  Ciphers  •  Transposi+on  ciphers  •  Subs+tu+on  ciphers  

2  

Page 3: Secretwring - katie.cs.mtech.edu

Steganography  vs.  Cryptography  •  Steganography  – "concealed  wri+ng"  – Hide  messages  to  keep  secret  – Does  not  aDract  aDen+on  (if  not  found).  

•  Cryptography  – "hidden  wri+ng"  – Scramble  messages  so  unintelligible  – Screams:  "Please  try  and  decode  me!"  

•  But  not  mutually  exclusive:  – e.g.  Scrambled  message  in  "invisible"  ink  

3  

Page 4: Secretwring - katie.cs.mtech.edu

Physical  hiding  •  Ancient  Chinese  – Write  message  on  very  thin  silk  sheet  – Rolled  up,  covered  in  wax,  and  ingested  by  messenger  

•  480  BC  – His+aeus  wants  Aristagoras  of  Miletus  to  revolt  against  the  Persian  King  •  Shaves  head  of  messenger,  taDoos  message  on  scalp  • Wait  for  hair  to  grow  back  •  Sends  messenger  to  Aristagoras    

4  

Page 5: Secretwring - katie.cs.mtech.edu

Physical  hiding  •  480  BC  – Demaratus,  Greek  ex-­‐pat  living  in  Persia  – No+ces  build  up  for  aDack  on  Greece  – Sent  secret  messages:  

•  Scraped  wax  of  tablet  • Wrote  on  wood  •  Covered  up  with  wax  

– Persian  ships  aDack,  defeated  by  wai+ng  Greeks  

5  

Page 6: Secretwring - katie.cs.mtech.edu

Invisibility  •  Invisible  wri+ng  – Write  in  something  invisible  

•  Un+l  it  reacts  with  heat/chemical/UV  •  e.g.  vinegar,  ammonia,  lemon  juice,  table  salt,  soap,  milk,  sunscreen,  urine,  saliva,  wine,  cola,  …  

– 1500's,  Italian  scien+st  Giovanni  Porta  •  Hard-­‐boiled  egg,  alum+vinegar  •  Penetrates  shell  •  Leaves  message  on  egg  

–  Invisible  ink-­‐jet  prin+ng  

6  hDp://www.neomark.net/invisible.html  

hDp://www.youtube.com/watch?v=oU2PkF9QLTQ    

hDp://www.instructables.com/id/Ghost-­‐message-­‐egg/    

Page 7: Secretwring - katie.cs.mtech.edu

Really  really  small  •  Microdots  – Germany  between  WW1  and  WW2  – Documents  shrunk  to  size  of  a  period.  – Put  in  insecure  postal  mail  – Modern  usage  

•  Tag  vehicle  or  other  asset  with  ID  •  Extremely  hard  to  find  them  all!  

7  hDp://www.scienceinafrica.co.za/2005/november/microdot.htm    

Page 8: Secretwring - katie.cs.mtech.edu

Digital  steganography  •  Digital  steganography  – Encode  message  in  some  digital  media  

•  e.g.  text,  image,  audio  file,  video,  executable  files,  …  

– Encode  message  in  some  other  measurable  thing  •  e.g.  rate  of  network  packets,  +ming  of  packets,  DNA,  …  

– Encode  in  unused  areas  •  e.g.  unused  disk  sectors,  network  packet  fields,  photo  fields,  …  

 

8  

Page 9: Secretwring - katie.cs.mtech.edu

Hiding  text  in  text  •  Hiding  a  message  in  text  – German  spy  in  WWII:  – "Apparently  neutral's  protest  is  thoroughly  discounted  and  ignored.  Isman  hard  hit.  Blockade  issue  affects  pretext  for  embargo  on  by  products,  ejec+ng  suets  and  vegetable  oils."  

9  

Page 10: Secretwring - katie.cs.mtech.edu

Hiding  text  in  text  •  Hiding  a  message  in  text  – German  spy  in  WWII:  – "Apparently  neutral's  protest  is  thoroughly  discounted  and  ignored.  Isman  hard  hit.  Blockade  issue  affects  pretext  for  embargo  on  byproducts,  ejec+ng  suets  and  vegetable  oils."  

– "Pershing  Sails  from  NY  June  1"  

10  

Page 11: Secretwring - katie.cs.mtech.edu

Hiding  text  in  text  •  Hiding  a  message  in  text  – Original  text:  

11  

"We  explore  new  steganographic  and  cryptographic  algorithms  and  techniques  throughout  the  world  to  produce  wide  variety  and  security  in  the  electronic  web  called  the  Internet."  

Page 12: Secretwring - katie.cs.mtech.edu

Hiding  text  in  text  •  Hiding  a  message  in  text  – Text  with  secret  message:  

12  

"We  explore  new  steganographic  and  cryptographic  algorithms  and  techniques  throughout  the  world  to  produce  wide  variety  and  security  in  the  electronic  web  called  the  Internet."  

Page 13: Secretwring - katie.cs.mtech.edu

Hiding  text  in  text  •  Hiding  a  message  in  text  – Text  overlaid  on  each  other:  

13  

"We  explore  new  steganographic  and  cryptographic  algorithms  and  techniques  throughout  the  world  to  produce  wide  variety  and  security  in  the  electronic  web  called  the  Internet."  

"We  explore  new  steganographic  and  cryptographic  algorithms  and  techniques  throughout  the  world  to  produce  wide  variety  and  security  in  the  electronic  web  called  the  Internet."  

Page 14: Secretwring - katie.cs.mtech.edu

Hiding  in  images  •  Images  – High  resolu+on  image  with  16M  colors  

•  You  can  change  a  lot  of  bits  without  percep+vely  altering  the  image's  appearance  •  e.g.  use  1-­‐2  least  significant  bits  in  each  pixel  

– Also  useful  for  invisible  watermarking  •  Prove  somebody  stole  your  photo  

– May  not  be  robust  to  image  alterna+ons  •  e.g.  changing  compression  level,  brightness,  etc.  •  Short  messages  (e.g.  copyright)  can  be  included  many  +mes  in  hopes  of  surviving  

14  

hDp://www.digimarc.com/digimarc-­‐for-­‐images  

Page 15: Secretwring - katie.cs.mtech.edu

Loomings    Call  me  Ishmael.  Some  years  ago-­‐  never  mind  how  long  precisely-­‐having  liDle  or  no  money  in  my  purse,  and  nothing  par+cular  to  interest  me  on  shore,  I  thought  I  would  sail  about  a  liDle  and  see  the  watery  part  of  the  world.  It  is  a  way  I  have  of  driving  off  the  …  

Page 16: Secretwring - katie.cs.mtech.edu

Steganography  summary  •  Steganography  – Hide  messages  via  physical  or  digital  means  – Does  not  draw  aDen+on  to  itself  

•  But  if  found,  sensi+ve  info  revealed  (unless  also  encrypted)  

– Steganalysis:  trying  to  detect  secret  messages  

•  Uses:  – Cloak  and  dagger  stuff  – Nefarious  ac+vi+es:  terrorism,  malware  – Tagging  assets:  cars,  photos,  etc.  – Not  really  what  we  need  for  ecommerce  sites  

16  

Page 17: Secretwring - katie.cs.mtech.edu

Cryptography  •  Cryptography  – "hidden,  secret"  – Scramble  text  to  hide  its  meaning  – But  intended  recipient  can  read  (hopefully)  

17  

Alice   Bob  

Page 18: Secretwring - katie.cs.mtech.edu

Secret  wri+ng:  branches  

18  

Secret  wri)ng  

Steganography  (hidden)  

Cryptography  (scrambled)  

Subs)tu)on  

Transposi)on  

Code  (replace  words)  

Cipher  (replace  le=ers)  

Code  word   Meaning  

10-­‐4   Acknowledgement  (OK)  

10-­‐10   Fight  in  progress  

10-­‐11   Dog  case  

10-­‐20   Loca+on  

10-­‐30   Unnecessary  use  of  radio  

10-­‐54   Livestock  on  highway  

Page 19: Secretwring - katie.cs.mtech.edu

Transposi+on  •  Transposi+on  ciphers  – Rearrange  posi+on  of  leDers  – OWC  =  ???  – Exhaus+vely  enumerate:  

•  owc,  cow,  cwo,  ocw,  wco,  woc  •  3!  =  6  ways  

19  

Page 20: Secretwring - katie.cs.mtech.edu

Transposi+on  •  Transposi+on  ciphers  – Rearrange  posi+on  of  leDers  – OBDTRPCLTEEUSEO  =  ???????????????  – May  be  mul+ple  words,  with  spaces  deleted  – Exhaus+vely  enumerate:  

•  obdtrpclteeuseo,  obdtrpclteeusoe,  obdtrpclteeueso,  …  •  15!  =  1,307,674,368,000  

•  Random  transposi+on  imprac+cal    – Sender  &  receiver  must  follow  some  sort  of  rules  

20  

hDp://www.counton.org/explorer/codebreaking/transposi+on-­‐ciphers.php  

Page 21: Secretwring - katie.cs.mtech.edu

Scytale  •  Scytale  – Encode:  message  wriDen  on  strip  of  leather  

• While  wrapped  around  staff  of  certain  diameter  • When  removed  unreadable  •  Also  wearable  as  a  fashionable  belt  (steganography)  

– Decode:  wrap  around  staff  of  same  diameter  

21  

Page 22: Secretwring - katie.cs.mtech.edu

Rail  fence  cipher  

22  

•  Rail  fence  cipher  – Transposi+on  cipher  – Used  during  Civil  War  – DULTPERTOBEOSCE  

Page 23: Secretwring - katie.cs.mtech.edu

Rail  fence  cipher  

23  

•  Rail  fence  cipher  – Transposi+on  cipher  – Used  during  Civil  War  – DULTPERTOBEOSCE  

   

– DBTSROLOEEUEPCT  

d   u   l   t   p   e   r   t  o   b   e   o   s   c   e  

d   b   t   s   r  o   l   o   e   e  

u   e   p   c   t  

Page 24: Secretwring - katie.cs.mtech.edu

Route  cipher  •  Route  cipher  – Transposi+on  cipher  – Like  rail  fence  but  with  more  keys  – Ciphertext:  EJXCTEDECDAEWRIORFEONALEVSE  – Key  =  9  x  3  grid,  spiral  inwards,  clockwise,  star+ng  top-­‐right  

– We  are  discovered  flee  at  once  (jx)  24  

W   R   I   O   R   F   E   O   E  E   E   S   V   E   L   A   N   J  A   D   C   E   D   E   T   C   X  

Page 25: Secretwring - katie.cs.mtech.edu

Column  transposi+on  •  Like  rail  fence,  but  with  a  password  – Ciphertext:  EVLNE  ACDTK  ESEAQ  ROFOJ  DEECU  WIREE  – Password:  ZEBRAS  

•  Length  6  =  each  row  has  6  columns  •  Alphabe+cal  order  of  leDers:  6  3  2  4  1  5  

 

25  

6   3   2   4   1   5  

E  V  L  N  E  

A  C  D  T  K  

R  O  F  O  J  

D  E  E  C  U  

E  S  E  A  Q  

W  I  R  E  E  

Page 26: Secretwring - katie.cs.mtech.edu

Transposi+on  cipher  summary  •  Transposi+on:  rearrange  leDers  in  some  way  

•  But:  no  changes  to  overall  distribu+on  of  leDers!  – Cryptanalysis:  

•  Usage  is  easy  to  detect  –  Compare  with  frequency  of  leDers  in  the  language  

•  Par+al  decryp+on  yields  some  sensible  text  •  Subject  to  op+miza+on  techniques:    

–  e.g.  Simulated  annealing    –  e.g.  Gene+c  algorithms  

26  

Page 27: Secretwring - katie.cs.mtech.edu

Subs+tu+on  •  Subs+tu+on  ciphers  – Replace  one  leDer  with  another  – e.g.  A-­‐>D  – Kama  Sutra  #45:  Art  of  Secret  Wri+ng  

•  Conceal  details  of  secret  liaisons  •  Pair  leDers  at  random  

27  

Page 28: Secretwring - katie.cs.mtech.edu

Caesar  cipher  •  Caesar's  cipher  – a.k.a.  Shis  cipher,  Caesar's  code,  Caesar  shis  – Used  a  shis  of  three  to  protect  military  communica+on  

28  

"If  he  had  anything  confiden+al  to  say,  he  wrote  it  in  cipher,  that  is,  by  so  changing  the  order  of  the  leDers  of  the  alphabet,  that  not  a  word  could  be  made  out.  If  anyone  wishes  to  decipher  these,  and  get  at  their  meaning,  he  must  subs+tute  the  fourth  leDer  of  the  alphabet,  namely  D,  for  A,  and  so  with  the  others."  -­‐Suetonius,  Life  of  Julius  Caesar  

hDp://www.counton.org/explorer/codebreaking/caesar-­‐cipher.php  

Page 29: Secretwring - katie.cs.mtech.edu

Breaking  Caesar's  cipher  •  If  you  know  cipher  is  a  Caesar  shis:  – Try  all  25  possible  shiss  

•  Only  one  is  probably  non-­‐gibberish  – Look  at  frequency  distribu+on  of  leDers    

•  Compare  with  leDer  distribu+on  of  language  •  Find  shis  that  makes  ciphertext  distribu+on  match  

29  

Page 30: Secretwring - katie.cs.mtech.edu

Summary  •  Secret  wri+ng  – Steganography:  hiding  the  message  

•  Analog  forms  of  hiding  or  making  invisible  •  Digital  forms  of  hiding  in  data,  events,  etc  

– Cryptography:  scrambling  the  message  •  Transposi+on  ciphers  •  Subs+tu+on  ciphers  

–  Caesar's  shis  cipher  

30