64
\$\begingroup\$

This is the cop's thread of a challenge. You can view the robber's thread here

A pretty common beginner style question is to print some string, but there's a catch! You need to do it without using any of the characters in the string itself!

For this challenge, we will find out who is the best at printing X without X. There are two threads to this, a cop's thread and a robber's thread.

In the cop's thread (this thread), users will choose a language (which we will call Y) and a string (which we will call X) and write a program in language Y which takes no input, and outputs exactly X without using any of the characters in X. The cop will then post both X and Y without revealing the program they have written.

Robbers will select the cop's answers and write programs in language Y which take no input and output X. They will post these "cracks" as answers in their thread. A crack need only work, not to be the intended solution.

Once a cop's answer is one week old, so long as it has not been cracked, the cop may reveal their program and mark it as "safe". Safe answers can no longer be cracked and are eligible for scoring.

Cops will be scored by length of X in characters with smaller scores being better. Only safe answers are eligible for scoring.

Extra Rules

You may be as specific or precise in choosing your language as you wish. For example you may say your language is Python, or Python 3, Python 3.9 (pre-release), or even point to a specific implementation. Robber's solutions need only work in one implementation of the given language. So, for example, if you say Python is your language, a robber's crack is not required to work in all versions of Python, only one.

Since command line flags count as different languages, you should indicate specific command line flags or the possibility of command line flags as part of your language. For ease of use, I ask that you assume there are no command line flags in cases where command line flags are not mentioned.

You may choose to have your output as an error. If your intended solution does output as an error, you must indicate this in your answer.

Find Uncracked Cops

<script>site = 'meta.codegolf'; postID = 5686; isAnswer = false; QUESTION_ID = 207558;</script><script src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'></script><script>jQuery(function(){var u='https://api.stackexchange.com/2.2/';if(isAnswer)u+='answers/'+postID+'?order=asc&sort=creation&site='+site+'&filter=!GeEyUcJFJeRCD';else u+='questions/'+postID+'?order=asc&sort=creation&site='+site+'&filter=!GeEyUcJFJO6t)';jQuery.get(u,function(b){function d(s){return jQuery('<textarea>').html(s).text()};function r(l){return new RegExp('<pre class="snippet-code-'+l+'\\b[^>]*><code>([\\s\\S]*?)</code></pre>')};b=b.items[0].body;var j=r('js').exec(b),c=r('css').exec(b),h=r('html').exec(b);if(c!==null)jQuery('head').append(jQuery('<style>').text(d(c[1])));if (h!==null)jQuery('body').append(d(h[1]));if(j!==null)jQuery('body').append(jQuery('<script>').text(d(j[1])))})})</script>

\$\endgroup\$
30
  • 1
    \$\begingroup\$ @user I believe errors are considered output, by our standard rules. I defer to those, so I believe the answer is yes. \$\endgroup\$ – Wheat Wizard Jul 25 '20 at 15:53
  • 1
    \$\begingroup\$ @SomoKRoceS You can use any characters. \$\endgroup\$ – Wheat Wizard Jul 25 '20 at 21:03
  • 3
    \$\begingroup\$ @Discretelizard I am not AdHocGarfHunter, but if your program does anything with the input (other than completely ignoring it), it is almost certainly invalid. \$\endgroup\$ – the default. Jul 26 '20 at 15:09
  • 1
    \$\begingroup\$ @EthanChapman Program flags are considered different languages. I had not thought if this initially so I will update the question but I will say that in order for command line flags to be used they should be explicitly allowed, either a specific flag or flags in general (as per the language vagueness rules). \$\endgroup\$ – Wheat Wizard Jul 26 '20 at 15:23
  • 3
    \$\begingroup\$ Given the large number of answers to this challenge, I suggest adding the uncracked answers stack snippet to the question body, so it's easier to find uncracked cops. (I'm posting a comment rather than adding it myself due to the rule against adding leaderboards) \$\endgroup\$ – The Fourth Marshal Jul 27 '20 at 23:14

110 Answers 110

2
\$\begingroup\$

SimpleTemplate, Score: 7 Cracked

This is just a simple one for you.

It outputs the following characters to STDOUT:

