Skip to main content
explanation added
Source Link

PHP, 133 bytes, cracked by Dennis

Easy one : (numbers are separated by pipe symbol)

for 
(
 putenv("num=".(int)(bool)NO); 
 getenv ("num") <= 100; 
 putenv("num=". (getenv("num") + 1))
)
 printf("%d|", getenv("num"));

Catch :

  1. No PHP variables in FOR loop

  2. Code is made to be C-like syntax

  3. Objective-C has macro named NO which is 0.

  4. PHP has strange syntax construct "define without define" :
    if interpreter finds unqualified token in code - it assumes that this token is an undefined constant and because it's value is unknown - value is taken from token name converted to a string constant. That's why NO get's interpreted as 'NO' and because all non-empty strings in PHP means true when converted to boolean - integer 1 is saved into environment variable in FOR loop initialization part. Fortunately this PHP behavior is now a deprecated feature

  5. The only thing which truly reaveals that it is PHP code snippet - string concatenation operator . If PHP would have function strcat() like C does - hiding dot from the reader would make code more inseparable from a C syntax.

PHP, 133 bytes, cracked by Dennis

Easy one : (numbers are separated by pipe symbol)

for 
(
 putenv("num=".(int)(bool)NO); 
 getenv ("num") <= 100; 
 putenv("num=". (getenv("num") + 1))
)
 printf("%d|", getenv("num"));

PHP, 133 bytes, cracked by Dennis

Easy one : (numbers are separated by pipe symbol)

for 
(
 putenv("num=".(int)(bool)NO); 
 getenv ("num") <= 100; 
 putenv("num=". (getenv("num") + 1))
)
 printf("%d|", getenv("num"));

Catch :

  1. No PHP variables in FOR loop

  2. Code is made to be C-like syntax

  3. Objective-C has macro named NO which is 0.

  4. PHP has strange syntax construct "define without define" :
    if interpreter finds unqualified token in code - it assumes that this token is an undefined constant and because it's value is unknown - value is taken from token name converted to a string constant. That's why NO get's interpreted as 'NO' and because all non-empty strings in PHP means true when converted to boolean - integer 1 is saved into environment variable in FOR loop initialization part. Fortunately this PHP behavior is now a deprecated feature

  5. The only thing which truly reaveals that it is PHP code snippet - string concatenation operator . If PHP would have function strcat() like C does - hiding dot from the reader would make code more inseparable from a C syntax.

added 75 characters in body
Source Link
Maya
  • 5.7k
  • 1
  • 26
  • 39

#?, 133 bytes

PHP, 133 bytes, cracked by Dennis

Easy one : (numbers are separated by pipe symbol)

for 
(
 putenv("num=".(int)(bool)NO); 
 getenv ("num") <= 100; 
 putenv("num=". (getenv("num") + 1))
)
 printf("%d|", getenv("num"));

#?, 133 bytes

Easy one : (numbers are separated by pipe symbol)

for 
(
 putenv("num=".(int)(bool)NO); 
 getenv ("num") <= 100; 
 putenv("num=". (getenv("num") + 1))
)
 printf("%d|", getenv("num"));

PHP, 133 bytes, cracked by Dennis

Easy one : (numbers are separated by pipe symbol)

for 
(
 putenv("num=".(int)(bool)NO); 
 getenv ("num") <= 100; 
 putenv("num=". (getenv("num") + 1))
)
 printf("%d|", getenv("num"));
Source Link

#?, 133 bytes

Easy one : (numbers are separated by pipe symbol)

for 
(
 putenv("num=".(int)(bool)NO); 
 getenv ("num") <= 100; 
 putenv("num=". (getenv("num") + 1))
)
 printf("%d|", getenv("num"));