67
\$\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 and repls count as different languages. If your language is one of those then you should indicate that as at least a possible option for the 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\$
28
  • 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 Witch
    Jul 25 '20 at 15:53
  • 1
    \$\begingroup\$ @SomoKRoceS You can use any characters. \$\endgroup\$
    – Wheat Witch
    Jul 25 '20 at 21:03
  • 4
    \$\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\$ Jul 26 '20 at 15:09
  • 2
    \$\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 Witch
    Jul 26 '20 at 15:23
  • 1
    \$\begingroup\$ @pppery Can the snippet deal with two submissions in a single post? Or should I make two answers and link them if I have a pair of highly related challenges? \$\endgroup\$ Jul 28 '20 at 12:50

149 Answers 149

4
\$\begingroup\$

Python 3, Score:96 Cracked by pxeger

Similar to my other answer, improvements inspired by Wheat Wizard's crack. Still self-verifying.

Output viewed through hexdump (non-printable output makes it look incorrect on the terminal):

$ python3 ./test4.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 21  22 23 24 25 26 27 2a 2b  |.......!"#$%&'*+|
00000020  2d 2f 30 31 32 33 34 35  36 37 38 39 3a 3b 3c 3d  |-/0123456789:;<=|
00000030  3e 3f 40 41 42 43 44 45  46 47 48 49 4a 4b 4c 4d  |>?@ABCDEFGHIJKLM|
00000040  4e 4f 50 51 52 53 54 55  56 57 58 59 5a 5b 5c 5d  |NOPQRSTUVWXYZ[\]|
00000050  5e 60 64 6b 70 71 76 77  78 79 7a 7b 7c 7d 7e 7f  |^`dkpqvwxyz{|}~.|
00000060

Original:

Script generating script:


import re

filecode = "__builtins__.__getattribute__('globals')().__getitem__('__file__')"
code = "__builtins__.__getattribute__('open')(1,chr(119)).__getattribute__(str().join([chr(119),chr(114),chr(105),chr(116),chr(101)]))(str().join([b for b in (chr(u) for u in __builtins__.__getattribute__('range')(9,128)) if b not in __builtins__.__getattribute__(str().join((chr(111),chr(112),chr(101),chr(110))))(__file__,chr(114)).__getattribute__('read')()]))"

code = code.replace('__file__',filecode)
code = code.replace('[','(')
code = code.replace(']',')')

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

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


def fy(x):
    return f"str().join(chr(b) for b in {repr(tuple([ord(x) for x in x.group(1)]))})"

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

digits= re.compile("\d+")
open(1,'w').write(digits.sub(lambda x: f"len({repr(tuple([tuple()]*int(x.group(0))))})",replaceliterals(code)))

Try the result online!

\$\endgroup\$
1
  • \$\begingroup\$ cracked \$\endgroup\$
    – pxeger
    Jan 27 at 19:37
4
\$\begingroup\$

Lost, Score 4, Cracked

Runs in -A mode for character output

<>^v

You are going to have to write a deterministic, halting Lost program without any hard redirects.

My solution

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
\%(((((265**:2+:65*+:2+:83*+@

Try it online!

Lost, Score 5, Cracked

<>\^v

Now do it without \.

My solution

/|////////////////////////////
|/%(((((265**:2+:65*+:2+:83*+@

Try it online!

Lost, Score 6, Cracked

<>\^v|

You don't really need | either.

My solution

//////////////////////////////////////////////////////////////
%((((((((((((265**:2+:65*+:2+:83*+:6+@+6:+*38:+2:+*65:+2:**562

Try it online!

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

R, Score=13

-/+0123456789

Printing characters without using digits should be tricky (and I'm pretty confident that you won't find a way to sneak in a utf8ToInt!). I wouldn't be surprised if the crack ends up completely different from my own solution.

\$\endgroup\$
8
  • 1
    \$\begingroup\$ Robin: I hope that I have not duplicated your challenge, and that adding some extra characters to my challenge actually makes it tricker. If your secret solution will already crack my challenge, I'll withdraw it (but obviously I've already cracked yours...). \$\endgroup\$ Jul 26 '20 at 13:16
  • \$\begingroup\$ @DominicvanEssen No, my solution doesn't crack yours, so it isn't a duplicate! And I thought mine was hard... \$\endgroup\$ Jul 26 '20 at 13:20
  • 4
    \$\begingroup\$ I'm trying to make a new crack to yours that doesn't give away my own one. That could even be a new challenge: 'crack X without cracking Y'... \$\endgroup\$ Jul 26 '20 at 13:29
  • 1
    \$\begingroup\$ Cracked! curious what your intended solution was. I don't think this approach will be quite so fruitful for Dominic's, though. \$\endgroup\$
    – Giuseppe
    Jul 26 '20 at 15:38
  • 1
    \$\begingroup\$ @Giuseppe Well done! I'll wait a couple of days before adding my (completely different) solution, as I might be able to channel the idea into another challenge. \$\endgroup\$ Jul 26 '20 at 19:32
3
\$\begingroup\$

Befunge 98, Score: 4, cracked

=sp,

Trying to prove ovs' claim that "I don't think this can be made harder in Befunge" wrong. (This answer may still be too easy, but I can say for sure that it is harder than the other one, because I've blocked both self-modifying code operators)

Intended solution:

"PAMI"4('+1+'o1+'r1+'<1+'+1+'ZMZZZZ@

\$\endgroup\$
5
  • 2
    \$\begingroup\$ Are fingerprints allowed? \$\endgroup\$
    – ovs
    Jul 25 '20 at 20:52
  • \$\begingroup\$ "You may be as specific or precise in choosing your language as you wish.". I was very un-specific about what language in the header I used, so any Befunge 98 interpreter can be used the crack this answer, regardless of what features it supports or doesn't support. \$\endgroup\$ Jul 25 '20 at 20:56
  • \$\begingroup\$ Cracked (using a fingerprint): codegolf.stackexchange.com/a/207607 \$\endgroup\$ Jul 26 '20 at 7:56
  • \$\begingroup\$ This can also be done with the ORTH and the IMAP fingerprint. \$\endgroup\$
    – ovs
    Jul 26 '20 at 8:45
  • \$\begingroup\$ The intended solution was using IMAP. (I was deliberately vague about whether fingerprints were allowed earlier in an attempt to avoid giving the fact that I used them away). Ah, well, this answer still served its purpose, because it lasted 13 hours, and the previous answer lasted less than an hour, so it was definitely harder) \$\endgroup\$ Jul 26 '20 at 13:55
3
\$\begingroup\$

C, score 2 (cracked)

Output {; to stdout.

Probably not that difficult, but I was quite surprised when I first saw this C feature.

\$\endgroup\$
0
3
\$\begingroup\$

Python 2, Score: 7 (Cracked)

cdnsvw,

Note: There is no newline at the end

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

R, Score=14 cracked by Giuseppe

0123456789([aE

My previous challenge was cracked (embarassingly within less than a day) using indexed-retrieval of the searched-for characters from within larger expressions/strings.

This challenge is intended to make that approach more difficult.

Solution

Giuseppe's crack was different in several places, so here's the solution that I had in mind when I posed the challenge:

    # make some numbers:
    zero=T-T
    two=T+T
    three=T+T+T
    one=three-two
    four=T+T+T+T
    five=T+T+T+T+T
    six=T+T+T+T+T+T
    seven=T+T+T+T+T+T+T
    eight=T+T+T+T+T+T+T+T
    nine=T+T+T+T+T+T+T+T+T
    ten=nine+one

    # zero to nine is the first series of digits in the output string:
    zerotonine=zero:nine

    # 40, 69 and 91 are the ASCII values of ([ and E
    forty=ten+ten+ten+ten
    sixtynine=forty+ten+ten+ten-one
    ninetyone=forty+forty+ten+one

    # now we need to get some of the 'forbidden' functions
    # first we use 'tolower' to get the (lowercase) function names of 'apropos',
    # 'tail' and 'cat' (so we avoid the the lower-case letter 'a')
    ~=tolower
    b=~'APROPOS'
    A=~'A'
    t=~'TAIL'
    c=~'CAT'

    # Now we can use 'get()' to get the functions from the names
    ?=get
    ~=?b          # apropos()
    i=~'intToUtf'   # look-up the full-length 'intToUtf8' function name
    !=?i          # intToUtf8()

    # Now we've got 'intToUtf8()' we can create the forbidden characters
    p=!forty;b=!ninetyone;e=!sixtynine

    # We want to paste them all together with no separator.  Since we can't easily give
    # multiple arguments to a function (because we're always replacing binary operators),
    # we need to construct 'paste0'.  This is the second function looked-up using
    # 'PAST' (without the final E), so we use 'tail()' to get it.
    -=?t
    pp=~'PAST'
    ppp=pp-one
    +=?ppp

# Finally, we build our string using our new 'paste0' function, and use 'cat()' # to output it: string=zero+one+two+three+four+five+six+seven+eight+nine+p+b+A+e ~=?c ~string

Try it online!

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

Java, Score: 3 (Cracked)

.\

Round two for this solution, fixing the previous crack. As with the original, the output from my solution was to standard error.

\$\endgroup\$
7
  • 2
    \$\begingroup\$ While I was doing research for this, I stumbled upon this, which is basically almost identical -- since I'm assuming this isn't intended either, I'm going to some time looking for something better (I'm kinda close on a reflection approach). \$\endgroup\$
    – nthistle
    Jul 27 '20 at 3:10
  • \$\begingroup\$ Cracked. @nthistle, you really helped me! \$\endgroup\$
    – user
    Jul 27 '20 at 19:35
  • 1
    \$\begingroup\$ @user Same trick I used, just in a different format; I just made my main class extend Exception, allowing me to invoke printStackTrace without a dot from its constructor. I guess I could have just reposted again blocking colons (to prevent creating an Autocloseable from a Throwable), but I think twice is enough for one solution, especially when you're that close. Good work! ...still would be interested in seeing the Reflection that nthistle was planning, though... \$\endgroup\$
    – MCross
    Jul 27 '20 at 21:51
  • \$\begingroup\$ Not sure you can use reflection for this - I just spent half the day trying to do it, but you have to use dots in Java to do anything more than this \$\endgroup\$
    – user
    Jul 27 '20 at 21:53
  • 1
    \$\begingroup\$ Yeah, the reflection ended up being a non-starter. The originally idea was basically to use method references (which you only need :: to get) to something like System.err::write and then find a way to invoke them, but invoking method references in Java basically requires ., unless I could find something in the standard library that would invoke it for me (unlikely). Likewise, you can't really use reflection to even access the err attribute of System without using a . somewhere. \$\endgroup\$
    – nthistle
    Jul 27 '20 at 22:50
3
\$\begingroup\$

Perl 5 + -p, Score: 77, Cracked!

 "#'+\-/0123456789:<>ABCDEFGHIJKLMNOPQRSTUVWXYZ\^`abcdefghijklmnopqrstuvwxyz|~