cho0.84

Should be a bit easy to find a working solution for this.


As you've seen, it has been cracked.
The code posted is a lot more complicated than I had written:

{@set x "a"}{@set k "{@in\x63 by 2251 x}{@in\x63 by -1 x}"}{@eval k}{@print "#{x}#{VERSION}"}

Simply starts x with "a" and increments it 2251 times.
Incrementing goes from "a" to "z", then "aa" ... "zz", "aaa" ... "chp".
Then, it decrements once (increments by -1), which results in "cho".

The line {@print "#{x}#{VERSION}"} just simply outputs the generated x and the VERSION variable, on a single string.
It's also possible to do {@print "%s%s", x, VERSION} for the same result.

\$\endgroup\$
3
  • \$\begingroup\$ I suspect this has to do with the print or php commands, but I'm not sure. Are you fine with plain PHP answers? \$\endgroup\$ – user Jul 30 '20 at 16:09
  • \$\begingroup\$ @user The intended solution has nothing to do with PHP, but sure. As the challenge states, it doesn't have to be the exact solution I was expecting. So, go ahead, you can post your crack. But please specify that it is based in PHP. \$\endgroup\$ – Ismael Miguel Jul 30 '20 at 19:35
  • 1
    \$\begingroup\$ Cracked \$\endgroup\$ – Dingus Aug 1 '20 at 9:35
2
\$\begingroup\$

Perl 5.20 (packable with pp from PAR::Packer), Score: 87, Cracked

The ASCII control characters ^F^O^V^X and

!"%'(*+,-/0123456789:;<>@ABCDEFGHIJKLMNOPQRSTUVWXYZ\^`abcdefghijklmnopqrstuvwxyz{|~

As a Perl string:

"\x06\x0f\x16\x18" . '!"%\'(*+,-/0123456789:;<>@ABCDEFGHIJKLMNOPQRSTUVWXYZ\\^`abcdefghijklmnopqrstuvwxyz{|~'

As hex:

060f161821222527282a2b2c2d2f303132333435363738393a3b3c3e404142434445464748494a4b4c4d4e4f505152535455565758595a5c5e606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7e

This means that the following printable ASCII characters are permitted:

 #$&).=?[]_

No more lists with =>, no more (balanced) parentheses. / is out but ? is back in.

My solution works with an ordinary Perl on Linux or Windows, and with any version of suitable vintage. My intent with the PAR::Packer constraint is to express that you shouldn't depend on how Perl is installed. You can run pp foo.pl and run the resulting executable on any machine that can run the resulting binary, even if it doesn't have Perl installed.

For information, my solution's size (I didn't attempt to golf):

$ wc perl-no-asterisk-braces-comma-parentheses.pl  
  40  148 3993 perl-no-asterisk-braces-comma-parentheses.pl

Continuation of:

  1. challenge, crack
  2. challenge, crack
  3. challenge, crack
  4. challenge, crack

I used several tricks that I got from Dom Hastings's solutions. If you're new to this series, you may want to read our explanations before tackling this one.

\$\endgroup\$
3
  • \$\begingroup\$ A little worried I'm not going to be able to get this as I'm away next week! I've got all the numbers, all uppercase characters, but still missing a generator for lowercase! I've looked into quite a few mechanisms, still investigating NaN... Hopefully I'll get some time Sunday... \$\endgroup\$ – Dom Hastings Jul 31 '20 at 16:00
  • \$\begingroup\$ @DomHastings After this one, I have another one ready with a slightly different character set that forced me to use a completely different approach to construct letters. And I'm also thinking about one without . — no more concatenation — but I haven't yet found an interesting character set that works. \$\endgroup\$ – Gilles 'SO- stop being evil' Jul 31 '20 at 21:52
  • \$\begingroup\$ Cracked! in probably the most horrendous way possible, but that was fun! \$\endgroup\$ – Dom Hastings Aug 2 '20 at 21:19
2
\$\begingroup\$

Dotty 0.20.0-RC1, score: 3 (Cracked)

