18
\$\begingroup\$

Robbers Thread
Cops, your task is to chose a program that prints a string (you can choose). Although, if you change 1 character in your code, it should print another string.

But there's a twist: You should make your code hard to read, so that the robbers can't find your "changeable" character.

The winner cop is the user, with the shortest answer that wasn't cracked for a week.
If your submission wasn't cracked for a week, please reveal your character.

Cops, please include the output that should be printed if that specific character is changed in your code.

I will declare the winner cop and robber a week after this challenge is posted.

Example submission (very easy to understand)

# [Vyxal](https://github.com/Vyxal/Vyxal), 8 bytes, prints a and b

1[`a`|`b

[Try it Online!](https://lyxal.pythonanywhere.com?flags=&code=1%5B%60a%60%7C%60b&inputs=&header=&footer=)
\$\endgroup\$
15
  • 1
    \$\begingroup\$ @Shaggy It should output the string that the cop must have referenced in their post. Editing it. \$\endgroup\$
    – math
    Jul 15 at 10:32
  • 5
    \$\begingroup\$ But all answers can be trivially brute forced, using the exact same algorithm... how much time did you spend thinking before posting this? Did you post this to the sandbox? \$\endgroup\$ Jul 15 at 11:28
  • 4
    \$\begingroup\$ @thedefault. in a Turing-complete language, this provably cannot be brute-forced in the general case. Just write a program that does some complicated looping and you'll never brute-force it \$\endgroup\$
    – pxeger
    Jul 15 at 14:11
  • 1
    \$\begingroup\$ This seems like a very boring CnR, any answer will either be trivially brute forceable or take advantage of some weird unicode + halting problem thing that makes it very tedious and not really easily doable by a human anyway. \$\endgroup\$ Jul 15 at 21:51
  • 5
    \$\begingroup\$ @pxeger Actually, if you use dovetailing you can always find the solution in finite time provided that one exists. Just run all the programs concurrently. The correct solution will eventually halt, and when it does you can stop execution. \$\endgroup\$
    – Grain Ghost
    Jul 17 at 13:42

44 Answers 44

1
2
2
\$\begingroup\$

Japt, 10 bytes, cracked by dingledooper

"1,2"k@X+2

Try it online!

The intended output is 3.4. I have no idea how hard this is to crack, since I barely know any Japt, but hopefully it's not too easy.

\$\endgroup\$
5
  • \$\begingroup\$ I shall be leaving this one for others to attempt :) \$\endgroup\$
    – Shaggy
    Jul 17 at 19:39
  • \$\begingroup\$ @Shaggy Ah, so it is easy? :P \$\endgroup\$
    – rues
    Jul 17 at 19:39
  • 1
    \$\begingroup\$ as with my 2nd solution, when you know how ;) I think most people will figure out what needs to be done quite easily, but less so how to do it. (Sidenote: you could actually golf 2 bytes off this, but I shan't say what they are yet for fear of helping anyone solve it) \$\endgroup\$
    – Shaggy
    Jul 17 at 19:42
  • 1
    \$\begingroup\$ Even if it weren't easy, though, I would have left it for others to attempt. \$\endgroup\$
    – Shaggy
    Jul 17 at 19:46
  • 1
    \$\begingroup\$ Cracked \$\endgroup\$ Jul 18 at 2:24
2
\$\begingroup\$

R, 77 bytes, cracked by tsh

PO=0
TA=TO =min(0 * 0 * 0, FALSE, 0 * 0 * 0)
if(TA|TO&TA&TO)PO=18
LETTERS[PO]

Try it online!

As usual, the string to output is "R".


A previous version of this challenge allowed an unintended crack, found by Dominic van Essen:

R, 71 bytes

PO=0
TA=TO =min(0 * 0 * 0, FALSE, 0 * 0 * 0)
if(TA|TO)PO=18
LETTERS[PO]

Try it online!

\$\endgroup\$
8
  • \$\begingroup\$ Cracked!... \$\endgroup\$ Jul 18 at 17:40
  • \$\begingroup\$ Sorry... I've been trying to think-up my own challenges, so I've got a head full of 'tricks' ready to test... \$\endgroup\$ Jul 18 at 17:42
  • 1
    \$\begingroup\$ @DominicvanEssen Nice find! That's not the intended crack, so I've edited in a variation which is immune to your crack. (Doing this rather than posting a new challenge, to avoid completely overwhelming this thread with R answers!) \$\endgroup\$ Jul 18 at 21:54
  • 1
    \$\begingroup\$ Is this work?, another intended crack? \$\endgroup\$
    – tsh
    Jul 19 at 2:00
  • 1
    \$\begingroup\$ @DominicvanEssen I won't post it, as I might be able to recycle the idea into a vastly different challenge. :-) Let me know if/when you find it! \$\endgroup\$ Jul 19 at 8:49
2
\$\begingroup\$

><>, 536 bytes, Cracked by ovs

\\ /   \  /  9    \
/\     /  /\  /   \\
    / 1/  \       \\\
\\ //  \  \\  /    \\\
 \\  /\ / \\\/ \   \\\\
 ///  \\   \ \//   // \\
/ /\  \\\ \/ \\ \  \\/ /
\\ / \  \\     /\\ // /
//  /     \\\   \\ \ \  \
\\\  /\\/// \ \\// /  \ +
///\ /\/\/ //   /    /
\\/\\/\/\/ / /// / /3 / n\
// \\     /         \ / /
  \ \/\/\/ / // // \/ /  /
\\  //\/\/ / / /  / ;
   \//\/\\ /\/\ /     /
 \  \    \//\ /    \/
 /       //  \ ///
/\\/\/ /\///\\ //
  \/\/
  //\\//\/     \\
 \\  \/    /\/ /\\
\ \  \/  \\  /  //
  \  \/  \/
     \     /\/ \/

Try it online!

A literal maze of mirrors.

My intended solution was:


\\ /   \  /  9    \
/\     /  /\  /   \\
    / 1/  \       \\\
\\ //  \  \\  /    \\\
 \\  /\ / \\\/ \   \\\\
 ///  \\   \ \//   // \\
/ /\  \\\ \/ \\ \  \\/ /
\\ / \  \\     /\\ // /
//  /     \\\   \\ \ \  \
\\\  /\\/// \ \\// /  \ +
///\ /\/\/ //   /    /
\\/\\/\/\/ / /// / /3 / n\
// \\     /         \ / /
  \ \/\/\/ / // // \/ /  /
\\  //\/\/ / / /  / ;
   \//\/\\ /\/\ /     /
 \  \    \//\ /    \/
 /       //  \ ///
/\\/\/ /\///\\ //
  \/\X
  //\\//\/     \\
 \\  \/    /\/ /\\
\ \  \/  \\  /  //
  \  \/  \/
     \     /\/ \/
where the X is a \, and originally was a /.

Execution paths:

enter image description here

I'm not sure if this makes it more understandable or more confusing.

Red is path before the split, yellow is original, orange is correct path.

\$\endgroup\$
1
  • \$\begingroup\$ Cracked \$\endgroup\$
    – ovs
    Jul 26 at 10:05
2
\$\begingroup\$

Julia 1.x, 53 bytes, Cracked by Robin Ryder

show(sum(count.(==('1'),bitstring.(Int16[9973%36]))))

Try it online!

should output 5

\$\endgroup\$
1
1
\$\begingroup\$

Jelly, 254 bytes (cracked by the default.)

“5gỊƑ!ṆḥḌ³`⁻Ɓc?Ạ°þạḅI§Ɠ¦mṪ9ʂ:Nȯx1®Ḟ ƭḣTsÄẉṭ7|ẏẋzⱮɦḲ⁵.ṗbÐɱ8Ñ3"Øȧ¡Ė÷ʠ\¬ṇƥṀœṙRṅẈɓẒ#Ẏỵ⁼Ȧ©MỴƤ⁷ẹ⁴ż;OṃċẊnFḶ¤ȤḟỤẇçİ/ƒjƬhƙA2PẸtX¿ṢḢṡyiṂCd)ÆṣĠʋŒ-ė~YZ⁾ĿṘ²ŀ'ṄLȷU£BSƲɼṛñ½ȥÞ6pḂæ×ẆɠG4ịı$EƊ¹¥ḃɗ}DK]u*ġṚk⁹ɲḊµṾW+,ȧwß⁺⁸0ọv(<Ɲṁḍl=Q+ð@Çø[Żṫoera&Ọ¢Vḷ¶Ṗ€ƈḋ{⁶ƇĊqḄHḳJ⁽Ȯ%>^ḤṠfƘṬ‘Œ¿

Try It Online!

The output should be:

690699296939718117350621606422816362267173158421165414491974510998788124940831200375657067696758989277663531427881606883007285313136136830578271394860909143130892610035752665368298072483371326623846259135567658705756844088966332891398225673436164647788793408591250973256547482034045337013090045826070073469995435050529779518827764039871801756995315995194485429761879045854501788974715014302780100588547060896111645050429507146677667643527115067082983636640551198432670539417621925424456729027

I imagine this shouldn't be difficult, even just to brute-force with Jelly's SBCS like someone in chat pointed out. I am working on a solution that will be slow to verify so that it is not brute-forceable (even though I don't think any of the other solutions have been brute-forced, I want to try this just for proof of concept), and using permutations or powersets is probably a good approach.


The intended intended solution was to reverse the permutation index. However, for whatever reason, generating a random permutation of 1..250 and indexing into the codepage gave me a duplicate, so I'm not sure if I copy-pasted the wrong string or I'm just really fucking stupid.

Either way, brute-force crack would be the only valid solution since I messed up the format.

\$\endgroup\$
3
  • \$\begingroup\$ Cracked (by brute force). \$\endgroup\$ Jul 16 at 16:51
  • \$\begingroup\$ I haven't used the permutation for index built-in because your string has two repetitions: + appears both on positions 191 and 209, and ȧ appears both at 61 and 193 (so it is impossible for the correct input to be a permutation, and thus the 'find a permutation' built-in can't be helpful). In practice, it fails as expected (it returns an input that differs at 2 positions instead of 1) \$\endgroup\$ Jul 16 at 17:10
  • \$\begingroup\$ @thedefault. wait... what? ... I literally had jelly generate me a random permutation of 1..250... oh well, good crack then \$\endgroup\$
    – hyper-neutrino
    Jul 16 at 17:13
1
\$\begingroup\$

R, 48 bytes, cracked by pxeger

x=z=6
y=0
while(x+y-1>y){x=x-1;z=z+1}
LETTERS[z]

Try it online!

Once again, the string to output is "R".

I think and hope the solution is unique, but I might have missed something. Edit: indeed I had missed something...

\$\endgroup\$
2
  • \$\begingroup\$ Cracked \$\endgroup\$
    – pxeger
    Jul 16 at 18:26
  • \$\begingroup\$ @pxeger Well done! That's not what I had intended, but I was scared I might have missed something like that. Back to the drawing board... \$\endgroup\$ Jul 16 at 18:46
1
\$\begingroup\$

Brainf***, 51 bytes - cracked by dingledooper

++++++++++[>+++++++++++<-]>++.-------.+++++.++++++.

Try it Online!

Right now it outputs pint. Can you make it output ohms?

\$\endgroup\$
2
  • \$\begingroup\$ Cracked \$\endgroup\$ Jul 21 at 3:59
  • \$\begingroup\$ Wow, not even ten minutes! Good job! \$\endgroup\$ Jul 21 at 4:02
1
\$\begingroup\$

J, 7 bytes, cracked by Adám

13024e0

Try it online!

Outputs 13024. Cracked solution should output 69420 instead.

\$\endgroup\$
1
  • \$\begingroup\$ Cracked. \$\endgroup\$
    – Adám
    Jul 21 at 7:39
1
\$\begingroup\$

Labyrinth, 7 bytes, cracked by m90

999
!!@

Try it online!

Outputs 99. Change it to 9900.

\$\endgroup\$
1
  • \$\begingroup\$ Cracked. \$\endgroup\$
    – m90
    Jul 21 at 10:44
1
\$\begingroup\$

Yggdrasil, 3 bytes, cracked by A username

;.:

Try it online!

Solution should print ..:.

\$\endgroup\$
1
1
\$\begingroup\$

Vyxal, 14 bytes, Cracked by Aaron Miller

‛ø»:K:Ẋf∑$βS2Ẏ

Try it Online!

Should output 14.

My intended solution was:

»ø»:K:Ẋf∑$βS2Ẏ

I'm quite surprised that changing the word worked, my intention was changing it to a number, where the output would be 1412 before slicing.

\$\endgroup\$
1
1
\$\begingroup\$

brainfuck, 29 bytes, Cracked by ovs

.+[.[->+>+<<]+[>--<+++++]>+<]

Try it online!

Should output

�:sIX=1
×}ð :kAH%  ÊoÕàQͺ#y8M!
ÇmÐÙEºñ(µyÊßEÀ¡ý:Ó©]
·]°©õ:Ë¡EéÊOµ ñ-ºÙøm
§My¥ºûQèÕYÊ¿%A]:3 Ø}ñ
=pIU:+ÈeÉÊ/`ºã9¸á
-Pº[±¨õ9Ê@á½:iÑ
w0éµ:a©Êu 1íºCx­Á
g
¹eº»hÊå

SE swallowed some unprintables, so here's a hexdump:

00000000: 0001 c29d 3a73 4958 3d31 0ac3 977d c3b0  ....:sIX=1...}..
00000010: 09c2 953a 6b41 4825 09c3 8a6f c395 c3a0  ...:kAH%...o....
00000020: 51c3 8dc2 ba23 7938 4d21 0ac3 876d c390  Q....#y8M!...m..
00000030: c399 45c2 bac2 9bc3 b128 c2b5 79c3 8ac3  ..E......(..y...
00000040: 9f45 c380 c2a1 c3bd 3ac3 93c2 a918 5d11  .E......:.....].
00000050: 0ac2 b75d c2b0 c2a9 c3b5 3ac3 8bc2 a108  ...]......:.....
00000060: 45c3 a9c3 8a4f c2b5 20c3 b12d c2ba c283  E....O.. ..-....
00000070: c399 c3b8 6d01 0ac2 a74d c290 79c2 a5c2  ....m....M..y...
00000080: bac3 bb51 c3a8 c395 59c3 8ac2 bf25 c280  ...Q....Y....%..
00000090: 415d 3a33 09c3 987d c3b1 0ac2 973d 7049  A]:3...}.....=pI
000000a0: 553a 2b01 c388 65c3 89c3 8a2f c295 60c2  U:+...e..../..`.
000000b0: 91c2 8dc2 bac3 a339 c2b8 c28d c3a1 0ac2  .......9........
000000c0: 872d 5019 05c2 ba5b c2b1 c2a8 c3b5 39c3  .-P....[......9.
000000d0: 8ac2 9f05 40c3 a1c2 bd3a c293 69c2 98c2  ....@....:..i...
000000e0: 9dc3 910a 771d 30c3 a9c2 b53a c28b 61c2  ....w.0....:..a.
000000f0: 88c2 85c2 a9c3 8a0f 7520 31c3 adc2 ba43  ........u 1....C
00000100: c299 78c2 adc3 810a 670a 10c2 b965 c2ba  ..x.....g....e..
00000110: c2bb 1168 1519 c38a 7fc3 a5              ...h.......

And no, I don't know how I got this result.

\$\endgroup\$
3
  • \$\begingroup\$ Are you sure your hexdump is correct? This seems to produce the same output, but is missing a few bytes \$\endgroup\$
    – ovs
    Aug 15 at 10:20
  • \$\begingroup\$ @ovs Yes, that is correct. I copied-and-pasted the output, so some bytes must've got lost in the process. \$\endgroup\$
    – emanresu A
    Aug 15 at 10:32
  • \$\begingroup\$ posted it \$\endgroup\$
    – ovs
    Aug 15 at 10:57
1
\$\begingroup\$

JavaScript (REPL), 17 bytes

a=!![],a++,a+=![]

Edit : Actually output "2", should output 3 when the good char is modified

(not sure if the console.log was required or not...)

https://jsconsole.com/

\$\endgroup\$
4
  • \$\begingroup\$ A cop submission to this challenge must include an intended output string the robber should get. \$\endgroup\$
    – Bubbler
    Nov 11 at 0:41
  • \$\begingroup\$ I've added that ! :) \$\endgroup\$
    – Nicolas B
    Nov 11 at 0:47
  • \$\begingroup\$ Welcome to Code Golf! This is a pretty tough cop, I've been trying for a little while to crack it. I don't think you need the console.log, although the question's a little unclear. \$\endgroup\$ Nov 11 at 0:58
  • \$\begingroup\$ Cracked \$\endgroup\$
    – emanresu A
    Nov 11 at 4:10
0
\$\begingroup\$

PHP 7.4.2 - 23 bytes

echo md5("leetspeak!");

Let's go for another try ! :)

This one should output

20bff2eab610b29d183a363727b9bfb5

if correctly modified

https://wtools.io/php-sandbox

\$\endgroup\$
1
1
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.