{"id":2154,"date":"2016-07-06T18:22:04","date_gmt":"2016-07-06T16:22:04","guid":{"rendered":"https:\/\/www.asafety.fr\/?p=2154"},"modified":"2016-07-25T00:32:40","modified_gmt":"2016-07-24T22:32:40","slug":"wargame-ndh-2016-write-up-crypto-one-too-many","status":"publish","type":"post","link":"https:\/\/www.asafety.fr\/en\/cryptologie\/wargame-ndh-2016-write-up-crypto-one-too-many\/","title":{"rendered":"[WARGAME NDH 2016] Write-Up \u2013 Crypto: One too many"},"content":{"rendered":"<p><\/p>\n<p style=\"text-align: center;\"><strong>Write-up of the challenge \u201cCrypto\u00a0\u2013 One too many\u201d of Nuit du\u00a0Hack 2016\u00a0Wargame<\/strong><\/p>\n<p>The weekend of 02-03 july 2016\u00a0is the WARGAME of the\u00a0<strong><a href=\"https:\/\/nuitduhack.com\/fr\/\" target=\"_blank\">Nuit du Hack 2016<\/a><\/strong>\u00a0as a <strong>Jeopardy CTF<\/strong>. Having had the opportunity and the time to participate with some colleagues and friends, here\u2019s a write-up resolution of the challenges which we could participate.<\/p>\n<ul>\n<li>Category:\u00a0<strong>Crypto<\/strong><\/li>\n<li>Name: <strong>One too many<\/strong><\/li>\n<li>Description : <em>We encrypted both parts of the flag with our revolutionary two-time-pad technique! Are you able to recover it?<\/em><\/li>\n<li>URL : http:\/\/static.wargame.ndh\/one_too_many_1.png and\u00a0http:\/\/static.wargame.ndh\/one_too_many_2.png<\/li>\n<li>Points : <strong>10<\/strong><b>0<\/b><\/li>\n<\/ul>\n<p style=\"text-align: center;\"><strong>tl;dr : <strong>one_too_many_1.png XOR\u00a0one_too_many_2.png (convert tool on kali)<\/strong><\/strong><\/p>\n<p>Two PNG images are provided to us for this challenge:<\/p>\n<div id=\"attachment_2156\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/one_too_many_1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2156\" class=\"size-medium wp-image-2156\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/one_too_many_1-300x108.png\" alt=\"one_too_many_1\" width=\"300\" height=\"108\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/one_too_many_1-300x108.png 300w, https:\/\/www.asafety.fr\/wp-content\/uploads\/one_too_many_1.png 500w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-2156\" class=\"wp-caption-text\">one_too_many_1<\/p><\/div>\n<div id=\"attachment_2155\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/one_too_many_2.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2155\" class=\"size-medium wp-image-2155\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/one_too_many_2-300x108.png\" alt=\"one_too_many_2\" width=\"300\" height=\"108\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/one_too_many_2-300x108.png 300w, https:\/\/www.asafety.fr\/wp-content\/uploads\/one_too_many_2.png 500w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-2155\" class=\"wp-caption-text\">one_too_many_2<\/p><\/div>\n<p>The technique of &#8220;One-Time-Pad&#8221; was used to encrypt\u00a0these images, and the key is identical between the two ciphers (two-time-pad).<\/p>\n<p>The following relationship follows:<\/p>\n<pre>one_too_many_1.png = one_too_many_1_original.png XOR OTP\r\none_too_many_2.png = one_too_many_2_original.png XOR OTP\r\n \r\none_too_many_1.png XOR\u00a0one_too_many_2.png =\u00a0one_too_many_1_original.png XOR\u00a0one_too_many_2_original.png<\/pre>\n<p>A simple <a href=\"https:\/\/www.google.fr\/search?q=xor+picture&amp;oq=xor+picture&amp;aqs=chrome..69i57j0l3.1456j0j7&amp;sourceid=chrome&amp;ie=UTF-8\" target=\"_blank\">Google<\/a> search on a fast method to XOR two images, brings us to this <a href=\"https:\/\/stackoverflow.com\/questions\/8504882\/searching-for-a-way-to-do-bitwise-xor-on-images\" target=\"_blank\">topic<\/a>, which details the use of the command &#8220;convert&#8221;. The methodology is applied:<\/p>\n<pre>convert one_too_many_1.png one_too_many_2.png -fx \"(((255*u)&amp;(255*(1-v)))|((255*(1-u))&amp;(255*v)))\/255\" one_too_many_flag.png<\/pre>\n<p>And the flag is displayed\u00a0:\u00a0<strong>ndh2k16_88bcb95612bf8207da083e784f1855b8<\/strong><\/p>\n<div id=\"attachment_2157\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/one_too_many_flag.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2157\" class=\"size-medium wp-image-2157\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/one_too_many_flag-300x108.png\" alt=\"one_too_many_flag\" width=\"300\" height=\"108\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/one_too_many_flag-300x108.png 300w, https:\/\/www.asafety.fr\/wp-content\/uploads\/one_too_many_flag.png 500w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-2157\" class=\"wp-caption-text\">one_too_many_flag<\/p><\/div>\n<p>Thank you to all the team of the NDH2K16 for this event and for the whole organization!<\/p>\n<p>Greeting to\u00a0<a href=\"http:\/\/www.information-security.fr\/\" target=\"_blank\">nj8<\/a>, <a href=\"http:\/\/0xbadcoded.com\/\" target=\"_blank\">St0rn<\/a>, <a href=\"http:\/\/www.georgestaupin.com\/\" target=\"_blank\">Emiya<\/a>, Mido, downgrade,\u00a0Ryuk@n and\u00a0rikelm, ?\u00a0\/\/ Gr3etZ<\/p>","protected":false},"excerpt":{"rendered":"<p>Write-up of the challenge \u201cCrypto\u00a0\u2013 One too many\u201d of Nuit du\u00a0Hack 2016\u00a0Wargame The weekend of 02-03 july 2016\u00a0is the WARGAME [&hellip;]<\/p>\n","protected":false},"author":1337,"featured_media":2112,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58,57,56,524,523,526,527,525],"tags":[504,470,243],"class_list":["post-2154","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cryptanalyse","category-cryptographie","category-cryptologie","category-ctf","category-events","category-ndh","category-ndh2k16","category-wargame","tag-one-time-pad","tag-steganography","tag-xor"],"_links":{"self":[{"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/posts\/2154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/users\/1337"}],"replies":[{"embeddable":true,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/comments?post=2154"}],"version-history":[{"count":7,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/posts\/2154\/revisions"}],"predecessor-version":[{"id":2164,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/posts\/2154\/revisions\/2164"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/media\/2112"}],"wp:attachment":[{"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/media?parent=2154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/categories?post=2154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/tags?post=2154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}