Tags: stegano 

Rating:

## 50 - Twins - Stegano

> Two brothers separated long ago, finally decide to reunite
>
> Each one holds the secret key, but needs the other brother to read it.
>
> Can you find their hidden secret?

We have two text files doing the same length:

```
$ cat tmp/file1
it>J1%}F(0)9o4}-hld<xY3P3s,kcJx9!ajA|_XXgOl34gDOJ5thx[JewFa8rJP@iq_>$]Ucgw#}1I*GZv4jR5VyJ7^Z#KWQv9%*<Nk^$>ZuT%<LpeWyk}&o((OH1KqDG)d]Q1Ss}C0[5}r}E<-DS.E6^{{SmR9Sell%iZvKxdc-w-Z?ouij_t91S_e^<U|5EF.&tEWRY8U1WA)GpV9ZlV[W)TAI9#vqte@*?uHbTwML0}xxB[k^,!!2C{%C8<>_uW7p6dYI10M8_K$hcfM@tdpJ^xm9R0<I6c](]4>&oy.?*u{qbNRB50(,)I$fcRSO<8kU.}@J#Ii,K_$vj?LYZhfVdD8f8ZepnFXV%Q.^C<vdiWuOR3ps5b_WobBb7AL$!}q8H]$OwEjk<Rj^yno*5BZK00f.nTgY&.tE*%0?cnXhN*vJZiyhLAu7N%6M0s%mHgGWkhDcJ7jTe<F$-_Z]vXEJ(<c9W^ug]l*6Rgj^k^D)EFb),B?YAGngkwJ?4_FQ{&p0Nn&]OgCB#&)a,oM>_7hOSASpW-24c(8(AKce26oZBbBj(Thz.{i7zb{vwzGfSV>JsW,C&ikBYHC%0TpP0MNXH5?@uq&jTA_t$@u?BJXa?!I_UCdf}]ql?.XH$e9vc)tQ4|hMazm?-n*2aiv<Y!-k<Xcx[4K2Grk!I-Bt<CMc)f|B8VrCQFLK}^wk$2E_V5,.Yh}_v{9&T$4tpyz,c#1TSeQ4^QvrZr{NX@e&Ia]$7(78FFGdz)W-7[<Tdy0WpT0f)*AWnK|KggNP?V[QkL({tYi0&WIUZuU!q?1x%JhLu.U}Y!CaZoMY8eiYA-48R-sxq<d%cVG*dTX$u3{?I!Ji?FrW?yy_(Og^}dIx((ahiB$-_SHB$xc^y>#3ab|^|L8D1bnBQkbR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t[3e%C!,%-SQ]$ablGWqgzP^&M?m0<J2U,Me5xb]sfyfBTj6L8g<rI8(vQUlly.3{re#oGkJqvZECueyAbxHt<dNc?tn2C*D6-8<5H1-u|5v5sLVGZI*v8lY8AWZ--G9Rw.%LVI[efs2D,QE7cP*Qs*.@1a3}e9VyL!3hkWfSJ0RI7qKZqICY|0@OjMebt6>0QQDoCZxE&,}3%47$}H>ZpN^(txBN9b80niStA20K94q]pk7!.HikeY-5Icmm(hiT^(ClsoINWqxcemNvQ.i|Xv)kAwGz{Uca{*Y&CmiY?vb(CROd01aKisjo([cyhE1b7^Pdwbyd_tU}*kHi7SPCC<US)EjE%K!c?p7fb!5yT]DR}i1}.<b>mK1GA]5L.?nNsQz[b1A46bV^U?i5Olke
```

First we tried to xor them but we had nothing in output. So OddCoder had an idea: keeping only identical character at a same index.

He made a python script but for fun I decided to make a shorter and cleaner ruby script:

```ruby
file1 = File.read('tmp/file1')
file2 = File.read('tmp/file2')

puts file1.each_char.zip(file2.each_char).select { |a,b| a == b }
```

Flag was `d4rk{lo0king_p4st_0ur_d1ff3renc3s}c0de`.