:\{

Edit: Previously, I had the language marked as Dotty 0.20.0-RC1, but it appears there's an alternate crack(s) that also works on the latest versions of Dotty. This also means that you don't have to download Dotty 0.20, you can just test out your code in Scastie right in your browser.


Note: This The previous solution I had won't work before 0.20 or on the latest version (0.26 currently), so if you want to test it, you'll need SBT or Dotty 0.20 on your computer. However, you probably don't need to do that - just going through the Dotty website (linked above), and perhaps their GitHub repository should be enough. If you do want to test it, I'd suggest Scastie.


My original solution with Dotty 0.20:

 object Main with
   @main
   def main = print("" + 58.toChar + 92.toChar + 123.toChar)
 

But it turns just this works too, because functions can be toplevel in Dotty.

 @main
 def main = print("" + 58.toChar + 92.toChar + 123.toChar)
 


Hint: check the release notes for 0.20. There is also another feature, present since I think 0.18, that helps you do this. (To clarify, the first feature helps you avoid { and the second helps you avoid :, although the first can also help you avoid :).

Hint 2: The answer is very short and not at all complex (it took only 86 characters for me (no golfing)). Also, if you compile it on your computer, there will be 6 files: main.class, Foo$package.class, Foo$package$.class, and their corresponding .tasty files (assuming you name your file Foo.scala).

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

><>, score: 1 - Cracked

o

How can you output a character without using the o command?

Intended Solution

ab*1+:90p ;

Same trick, but much shorter.

\$\endgroup\$
2
  • \$\begingroup\$ cracked lol \$\endgroup\$ – lyxal Aug 12 '20 at 6:35
  • \$\begingroup\$ @Lyxal Of course it's supposed to be easy lol also that one's poorly golfed see my intended solution \$\endgroup\$ – null Aug 12 '20 at 6:37
2
\$\begingroup\$

><>, score: 20

0123456789abcdef&loi

loi for loss of input

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

><>, score: 22

0123456789abcdef&loi'"

No literals now.

\$\endgroup\$
4
  • \$\begingroup\$ I"m just watching as your answers get progressively bigger and Lyxal still manages to crack them each time :) \$\endgroup\$ – user Aug 12 '20 at 17:31
  • 1
    \$\begingroup\$ Well, you've won. I give up. It's just too hard for me to crack this answer................................is what I'd be saying if it wasn't cracked lol \$\endgroup\$ – lyxal Aug 12 '20 at 21:25
  • 1
    \$\begingroup\$ @user I've struck again with my longest one yet. \$\endgroup\$ – lyxal Aug 12 '20 at 21:26
  • 1
    \$\begingroup\$ @Lyxal For a moment there I felt a little sad, thinking this chain was going to stop. Good to see you haven't broken it yet. HighlyRadioactive, keep the challenges coming! I wish both of you luck. \$\endgroup\$ – user Aug 12 '20 at 23:19
2
\$\begingroup\$

><>, score: 21

123456789abcdef&loi'"

Two ways.

\$\endgroup\$
2
  • \$\begingroup\$ roses are red, my name is not paul. where's round 8? cause this is cracked, lol \$\endgroup\$ – lyxal Aug 13 '20 at 3:52
  • \$\begingroup\$ @Lyxal Herrings are red, my name is not Lyxal. I don't know ><> at all. Also, you are lazy. \$\endgroup\$ – null Aug 13 '20 at 4:11
2
+250
\$\begingroup\$

><>, score: 24

123456789abcdef&io'"()=

The second approach. Also no newlines. Also be a little bit golfier please.

\$\endgroup\$
1
  • \$\begingroup\$ golfing is overrated. cracked lol \$\endgroup\$ – lyxal Aug 13 '20 at 4:38
2
\$\begingroup\$

Keg, Score: 55, cracked

  
 - + . 8  ! _ ~ ⑨ \ ;
  
 - + . 8  ! _ ~ ⑨ \ ;

View it online!

Good luck with this one. Most commands used to generate values are gone. Edit: I just realised the output was invalid. It's fixed now. Sorry about that.

\$\endgroup\$
6
  • \$\begingroup\$ Is the Try it online! link intended? :) \$\endgroup\$ – the default. Jul 26 '20 at 11:25
  • \$\begingroup\$ @mypronoun yes, it is. I copied the out in a new tio page to utilise its formatting. Also, it retains all characters SE might botch. \$\endgroup\$ – lyxal Jul 26 '20 at 11:26
  • \$\begingroup\$ Cracked? \$\endgroup\$ – the default. Jul 26 '20 at 13:02
  • \$\begingroup\$ Is the official implementation linked required, or can the extended variants used in TIO allowed? \$\endgroup\$ – Ethan Chapman Aug 14 '20 at 18:37
  • \$\begingroup\$ Nevermind, I don't need it anymore. \$\endgroup\$ – Ethan Chapman Aug 14 '20 at 19:18
2
\$\begingroup\$

Javascript, score 80, Cracked

Last one for javascript. You have to do jsfuck, but I've disallowed 4 of the important characters. I left you some extra, but you'll have to figure out which ones to use and how to use them.

<("MrJock,TVQuizPHDBagsFewLynx.mRjOCKtvqUIZ=phd#bAGSfEWlYNX? 12+34-56*78^90%!')>

Yes, this is possible, by the way. The problems you will encounter, in order:

  • Making numbers (Notice in the number spot, I left out one operation, use that and one other symbol

  • Making booleans (The answer to this was posted years ago in a chatroom about JSFuck)

  • Executing functions (If you saw my previous two cop answers, you know how to do this)

My solution was exactly the same as the cracked one above.

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

Php7, score: 14 (cracked)

funtim(){}_=/\
\$\endgroup\$
1
2
\$\begingroup\$

Shakespeare Programming Language, score: 4, cracked by Dingus

mMbB

You cannot use the sum of or the difference between, so constructing integers is tricky.


Dingus' crack is very similar to what I had in mind. The solution relies on the product, square, square root and factorial operators (which are not well known, since they are not or barely mentioned in the official documentation), and on the fact that SPL only uses integers, so that e.g. 5 can be represented as \$\sqrt{32}\$ (the square root of a cunning cute peaceful trustworthy healthy squirrel).

\$\endgroup\$
5
  • 1
    \$\begingroup\$ Ha! I figured out! Robber coming soon... \$\endgroup\$ – null Aug 19 '20 at 4:45
  • \$\begingroup\$ Cracked \$\endgroup\$ – Dingus Aug 19 '20 at 12:06
  • \$\begingroup\$ @Dingus Well done! That is very close to the solution I had in mind (modulo the choice of epithets, naturally!) \$\endgroup\$ – Robin Ryder Aug 19 '20 at 12:33
  • \$\begingroup\$ Factorial... Nope. I did find the solution with a search script, however. The b is: the square root of the square of twice the square of the square root of twice the square of the square root of a little little little little little cat. Try b online. imagine I optimizing a program for two days only to find out it was cracked. EDIT: \$\endgroup\$ – null Aug 20 '20 at 7:21
  • \$\begingroup\$ Why not a new mMbBlL challenge? That will almost certainly be more interesting... (Mwahahaha) \$\endgroup\$ – null Aug 20 '20 at 7:24
2
\$\begingroup\$

Python 3, Score 104 Cracked by dingledooper

Slithering deeper into Python insanity

$ python3 ./test6.py |hexdump -C
00000000  09 0a 0b 0c 0d 0e 0f 10  11 12 13 14 15 16 17 18  |................|
00000010  19 1a 1b 1c 1d 1e 1f 20  21 22 23 24 25 26 2a 2b  |....... !"#$%&*+|
00000020  2d 2e 2f 30 31 32 33 34  35 36 37 38 39 3a 3b 3c  |-./0123456789:;<|
00000030  3d 3e 3f 40 41 42 43 44  45 46 47 48 49 4a 4b 4c  |=>?@ABCDEFGHIJKL|
00000040  4d 4e 4f 50 51 52 53 54  55 56 57 58 59 5a 5b 5c  |MNOPQRSTUVWXYZ[\|
00000050  5d 5e 5f 60 61 62 64 67  6a 6b 6d 6f 71 73 75 76  |]^_`abdgjkmoqsuv|
00000060  77 78 79 7a 7c 7e 7f 0a                           |wxyz|~..|
00000068

This time it's not self-verifying.

Verification code:

import sys
import subprocess as s

fname = sys.argv[1]
ph = s.Popen(f"python3 {fname}",shell=True,stdout=s.PIPE)
out = ph.stdout.read()
with open(fname,'rb') as fh:
    fc = fh.read()

matches = [x for x in out if x in fc]

if len(matches) == 0:
    print("Success, no output characters in source")
else:
    print(f"Error, maching characters: {matches}")


Verify output:

$ python3 ./verify.py ./test6.py 
Success, no output characters in source

Original generator:

import re

code = "print(__dat)"

squots = re.compile("'([^']+)'")

dquots = re.compile('"([^"]+)"')

def fstrchar(x):
    return f"{'{'}chr({x}){'}'}"


def fy(x):
    return fystr(x.group(1))
    
def fystr(s):
    return f"f'{str().join([fstrchar(ord(x)) for x in s])}'"

def replaceliterals(x):
    xx = squots.sub(fy,x)
    return dquots.sub(fy,xx)

digits= re.compile("\d+")
def subdigits(x):
    return digits.sub(lambda m: f"len({repr(tuple([tuple()]*int(m.group(0)))).replace(' ','')})",x)

code = subdigits(replaceliterals(code))

dat = "".join([chr(x) for x in range(9,128) if chr(x) not in code])

ocode = code

code = code.replace('__dat',subdigits(fystr(dat)))

dat = "".join([chr(x) for x in range(9,128) if chr(x) not in code])

code = ocode.replace('__dat',subdigits(fystr(dat)))

open(1,'w').write(code)

Try the result online!

\$\endgroup\$
3
  • \$\begingroup\$ Note that newline (0a) appears twice in the output... \$\endgroup\$ – M Virts Jan 28 at 20:02
  • \$\begingroup\$ Also, period (2e) is in the output set, which may be overlooked because of the other periods used to represent non-printing characters. \$\endgroup\$ – M Virts Jan 28 at 20:13
  • \$\begingroup\$ Cracked, i think? \$\endgroup\$ – dingledooper Jan 29 at 0:43
2
\$\begingroup\$

Zsh, 87 bytes, safe

i&I0,`Grn4T[wfp8Ll:\|t1~cCEN'zu"e7^DWOv+J35!yKBZkXUxSYq%6=2dQP>MsVo]jRHA*b?ah_/g.F-m9

(note the single trailing newline, which is required)

See here for an explanation.

\$\endgroup\$
1
  • \$\begingroup\$ This is now safe. \$\endgroup\$ – Makonede Feb 3 at 22:48
2
\$\begingroup\$

LUA 5.1, Score: 82 Cracked

Output

!"$%&'*+,-/0123456789:;<>?@ABCDEFHIJKLMNOPQRSTUVWXYZ\^`bdefgijklmnopqstuvwxyz{|}~

Little hints whats allowed at all

_Gachr.#()[]

I can reduce my score a lot by allowing more crap letters tho. This was a really fun task, code is brain fuck :D

Have fun guys

\$\endgroup\$
4
  • \$\begingroup\$ Is a trailing newline acceptable? \$\endgroup\$ – Dingus Feb 2 at 23:50
  • 1
    \$\begingroup\$ There's none in the output. \$\endgroup\$ – LuaNoob Feb 3 at 8:09
  • 1
    \$\begingroup\$ Cracked \$\endgroup\$ – Dingus Feb 3 at 9:41
  • \$\begingroup\$ Awesome @Dingus. New one is on the way soon. \$\endgroup\$ – LuaNoob Feb 3 at 10:34
2
\$\begingroup\$

x86 machine code (Linux, no libc), 1 byte, safe

Machine code this time, for 32-bit Linux.

0x80

Output is the byte 0x80 to stdout.

Your code cannot use libc. Specifically, expect it to be inserted into an ELF .o file linked as so (but the filename will not be used)

$ i686-linux-gnu-ld file.o -o a.out

My solution:

The easiest solution is to use sysenter instead of int 0x80. Try it online!

\$\endgroup\$
2
\$\begingroup\$

DOS x86-16 machine code, 1 byte, safe

0xCD

A similar challenge to my Linux one, this time for DOS. The solutions are entirely different, though.

In CP858/CP437, it is the box drawing character ═ (not to be confused with =), and in CP1251, it is the Cyrillic letter Н (not the English letter H).

That byte must be output to standard output. I won't accept writing to video RAM.

You can assume an i686-compatible CPU in real mode DOS.

I didn't make this obvious, but DOS has no memory protection. All RAM is fair game. Watch out for CPU cache issues, though.

I expected this to last no longer than a day, and clearly I was wrong.

My solution:

ba cc 21 42 52 68 b4 4c 52 b4 02 89 e5 16 55 cb

        org 0x100
start:
        // DX = int 0x21
        mov     dx, 0x21CC
        inc     dx
        // DL is also 0xCD.
        push    dx
        // mov ah, 0x4C (exit)
        // We can't use ret or int 0x20 because we
        // change CS.
        push    0x4CB4
        // Push int 0x21 again.
        // SP now contains this code, which calls
        // int 21 to print, then exits.
        //     int 0x21
        //     mov ah, 0x4C
        //     int 0x21
        push    dx
        // AH = 02 = putc(DL)
        mov     ah, 0x02
        // Copy SP to BP so we push the right value
        mov     bp, sp
        // dos doesn't protec
        // ez to attac
        // but most importantly
        // we can jump to stac
        // jmp far ss:[sp] if it existed
        push    ss
        push    bp
        retf
Too easy.

I am willing to write a sequel that requires even more DOS abuse if anyone is interested. But getting all these assembly cops for free is just boring.

\$\endgroup\$
2
\$\begingroup\$

YaBASIC, score:15 Cracked by Dingus

The new and improved string to crack:

0
1
2
3
4
5
6
7
8
9
L
S
l
s
-

Try it online in YaBASIC!

Can you crack it? Yes they can!

My method relies on 1 variable,i, which defaults to 0. !i (NOT i) results in 1. Of course, with 0 and 1 we've got binary - the building block of all computing. However, in my case I just added as many !i as needed to get the result. Pretty ugly...

?i
?!i
?(!i)+(!i)
?(!i)+(!i)+(!i)
?(!i)+(!i)+(!i)+(!i)
?(!i)+(!i)+(!i)+(!i)+(!i)
?(!i)+(!i)+(!i)+(!i)+(!i)+(!i)
?(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)
?(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)
?(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)
?chr$((!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i)+(!i))

And so on with ?chr$ and as many !i as needed for the desired character. In hindsight maybe adding = to the string would have slowed Dingus down by a few more minutes... Their solution uses it whereas mine doesn't. 😁

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Cracked \$\endgroup\$ – Dingus Mar 1 at 21:07
1
\$\begingroup\$

Befunge-98 (FBBI), Score: 2, Cracked

Not too difficult, but I don't think this can be made harder in Befunge.

=,

My solution:

4b*:d0p'<1+1k @

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

05AB1E, Score: 1, Cracked

X = .

I think it is an easy one :)

edit

Cracked by @nthistle

My approach (without using ASCII code to char conversion):

98/γ¦ć

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Cracked \$\endgroup\$ – nthistle Jul 25 '20 at 20:58
1
\$\begingroup\$

Perl 5 + -p, Score: 30, Cracked

Outputs to STDOUT. Perl has so many ways to generate chars so I've probably missed a few alternative cracks, but here goes...

"'/0123456789<CMFQSV\^cmpqsv|~
\$\endgroup\$
1
1
\$\begingroup\$

Python 2, score 26 Cracked

[2517630984, '\\`"a_put']

The same as the output of this program.


This may well get cracked fairly quickly so apologies in advance if I am not around promptly to acknowledge it!

\$\endgroup\$
6
  • \$\begingroup\$ This can probably be cracked via the unicode tricks used in the most-upvoted robbers answer. \$\endgroup\$ – the default. Jul 27 '20 at 3:23
  • 1
    \$\begingroup\$ @mypronounismonicareinstate In Python 2? \$\endgroup\$ – Jonathan Allan Jul 27 '20 at 3:24
  • \$\begingroup\$ I haven't tried and do not know when that "feature" was introduced, so I may be wrong. \$\endgroup\$ – the default. Jul 27 '20 at 3:25
  • 3
    \$\begingroup\$ @mypronounismonicareinstate python.org/dev/peps/pep-3131 - introduced in 3.0 \$\endgroup\$ – Jonathan Allan Jul 27 '20 at 3:26
  • 1
    \$\begingroup\$ Cracked \$\endgroup\$ – Sisyphus Jul 27 '20 at 4:17
1
\$\begingroup\$

Java, Score: 2 (Cracked)

Output (X):

.

(a dot and a newline)

Never golfed before, but saw this and couldn't resist trying; probably will be cracked within the hour, considering it's not really that complicated. My intended solution output to standard error.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ Welcome to the site! Cracked, although it probably wasn't what you were intending. \$\endgroup\$ – nthistle Jul 27 '20 at 1:31
  • 1
    \$\begingroup\$ For reference, there was a previous Java answer (now removed) by @user that used the Unicode character escaping trick -- you're probably going to have to include numbers, backslash, or 'u' in the answer in order to prevent this. Also, the newline doesn't make it any harder, since in Java you can just remove all newlines without affecting anything. \$\endgroup\$ – nthistle Jul 27 '20 at 1:34
  • 2
    \$\begingroup\$ Never knew about that Unicode trick, should've looked up whether something like that was possible before posting. The newline was more a side-effect of the way I did it than actually intended to make it difficult. You're correct, that's pretty different from my solution. Am I allowed to repost/edit with a modified version that patches previous cracks? \$\endgroup\$ – MCross Jul 27 '20 at 1:40
  • 1
    \$\begingroup\$ I think you can repost a modified version \$\endgroup\$ – user Jul 27 '20 at 1:58
  • 2
    \$\begingroup\$ As the OP for the question I back up user's claim. You are free to post a modified version. Other's (including me) have already done that. Good luck! \$\endgroup\$ – Wheat Wizard Jul 27 '20 at 2:02
1
\$\begingroup\$

Perl 5, Score: 35, Cracked

"'/0123456789<CMPQSTVY\^`cmpqstvy|~

Foiled in my last attempt I'll try another more restrictive set...

\$\endgroup\$
2
  • \$\begingroup\$ Cracked \$\endgroup\$ – Gilles 'SO- stop being evil' Jul 27 '20 at 14:04
  • \$\begingroup\$ @Gilles'SO-stopbeingevil' Nice work! I've got one last attempt to share but will have to be a much higher score! \$\endgroup\$ – Dom Hastings Jul 27 '20 at 16:45
1
\$\begingroup\$

Javascript (Browser), Score: 34. cracked

ABDEFGHIJKLMNOPQRTUVWXYZ1234567890

Shouldn't be too hard compared to the other ones.

\$\endgroup\$
2
  • \$\begingroup\$ Welcome to the site! I've slightly edited your answer to fit the standard format used around here. Good luck, and hope you don't get cracked! \$\endgroup\$ – caird coinheringaahing Jul 27 '20 at 21:20
  • \$\begingroup\$ Cracked \$\endgroup\$ – nthistle Jul 27 '20 at 23:38
1
\$\begingroup\$

Javascript (Browser), Score: 27 Cracked

ABDEFGINOPQTUVYZ234567890tf[

\$\endgroup\$
4
  • \$\begingroup\$ Cracked \$\endgroup\$ – Bubbler Jul 28 '20 at 0:34
  • \$\begingroup\$ If you're intending to submit a third cop answer with "ABDEFGINOPGTUVYZ234567890tf[evalsic", please do so as a separate answer. \$\endgroup\$ – The Fourth Marshal Jul 28 '20 at 3:27
  • \$\begingroup\$ ok. sure (stuff to fill the required characters) \$\endgroup\$ – Sparkles the Unicorn Jul 28 '20 at 5:02
  • \$\begingroup\$ Brony? Greetings (My username is formerly TwilightSparkle) \$\endgroup\$ – null Jul 28 '20 at 13:26
1
\$\begingroup\$

Javascript, score 6, Cracked

(\SuC)

Alright, added 3 more characters. Same concept as before, but harder this time.

My solution:

[]["fill"]["constr"+[[][0]+[]][0][0]+"ctor"]`a${[]["fill"]["constr"+[[][0]+[]][0][0]+"ctor"]`a${"ret"+[[][0]+[]][0][0]+"rn "+[[][0]+[]][0][0]+"nescape"}````console.log%28"%28%5c%5c%53%75%43%29"%29`}```

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

Java, score 2 Cracked

yC\

This is supposed to be printed to stdout. The y doesn't let you use System.out.println, the \ is so you don't use Unicode escapes, and the C is so you don't use reflection. This isn't super hard - I found it with my first Google search to make an answer to this question.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Cracked \$\endgroup\$ – nthistle Jul 27 '20 at 22:58
1
\$\begingroup\$

Ruby, Score: 9, Cracked

.'"?%([:<

My code outputs with no trailing newline and works for Ruby 1.8.7 onwards. By design, string creation is difficult.

Edit: I've posted a new version hardened against the weaknesses found by @DomHastings and @Gilles'SO-stopbeingevil'. Because my code is almost unchanged I'll hold off on revealing it.

\$\endgroup\$
6
  • \$\begingroup\$ Cracked although I imagine this wasn't your intention... \$\endgroup\$ – Dom Hastings Jul 30 '20 at 17:09
  • \$\begingroup\$ @DomHastings Most definitely not! But isn't that Ruby + Bash? \$\endgroup\$ – Dingus Jul 30 '20 at 19:48
  • \$\begingroup\$ Hmmm, yeah, I guess. Thought I was pushing it a little... \$\endgroup\$ – Dom Hastings Jul 30 '20 at 19:59
  • 1
    \$\begingroup\$ Using a shell escape works on Ruby on any POSIX platform, and the challenge allows cracks that only work on a specific implementation. So it's legit. Cc @DomHastings Dom's solution is a bit iffy because it requires bash, not just any POSIX platform, so it's a constraint on the presence of an external tool and not just a choice of implementation. \$\endgroup\$ – Gilles 'SO- stop being evil' Jul 30 '20 at 22:51
  • 1
    \$\begingroup\$ If you push an updated challenge that forbids backquote, be sure to also arrange to forbid putc which prints character by their numerical value. \$\endgroup\$ – Gilles 'SO- stop being evil' Jul 30 '20 at 23:00
1
\$\begingroup\$

Part 2: PicoLisp, score: 18 cracked

Segmentation fault

or (similar):

Segmentation fault (core dumped)

(output to STDERR)

A bit harder than my previous answer. . .

\$\endgroup\$
11
  • \$\begingroup\$ Would this be considered a crack? The output shown there is correct (assuming it's been reproduced accurately), but running on TIO produces leading and trailing garbage. \$\endgroup\$ – Dingus Jul 30 '20 at 11:30
  • 1
    \$\begingroup\$ @Dingus Almost, but that has spaces (it seems to work ). If it produces a Segmentation fault it's fine (with or without garbage) because if you run it as pil file.l it won't create garbage. If in doubt, see if you can install picolisp. \$\endgroup\$ – Wezl Jul 30 '20 at 13:13
  • \$\begingroup\$ Ah yeah right... I completely overlooked the spaces! Segfaults without them too, though. \$\endgroup\$ – Dingus Jul 30 '20 at 13:25
  • \$\begingroup\$ The output I get from pil for a space-free version of the code is Segmentation fault (core dumped). Not sure this is valid. Even if you allow the (core dumped) bit, my code contains both ( and )... \$\endgroup\$ – Dingus Jul 30 '20 at 13:36
  • 2
    \$\begingroup\$ I can't reproduce this. When picolisp segfaults on my machine, it doesn't print anything, it just segfaults. If you're running it from a shell, the shell may print a message (depending on how it's configured, the locale, etc.), but this message does not come from the program. If the intended solution was to make it segfault, this is invalid for the challenge. \$\endgroup\$ – Gilles 'SO- stop being evil' Jul 30 '20 at 22:46

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.