Note: there is a leading space on this line. This leaves you with:

!$%&()*,.;=?@[]_{}

So much for trying to get a low score, there's too many ways to do it!

My approach

First, it's necessary to break out of the while(<STDIN>) loop using }{. My aim wasn't to stop printing, but to make generating the string difficult. Without access to any letters immediately, it's tricky, but using the trick Gilles used $_=*_ you get main::_ which provides a and : (stored in $;) which we'll need later. Accessing these is also tricky as you can't index into strings directly like you can in some languages, but we still have ? which (up until v5.22.0) works similarly to /.../ allowing us to repeatedly match a section, store in $_ (via $_=$&) and match again. a&_ yields A and using that in a range with _ (or aa/AA) produces the list of uppercase and lowercase chars needed (stored in @@ and @!), accessing the indices is a little tricky without numbers, but these can be easily generated using list lengths to generate 0-9 and then concatenation to build larger numbers, although having enough short variables to store data in is an annoying problem to have. To generate the string I used a program to build the numbers I wanted, but it would be a lot shorter using ranges and I pass the codepoints into pack (by calling CORE::pack, via &{'CORE::pack'})using C77 as the definition which stores the desired string in $_ which is implicitly printed.

}{
$_=*_;
?......$?;
$_=$&;
?.?;
@@=$&.._;
@!=(_&$&).._;
?..$?;
$_=$&;
?.?;
$;=$&;
$%=!$?;
$==()=(_,_);
${$![$?]}=()=(_,_,_);
$$=()=(_,_,_,_);
$*=()=(_,_,_,_,_);
$,=()=(_,_,_,_,_,_);
$.=()=(_,_,_,_,_,_,_);
$@=()=(_,_,_,_,_,_,_,_);
$}=()=(_,_,_,_,_,_,_,_,_);
$_=&{$![$=].$![$%.$$].$![$%.$.].$![$$].$;.$;.$@[$%.$*].$@[$?].$@[$=].$@[$%.$?]}(
$![$=].$..$.,
${$![$?]}.$=,
${$![$?]}.$$,
${$![$?]}.$*,
${$![$?]}.$},
$$.${$![$?]},
$$.$*,
$$.$.,
$$.$@,
$$.$},
$*.$?,
$*.$%,
$*.$=,
$*.${$![$?]},
$*.$$,
$*.$*,
$*.$,,
$*.$.,
$*.$@,
$,.$?,
$,.$=,
$,.$*,
$,.$,,
$,.$.,
$,.$@,
$,.$},
$..$?,
$..$%,
$..$=,
$..${$![$?]},
$..$$,
$..$*,
$..$,,
$..$.,
$..$@,
$..$},
$@.$?,
$@.$%,
$@.$=,
$@.${$![$?]},
$@.$$,
$@.$*,
$@.$,,
$@.$.,
$@.$@,
$@.$},
$}.$?,
$}.$=,
$}.$$,
$}.$,,
$}.$.,
$}.$@,
$}.$},
$%.$?.$?,
$%.$?.$%,
$%.$?.$=,
$%.$?.${$![$?]},
$%.$?.$$,
$%.$?.$*,
$%.$?.$,,
$%.$?.$.,
$%.$?.$@,
$%.$?.$},
$%.$%.$?,
$%.$%.$%,
$%.$%.$=,
$%.$%.${$![$?]},
$%.$%.$$,
$%.$%.$*,
$%.$%.$,,
$%.$%.$.,
$%.$%.$@,
$%.$%.$},
$%.$=.$?,
$%.$=.$%,
$%.$=.$=,
$%.$=.$$,
$%.$=.$,
)

