[Cryptography] "Flip Feng Shui: Hammering a Needle in the Software Stack"

Florian Weimer fw at deneb.enyo.de
Sat Sep 3 05:30:54 EDT 2016


* Natanael:

> I saw this linked on Hacker News yesterday;
>
> https://github.com/mame/radiation-hardened-quine
>
> Flip ANY bit, the code still behaves exact the same.

It doesn't work this way.  Deletions are not bit flips.

$ diff -u rquine.rb rquine-flipped.rb
--- rquine.rb	2016-09-03 11:28:14.548923861 +0200
+++ rquine-flipped.rb	2016-09-03 11:28:37.929435698 +0200
@@ -6,7 +6,7 @@
 182845904;          _987654321          0;;eval)+?
 @*18+%("x            =((#{s.s            um}-eval.
 _sum)%256             ).chr;             ;eval)+?@
-*12+%(.s             can(//){             a=$`+x+$
+*32+%(.s             can(//){             a=$`+x+$
 ^_a.unpa            ck      (^            H*^)[0].
 hex%999989==#{s.unpac        k("H*")[0].hex%999989
 }&&eval(a)}#"##"_eval        @eval####@(C)@Copyrig
$ diff -u rquine.rb <(ruby rquine-flipped.rb)
--- rquine.rb	2016-09-03 11:28:14.548923861 +0200
+++ /dev/fd/63	2016-09-03 11:29:59.671225153 +0200
@@ -6,7 +6,7 @@
 182845904;          _987654321          0;;eval)+?
 @*18+%("x            =((#{s.s            um}-eval.
 _sum)%256             ).chr;             ;eval)+?@
-*12+%(.s             can(//){             a=$`+x+$
+*32+%(.s             can(//){             a=$`+x+$
 ^_a.unpa            ck      (^            H*^)[0].
 hex%999989==#{s.unpac        k("H*")[0].hex%999989
 }&&eval(a)}#"##"_eval        @eval####@(C)@Copyrig
@@ -15,7 +15,7 @@
 /#{eval eval if eval          .size>692}}#LMNOPQRS
 ##thx.flagitious!##            TUVWXY/.i rescue##/
 3141592653589793+                +271828182845904;
-9876543210;;eval                  "x=((42737-eval.
-sum)%256).chr;;eval            .scan(//){a=$`+x+$'
-a.unpack('H*')[0].hex%999989==68042&&eval(a)}#"##"
+9876543210;;eval                  "x=((42739-eval.
+sum)%256).chr;;eval                                .scan(//){a=$`+x+$'
+a.unpack('H*')[0].hex%999989==230293&&eval(a)}#"##"
 eval eval#### (C) Copyright 2014 Yusuke Endoh ####


More information about the cryptography mailing list