Try it online! (with slight modifications to make it work on more moderns versions)

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Cracked. I found -p to be an extra difficulty. Was that intended, or did you intend a completely different approach for which -p would help? \$\endgroup\$ Jul 28 '20 at 1:19
  • \$\begingroup\$ @Gilles'SO-stopbeingevil' Nice one! It was intended to give you an easy out, but it's not obvious, it'd possible to prepend the code with }{ and escape out of the block, apologies that it caused extra stress! I think you got all the rest of the tricks and underhanded stuff I laid out, ?...? was worrying me, I didn't know if it was too obscure! I'll share my solution later too when I'm at the computer! \$\endgroup\$ Jul 28 '20 at 6:18
  • \$\begingroup\$ Hey, the fun of the search is the point. We certainly haven't reached the end. My turn to cop. Without -p, though I'm curious if a solution for -p exists without {. I made my challenge mostly because I was close to a solution without using *=, then I realized that *_ made things a lot simpler. \$\endgroup\$ Jul 28 '20 at 12:34
3
\$\begingroup\$

PicoLisp , score: 1, Cracked

(

Writing lisp without parentheses is really easy, with picolisp.

\$\endgroup\$
4
  • 2
    \$\begingroup\$ Cracked (Btw, this was fun!) \$\endgroup\$ Jul 27 '20 at 18:10
  • \$\begingroup\$ The output of the linked crack is : (, not (. If this was the intended solution, the challenge is wrong. How do you get picolisp not to display a prompt? \$\endgroup\$ Jul 30 '20 at 22:49
  • \$\begingroup\$ Comments about a cracked answer shouldn't be on thr cops' post. As you double-commented, I explained my answer there. \$\endgroup\$ Jul 31 '20 at 13:21
  • \$\begingroup\$ @Gilles'SO-stopbeingevil' You run the program as a script like pil script.l instead of typing it in after running pil like jdoodle seems to like to do. \$\endgroup\$
    – Wezl
    Jul 31 '20 at 13:45
3
\$\begingroup\$

Ruby, Score: 11, Cracked

p.`'"?%([:<

Take 2, after @DomHastings and @Gilles'SO-stopbeingevil' found unintended weaknesses in the original. I've fortified this version by adding p and ` to the list of forbidden characters. As before, my code outputs to STDOUT with no trailing newline and works for Ruby 1.8.7 onwards.

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

Dirty, Score: 8 - Cracked

hd of []

This is way too easy for people who knows this language... (I don't.)

Intended Solution:

1

Yeah, you read that right.

\$\endgroup\$
1
  • \$\begingroup\$ Cracked \$\endgroup\$
    – Dingus
    Aug 1 '20 at 2:51
3
\$\begingroup\$

Dupdog, Score: 10 - Cracked

[\x0e][\x0c]
[\x10][\x0e][\x18][\x16]
39

May I join the fun?

Inside brackets are escape characters. Assuming linux line-breaks.

Intended Solution

~!!?*

I love short codes.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ This should be really really trivial, by the way - none of the three Dupdog commands (?!~) happens to be in the output, so basically, this is a "Print X" challenge. The answer is suspiciously short - can you find it? \$\endgroup\$
    – null
    Jul 28 '20 at 13:22
  • \$\begingroup\$ Cracked \$\endgroup\$
    – Dingus
    Aug 1 '20 at 4:20
3
\$\begingroup\$

Fortran (GFortran), Score: 18, Cracked

Pp1234567890'"+-*/

My code outputs to STDOUT with no leading whitespace and a trailing newline.


My solution

@Gilles'SO-stopbeingevil' used exactly the same approach in the crack, with minor differences in implementation:

 character(bit_size(i)) :: fmt, out
 izero = floor(epsilon(r))  ! len_trim(achar(bit_size(i))) also works
 ione = ceiling(epsilon(r)) ! len(achar(bit_size(i))) also works
 itwo = ibset(izero,ione)
 ithree = ibset(ione,ione)
 ifour = ibset(izero,itwo)
 ifive = ibset(ifour,izero)
 isix = ibset(ifour,ione)
 iseven = ibset(isix,izero)
 ieight = ibset(izero,ithree)
 inine = ibset(ieight,izero)
 iten = ibset(ieight,ione)
 ieleven = ibset(iten,izero)
 itwelve = ibset(ieight,itwo)
 ithirteen = ibset(itwelve,izero)
 ifourteen = ibset(itwelve,ione)
 ififteen = ibset(ifourteen,izero)
 isixteen = ibset(izero,ifour)
 iseventeen = ibset(isixteen,izero)
 ieighteen = ibset(isixteen,ione)
 fmt(ione:ione) = achar(ibset(ieight,ifive))
 fmt(itwo:itwo) = achar(ibset(ione,isix))
 fmt(ithree:ithree) = achar(ibset(inine,ifive))
 out(ione:ione) = achar(ibset(isixteen,isix))
 out(itwo:itwo) = achar(ibset(ibset(isixteen,ifive),isix))
 out(ithree:ithree) = achar(ibset(iseventeen,ifive))
 out(ifour:ifour) = achar(ibset(ieighteen,ifive))
 out(ifive:ifive) = achar(ibset(ibset(ithree,ifour),ifive))
 out(isix:isix) = achar(ibset(ibset(ifour,ifour),ifive))
 out(iseven:iseven) = achar(ibset(ibset(ifive,ifour),ifive))
 out(ieight:ieight) = achar(ibset(ibset(isix,ifour),ifive))
 out(inine:inine) = achar(ibset(ibset(iseven,ifour),ifive))
 out(iten:iten) = achar(ibset(ibset(ieight,ifour),ifive))
 out(ieleven:ieleven) = achar(ibset(ibset(inine,ifour),ifive))
 out(itwelve:itwelve) = achar(ibset(isixteen,ifive))
 out(ithirteen:ithirteen) = achar(ibset(iseven,ifive))
 out(ifourteen:ifourteen) = achar(ibset(itwo,ifive))
 out(ififteen:ififteen) = achar(ibset(ieleven,ifive))
 out(isixteen:isixteen) = achar(ibset(ithirteen,ifive))
 out(iseventeen:iseventeen) = achar(ibset(iten,ifive))
 out(ieighteen:ieighteen) = achar(ibset(ififteen,ifive))
 write(isix,fmt(ione:ithree)) out(ione:ieighteen)
 end
 

Try it online!

\$\endgroup\$
2
  • \$\begingroup\$ Cracked. By the way, I don't know Ruby or Fortran beyond the hello world stage. It's an interesting journey. \$\endgroup\$ Aug 1 '20 at 16:11
  • \$\begingroup\$ I had a feeling this was coming. Maybe now you should say didn't know. 'Hello, World!' generally doesn't take 1000+ bytes in either language :) \$\endgroup\$
    – Dingus
    Aug 2 '20 at 4:09
3
\$\begingroup\$

><>, score: 20

0123456789abcdef&lol

Forgot the register... happy now?

\$\endgroup\$
1
3
\$\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\$ 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
3
\$\begingroup\$

Arn, Score: 23 Cracked

15125177041707640200000

Ignore the fact that Arn has a compressed form, the ASCII-only version does not contain any of these characters

My Solution:

(:*:*:*:*++++++++++++++++++++++++++++++++++++);o

You use the ++ prefix to increment to 18, square it 4 times, and then conver to octal.

\$\endgroup\$
5
  • 2
    \$\begingroup\$ I do not know this language, but can we do something like 9/9+9/9+9/9+9/9+...? \$\endgroup\$ Aug 27 '20 at 4:00
  • 1
    \$\begingroup\$ Can Arn please have an online interpreter? (Or one that can be run in TIO.) \$\endgroup\$
    – null
    Aug 27 '20 at 5:17
  • \$\begingroup\$ It does have an online compiler, here. \$\endgroup\$ Aug 27 '20 at 11:15
  • \$\begingroup\$ Yes, @my pronoun is monicareinstate, I believe you could get that answer to work, but that is not the method I intended (so I hope you could figure out a different method). \$\endgroup\$ Aug 28 '20 at 2:29
  • \$\begingroup\$ Cracked \$\endgroup\$
    – Dingus
    Aug 28 '20 at 3:03
3
\$\begingroup\$

Dotty 0.26-RC1, Score: 7 (Safe)

"+. p\{

Earlier versions may work too, like 0.25 and 0.24, but I'm not totally sure how low you can go, since Dotty's features keep changing.

Harder version, score: 8 (I still had the same solution for this, but the one above may have alternate cracks, and this doesn't allow them, hopefully.)

"+. p\{[

Update

Since my answer's over a week old now, here's the solution I got (I'm sure it could be made shorter, but whatever)

object`Main`:
    @main
    def`main`=(Console`out`)write(new`String`()concat((34`toChar`)toString)concat((43`toChar`)toString)concat((46`toChar`)toString)concat((32`toChar`)toString)concat((112`toChar`)toString)concat((92`toChar`)toString)concat((123`toChar`)toString)getBytes)

I basically just used concat instead of +, xx.toChar.toString to get around the ", postfix and infix syntax to get around the ., and the backtick to get around the restriction on spaces.

A couple Dotty-specific features that helped: @main meant I didn't have to write (args: Array[String]), saving me [, and Dotty's new indentation-based syntax let's you use : instead of curly braces. Note that even though you see spaces here and in the playground, Dotty does let you use tabs.

Try it in Scastie

Bonus (the same thing, but no parentheses this time)

"+. p\{(

Here's my solution to it (unfortunately, the backticks were removed, because I don't know how to put code in spoilers, but imagine they were there)

 object`Main`:
     @main
     def`main`=
         val`a`=34`toChar`
         val`b`=43`toChar`
         val`c`=46`toChar`
         val`d`=32`toChar`
         val`e`=112`toChar`
         val`f`=92`toChar`
         val`g`=123`toChar`
         val`h`=40`toChar`
         val`i`=new`StringBuilder`
         i`append`a`append`b`append`c`append`d`append`e`append`f`append`g`append`h
         val`j`=i`toString`
         val`k`=j`getBytes`
         val`l`=Console`out`

         l`write`k
 

Scastie

\$\endgroup\$
0
3
\$\begingroup\$

Python 3, Score: 86 Cracked by Wheat Wizard


!"#$%&'*+-/37:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\^`kmpqvwxyz{|}~

Self-verifying (will not print a character in the source), new-line is part of the output set. Apologies for the squares, not sure if the codes are valid or got replaced when pasting the output into my answer. Not done with any unicode tricks.

I could probably reduce my score, but choose to keep it simple instead.

Original code:

__builtins__.__dict__[str().join([chr(111),chr(112),chr(101),chr(110)])](1,chr(119)).__getattribute__(str().join([chr(119),chr(114),chr(105),chr(116),chr(101)]))(str().join([b for b in [chr(u) for u in range(9,128)] if b not in __builtins__.__dict__[str().join([chr(111),chr(112),chr(101),chr(110)])](__file__,chr(114)).read()]))

I think it reads itself for each iteration of the list comprehension. Had to change my editor settings to prevent it from automatically adding a newline at the end of the file.

\$\endgroup\$
5
  • \$\begingroup\$ Welcome to the site. It might be preferable to link your output on TIO or provide a list of codepoints. SE has chopped some of the unprintables - copy/pasting only shows 70 bytes. \$\endgroup\$
    – Dingus
    Jan 25 at 22:33
  • \$\begingroup\$ Thanks! for simplicity the codepoint integer values are: 9,10,11,12,10,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,33,34,35,36,37,38,39,42,43,45,47,51,55,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,92,94,96,107,109,112,113,118,119,120,121,122,123,124,125,126,127 \$\endgroup\$
    – M Virts
    Jan 25 at 22:44
  • \$\begingroup\$ This means you can use the characters (),.01245689[]_abcdefghijlnorstu or code points [0,1,2,3,4,5,6,7,8,13,32,40,41,44,46,48,49,50,52,53,54,56,57,91,93,95,97,98,99,100,101,102,103,104,105,106,108,110,111,114,115,116,117]. Also worth noting that code-point "10" (newline) appears twice in the output according to the code point list. \$\endgroup\$
    – Wheat Witch
    Jan 26 at 9:58
  • \$\begingroup\$ Cracked. It was good fun. \$\endgroup\$
    – Wheat Witch
    Jan 26 at 10:42
  • \$\begingroup\$ Nice! Good catch on the double newline, looks like I should have opened my output file in binary mode, the second 10 should have been a 13! \$\endgroup\$
    – M Virts
    Jan 26 at 12:03
3
\$\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
3
\$\begingroup\$

Vyxal, score 232, cracked by EmanresuA

ḟṙIcKġ₴…‹›+*/-d↵Ǎ½ƒɖø∆₈₇∞₆₄JiẎȯht42069ḢṪḣṫ¡Þ₀₁C!¬⇧İNeVERgȮṄnaGḭ⟇ėyOU⊍p⇩Ż÷«»⌐m≬\ṡ∷‡⁽⟨|⟩‟„$∇_Ǐq꘍₍₌Π⁺βτʀʁɾɽ¨żẏ?¹⁰²ǔǓǒǑǐǎꜝ₂₃₅&ẇŀl↑↓∴∵¢`;¥£¾F¼⅛%→←"ẋ¤Ḋε€ZȧṗṖ¦†A↲↳⋏⋎⁋×λ√⌈⌊:Dbjvwxz,BHMQSTWXY)}]([{<>ḂĊḞĿṀṠẆẊ℅@°•ß↔æƈ§≈µ¯±≠⁼≥≤=ḃ∩s∪ĠṁȦ'ċḋṅ13578

We do a little trolling.

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

Vyxal D, score 229, crakd by Aaron

ḟṙIcKġ₴…‹›+*/-d↵Ǎ½ƒɖø∆₈₇∞₆₄JiẎȯht42069ḢṪḣṫ¡Þ₀₁C!¬⇧İNeVERgȮṄnaGḭ⟇ėyOU⊍p⇩Ż÷«»⌐m≬\ṡ∷‡⁽⟨|⟩‟„$∇_Ǐq꘍₍₌Π⁺βτʀʁɾɽ¨żẏ?¹⁰²ǔǓǒǑǐǎꜝ₂₃₅&ẇŀl↑↓∴∵¢`;¥£¾F¼⅛%→←"ẋ¤Ḋε€ṗṖ¦†A↲↳⋏⋎⁋×λ√⌈⌊:Dbjwxz,BHMQSTXY)}]([{<>ḂĊḞĿṀṠẆẊ℅@°•ß↔æƈ§≈µ¯±≠⁼≥≤=∩s∪ĠṁȦ'ċḋṅ13578ȧ

Now do it without string decompression.

Edit: Dang.

\$\endgroup\$
2
  • \$\begingroup\$ 7 days and you didn't get it either :P \$\endgroup\$ Oct 5 at 12:56
  • \$\begingroup\$ ez \$\endgroup\$ Oct 5 at 14:03
2
\$\begingroup\$

Keg, Score: 10 Cracked

doesn't\\`

This'll take some extra thinking for you all. Apparently not.

¶7ƛ;¶¶Z¶ⁿ2+¶`¶

\$\endgroup\$
2
  • \$\begingroup\$ Cracked \$\endgroup\$
    – user92069
    Jul 26 '20 at 5:31
  • \$\begingroup\$ @Third-party'Chef' beat me to it by less than a minute :) \$\endgroup\$ Jul 26 '20 at 5:32
2
\$\begingroup\$

Befunge 93, score 12 (Cracked)

,0123456789"

Not too hard to figure out in theory, but a pain to implement (at least the way I did it).

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

Python 2, Score: 14 (Cracked)

"'0123456789dt

Note: There is no newline at the end

\$\endgroup\$
1
  • \$\begingroup\$ Cracked. It was good fun. \$\endgroup\$
    – Wheat Witch
    Jul 26 '20 at 17:38
2
\$\begingroup\$

05AB1E, Score: 21, Cracked

X = •”“’‘Ž…„'"ഭ0123456789

A bit more difficult entry :)

edit

Cracked by @nthistle

\$\endgroup\$
3
  • \$\begingroup\$ Cracked \$\endgroup\$
    – nthistle
    Jul 25 '20 at 23:51
  • 1
    \$\begingroup\$ I'm thinking without blacklisting ç or some way to get arbitrary values on the stack, it's going to be difficult to stop my approach from working (and removing the ability to put arbitrary values on the stack will make it hard to do anything in 05AB1E...) \$\endgroup\$
    – nthistle
    Jul 25 '20 at 23:52
  • \$\begingroup\$ True. I'll think about that. \$\endgroup\$
    – SomoKRoceS
    Jul 26 '20 at 18:45
2
\$\begingroup\$

Ruby, Score: 7, Cracked by @Dom Hastings

p<.$a1d

Attempt number 3 after being foiled by @nthistle and @Dom Hastings.

\$\endgroup\$
3
  • \$\begingroup\$ So I've got another crack, but I'm pretty sure it's still not the one you're expecting and I don't want you to get bored of having alternative cracks, so I'm looking for more alternatives... \$\endgroup\$ Jul 26 '20 at 18:51
  • \$\begingroup\$ I found another method, which could be a little closer perhaps? codegolf.stackexchange.com/a/207640/9365 \$\endgroup\$ Jul 26 '20 at 19:25
  • \$\begingroup\$ That was it! Nicely researched. \$\endgroup\$
    – histocrat
    Jul 26 '20 at 21:02
2
\$\begingroup\$

J, Score: 3 (Cracked)

Aiming for a low score, so might not be hard to crack. Blocks the straight-forward ways to convert a number to a character.

au.

Only tested with j9.

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

R (with CRAN packages installed), Score: 3, cracked

([{

Yes folks, no brackets!

You may assume that any CRAN package is installed, but as per standard rules not loaded.

I haven't posted an R version number although your solution might reasonably depend on that, I'm happy to accept an answer for any version of R after 3.0.0.

Update: this is possible without using any CRAN packages, but given I originally posted this allowing CRAN packages, I won't change it.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Cracked (no packages needed) \$\endgroup\$ Jul 27 '20 at 12:23
2
\$\begingroup\$

J, Score: 3 (Cracked)

After nthisle cracked my previous challenge, here is a slightly harder challenge.

u:.
\$\endgroup\$
1
  • 2
    \$\begingroup\$ Cracked. \$\endgroup\$
    – Bubbler
    Jul 27 '20 at 14:14

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.