59
\$\begingroup\$

The robbers thread can be found here: The Mystery String Printer (Robbers)

Your challenge

  • Write a program, function, or REPL script that prints a string to STDOUT.
  • The robbers will try to create a program that prints the same string.
  • If they successfully can create the program within 7 days, your submission is cracked.
  • If nobody can create a program that prints the same string within 7 days, your submission is safe. You may choose to reveal your program, or leave it to challenge future robbers. However, if you don't reveal it, you can't get any points from your submission (don't put "safe" in your answer header if you choose to do this).

Restrictions

  • The program must be less than or equal to 128 bytes total (more on this later).
  • If the program depends on the program name, or the name/contents of an external file, you must say that it does so, and include this in your total byte count.
  • The printed string must be less than or equal to 2048 bytes.
  • The printed string must consist of only printable ASCII characters (new lines can be included).
  • The program must produce the same output every time that it is run.
  • Built-in cryptographic primitives (includes any rng, encryption, decryption, and hash) aren't allowed.
  • The program must not take input.
  • No standard loopholes.

Scoring

  • If a submission is cracked before seven days, the submission earns 0 points.
  • A safe submission of ≤128 characters earns 1 point.
  • A safe submission of ≤64 characters earns 2 points. If it's less than or equal to 32 bytes, it earns 4 points, and so on.
  • Each safe submission also earns an additional 3 point bonus (independent of the length).
  • There is a tiny (1/2 point) penalty for every cracked after your first one.
  • Note that the robber's solution has to be in the same range of program lengths.
  • Each person may submit a maximum of 1 program per byte range per language (different versions and arbitrary substitutions of the same language don't count as separate languages). Example: you can post a 32 byte and a 64 byte pyth program, but you can't post a 128 byte program in both Java 7 and Java 8.
  • The person with the highest point total wins.

Submissions

Each submission must have the following pieces of information:

  • The name of the language. All new robbers' solutions must be the same language.
  • The range of the program size (this is the nearest power of two higher than the size of the program; for example, if your program is 25 bytes, this would be "≤32").
  • The actual string to be printed out.
  • If a submission is safe, put "safe" and the program length (to the nearest power of 2) in your header. If there are multiple numbers in your header, put the power of 2 last.

This stack snippet generates leaderboards and lists all of the open submissions. If there are any problems with the snippet, please leave a comment.

/* Configuration */

var QUESTION_ID = 60328; // Obtain this from the url
// It will be like http://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 167084; // This should be the user ID of the challenge author.

var SECONDSINDAY = 86400;
var SAFECUTOFFDAYS = 7;
var SORTBYTIME = true;
var SUBTRACTCRACKEDPOINTS = true;
var EXPIREDTIME = 1446336000;


/* App */

var answers = [],
  answers_hash, answer_ids, answer_page = 1,
  more_answers = true,
  comment_page;



function answersUrl(index) {
  return "//api.stackexchange.com/2.2/questions/" + QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "//api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {

  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function(data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });

}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function(data) {
      data.items.forEach(function(c) {

        answers_hash[c.post_id].comments.push(c);

      });

      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();


var SAFE_REG = /<h\d>.*?[sS][aA][fF][eE].*<\/\h\d>/;
var POINTS_REG = /(?:<=|≤|&lt;=)\s?(?:<\/?strong>)?\s?(\d+)/
var POINTS_REG_ALT = /<h\d>.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;
var CRACKED_HEADER_REG = /<h\d>.*[Cc][Rr][Aa][Cc][Kk][Ee][Dd].*<\/h\d>/;
var CRACKED_COMMENT_REG = /(.*[Cc][Rr][Aa][Cc][Kk][Ee][Dd].*<a href=.*)|(.*<a href=.*[Cc][Rr][Aa][Cc][Kk][Ee][Dd].*)/
var OVERRIDE_REG = /^Override\s*header:\s*/i;
var LANGUAGE_REG = /<h\d>\s*(.+?),.*<\/h\d>/;
var LANGUAGE_REG_ALT = /<h\d>\s*(<a href=.+<\/a>).*<\/h\d>/
var LANGUAGE_REG_ALT_2 = /<h\d>\s*(.+?)\s.*<\/h\d>/;
var LANGUAGE_REG_ALT_3 = /<h\d>(.+?)<\/h\d>/;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {

  var valid = [];
  var open = [];



  answers.forEach(function(a) {

    var body = a.body;
    var cracked = false;

    a.comments.forEach(function(c) {
      var was_safe = (c.creation_date + (SECONDSINDAY * SAFECUTOFFDAYS) > a.creation_date);
      if (CRACKED_COMMENT_REG.test(c.body) && !was_safe)
        cracked = true;
    });

    if (CRACKED_HEADER_REG.test(body)) cracked = true;

    // if (SUBTRACTCRACKEDPOINTS||!cracked) {

    var createDate = a.creation_date;
    var currentDate = Date.now() / 1000;
    var timeToSafe = (createDate + (SECONDSINDAY * SAFECUTOFFDAYS) - currentDate) / SECONDSINDAY;
    var SafeTimeStr = (timeToSafe > 2) ? (Math.floor(timeToSafe) + " Days") :
      (timeToSafe > 1) ? ("1 Day") :
      (timeToSafe > (2 / 24)) ? (Math.floor(timeToSafe * 24) + " Hours") :
      (timeToSafe > (1 / 24)) ? ("1 Hour") :
      "<1 Hour";

    var expired = createDate > (EXPIREDTIME);

    var safe = timeToSafe < 0;
    var points = body.match(POINTS_REG);
    if (!points) points = body.match(POINTS_REG_ALT);
    safe = safe && !cracked

    isOpen = !(cracked || safe);

    if (points) {
      var length = parseInt(points[1]);
      var safepoints = 0;
      if (length <= 4) safepoints = 32;
      else if (length <= 8) safepoints = 16;
      else if (length <= 16) safepoints = 8;
      else if (length <= 32) safepoints = 4;
      else if (length <= 64) safepoints = 2;
      else if (length <= 128) safepoints = 1;



      valid.push({
        user: getAuthorName(a),
        numberOfSubmissions: (safe && !expired) ? 1 : 0,
        points: (safe && !expired) ? safepoints : 0,
        open: (isOpen && !expired) ? 1 : 0,
        cracked: (cracked && !expired) ? 1 : 0,
        expired: (expired) ? 1 : 0
      });

    }

    if ((isOpen || expired) && points) {

      var language = body.match(LANGUAGE_REG);
      if (!language) language = body.match(LANGUAGE_REG_ALT);
      if (!language) language = body.match(LANGUAGE_REG_ALT_2);
      if (!language) language = body.match(LANGUAGE_REG_ALT_3);



      open.push({
        user: getAuthorName(a),
        length: points ? points[1] : "???",
        language: language ? language[1] : "???",
        link: a.share_link,
        timeToSafe: timeToSafe,
        timeStr: (expired) ? "Challenge closed" : SafeTimeStr
      });
    }
    // }
  });


  if (SORTBYTIME) {
    open.sort(function(a, b) {
      return a.timeToSafe - b.timeToSafe;
    });
  } else {
    open.sort(function(a, b) {
      var r1 = parseInt(a.length);
      var r2 = parseInt(b.length);
      if (r1 && r2) return r1 - r2;
      else if (r1) return r2;
      else if (r2) return r1;
      else return 0;
    });
  }

  var pointTotals = [];
  valid.forEach(function(a) {

    var index = -1;
    var author = a.user;
    pointTotals.forEach(function(p) {
      if (p.user == author) index = pointTotals.indexOf(p);
    });

    if (index == -1) pointTotals.push(a);
    else {
      pointTotals[index].points += a.points;
      pointTotals[index].numberOfSubmissions += a.numberOfSubmissions;
      pointTotals[index].cracked += a.cracked;
      pointTotals[index].expired += a.expired;
      pointTotals[index].open += a.open;
      if (SUBTRACTCRACKEDPOINTS && a.cracked && pointTotals[index].cracked > 1) pointTotals[index].points -= .5;
    }

  });

  pointTotals.forEach(function(a) {
    a.points += (a.numberOfSubmissions) ? ((a.numberOfSubmissions) * 3) : 0;
  });

  pointTotals.sort(function(a, b) {
    if (a.points != b.points)
      return b.points - a.points;
    else if (a.numberOfSubmissions != b.numberOfSubmissions)
      return b.numberOfSubmissions - a.numberOfSubmissions;
    else if (a.open != b.open)
      return b.open - a.open;
    else if (a.cracked != b.cracked)
      return a.cracked - b.cracked;
    else return 0;
  });



  pointTotals.forEach(function(a) {


    var answer = jQuery("#answer-template").html();
    answer = answer
      .replace("{{NAME}}", a.user)
      .replace("{{SAFE}}", a.numberOfSubmissions)
      .replace("{{OPEN}}", a.open)
      .replace("{{CLOSED}}", a.expired)
      .replace("{{CRACKED}}", a.cracked)
      .replace("{{POINTS}}", a.points);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);


  });



  open.forEach(function(a) {
    var answer = jQuery("#open-template").html();
    answer = answer
      .replace("{{NAME}}", a.user)
      .replace("{{LENGTH}}", a.length)
      .replace("{{LANGUAGE}}", a.language)
      .replace("{{TIME}}", a.timeStr)
      .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#opensubs").append(answer);
  });



}
body {
  text-align: left !important
}
#answer-list {
  padding: 10px;
  width: 350px;
  float: left;
}
#open-list {
  padding: 10px;
  width: 470px;
  float: left;
}
table thead {
  font-weight: bold;
  vertical-align: top;
}
table td {
  padding: 5px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">
<div id="answer-list">
  <h2>Leaderboard</h2>
  <table class="answer-list">
    <thead>
      <tr>

        <td>Author</td>
        <td>Safe</td>
        <td>Open</td>

        <td>Cracked</td>
        <td>Late Entry</td>
        <td>Score</td>
      </tr>
    </thead>
    <tbody id="answers">

    </tbody>
  </table>
</div>

<div id="open-list">
  <h2>Open submissions</h2>
  <table class="open-list">
    <thead>
      <tr>
        <td>Author</td>
        <td>Length</td>
        <td>Language</td>
        <td>Time Remaining</td>
        <td>Link (open in new tab)</td>
      </tr>
    </thead>
    <tbody id="opensubs">
    </tbody>
  </table>
</div>

<table style="display: none">
  <tbody id="answer-template">
    <tr>
      <td>{{NAME}}</td>
      <td>{{SAFE}}</td>
      <td>{{OPEN}}</td>

      <td>{{CRACKED}}</td>
      <td>{{CLOSED}}</td>
      <td>{{POINTS}}</td>


    </tr>
  </tbody>
</table>

<table style="display: none">
  <tbody id="open-template">
    <tr>
      <td>{{NAME}}</td>
      <td>{{LENGTH}}</td>
      <td>{{LANGUAGE}}</td>
      <td>{{TIME}}</td>
      <td><a target="_parent" href="{{LINK}}">Link</a>
      </td>
    </tr>
  </tbody>
</table>

Use the following formats for entries:

Language, (any text with the program size as the last number)
=

or

Language
=
Length <= 16

Note that the snippet will only put the first word in the header as the language if it doesn't detect a comma.

For safe submissions, put safe in your header. The snippet will automatically put your program in the "safe" column if the time is expired, so this is more to tell any robbers that your program is safe.

For cracked submissions, put cracked in your header.

The program should also be able to recognize if a comment says "cracked" and has a link; however, this is not guaranteed.

Tiebreaking order: Points -> # of Safe submissions -> Least amount of cracked submissions.

Note that the snippet sorts by open submissions before least cracked, but open submissions will not be counted at the end of the contest.

This challenge is now closed.

Most points overall winner: Dennis

Most safe submissions: DLosc

(Note that the number of safe submissions doesn't translate to a point amount, as the size of the programs are considered in calculating the score).

\$\endgroup\$
17
  • 5
    \$\begingroup\$ We should remind the cops that the output should better be longer than the program size, to reduce trivial solutions like codegolf.stackexchange.com/a/60395 and codegolf.stackexchange.com/a/60359 \$\endgroup\$
    – kennytm
    Oct 11, 2015 at 16:56
  • 2
    \$\begingroup\$ @bmarks There has to exist a way to execute the language, and the language must be able to display a string of ASCII characters. If you want to use HQ9+, congratulations, you have just gotten yourself a cracked submission. \$\endgroup\$
    – Daniel M.
    Oct 12, 2015 at 20:35
  • 3
    \$\begingroup\$ @bmarks I'd prefer not, but I'm not going to stop you. \$\endgroup\$
    – Daniel M.
    Oct 12, 2015 at 21:30
  • 15
    \$\begingroup\$ All the number-only outputs are super boring. \$\endgroup\$
    – mbomb007
    Oct 13, 2015 at 20:06
  • 4
    \$\begingroup\$ Please consider using the Sandbox the next time. Preferably, the rules of a challenge shouldn't change at all after it has been posted. I've lost track of how many times the rules have changed here... \$\endgroup\$
    – Dennis
    Oct 17, 2015 at 20:01

209 Answers 209

1
2 3 4 5
7
19
\$\begingroup\$

Pyth, Safe, Range ≤ 8

['ashva', 'cxedo', 'ecckc', 'hhzsq', 'jmwze', 'lrths', 'nwrog', 'pbowu', 'rgldi', 'uljlw', 'wpgsk', 'yuday'

The code:

%^T6`^G5

Explanation:

To clarify how this works: I generated all possible 5 character strings of lowercase letters (^G5). Then, I generated the string representation of this list: (`^G5). Finally, I took every 1,000,000th character of that list (%^T6). The result is something which looks like a list of strings, but is suspiciously missing its end bracket.

\$\endgroup\$
4
  • \$\begingroup\$ is there no close ]? \$\endgroup\$
    – Maltysen
    Oct 11, 2015 at 22:41
  • 1
    \$\begingroup\$ @Maltysen Nope. \$\endgroup\$
    – isaacg
    Oct 11, 2015 at 22:42
  • 4
    \$\begingroup\$ Saw the second item as "xCode" scrambled, thought it may be a list of IDEs scrambled but I wasn't able to identify any of the others :o \$\endgroup\$ Oct 12, 2015 at 7:55
  • 1
    \$\begingroup\$ Tough one! I found the pattern in the strings, but no idea how to generate it in <=8 bytes. \$\endgroup\$ Oct 16, 2015 at 22:04
16
\$\begingroup\$

VBA , [Safe]

Range <= 128 bytes

Hint for where to output

Ran in Excel 2007, output was to Debug.print. Its VBA good luck getting anything under 128 bytes to run.

Output 255 bytes

 This array is fixed or temporarily locked THIS ARRAY IS FIXED OR TEMPORARILY LOCKED this array is fixed or temporarily locked This Array Is Fixed Or Temporarily Locked I n v a l i d   p r o c e d u r e   c a l l   o r   a r g u m e n t  ?????????????????

Solution

Well I hope someone had fun trying to crack this one. I can say that this is some of the worst error-handling I have ever done and feel bad for how bad this code is.

Code

    Sub e()
    On Error Resume Next
    Err.Raise 10
    For i = 0 To 128
    b = b & " " & StrConv(Err.Description, i)
    Next
    Debug.Print b
    End Sub'

Explained

First the code starts with one of the Major sins of VBA. On Error Resume next.
Once we have committed that horrid act we go ahead and just throw and error. this is the This array is fixed or temporarily locked Error that we will soon see in the output.

The next is the loop. We loop 128 times trying to Convert the Error Description, But the only valid inputs for i are 1,2,3,64,128. Because of this the first 4 loops print the Error with Various Formats. Then when i = 4 the code throws a new Error Invalid call Then that loops and nothing is assigned to b because the strconv function errors out each time.

This is where any normal program should have stopped, But because we have the On Error Resume Next every error is ignored and the code continues unfazed by the poor error-handling

Now we hit i=32 and we add the new error to b converted to Unicode and then continue looping until i = 128 at which point we convert our error FROM Unicode which results in the ????????????????? string being added to b

Finally Print out the mess of Errors we have concatenated together

\$\endgroup\$
13
\$\begingroup\$

Mathematica, safe, range ≤ 64

Output:

CGTAGGCCCATTTTGTGTGAATTGCGGTGCAGCGAGCGATATGTTGTCTGGGCACGGACGCAGAGTTAGGGTAGCTGGTG

Source:

Print@@Characters["GATC"][[1+First@RealDigits[Pi,4,80]]]
\$\endgroup\$
8
  • 6
    \$\begingroup\$ Now I'll have to GenomeLookup everything... \$\endgroup\$ Oct 12, 2015 at 0:19
  • 3
    \$\begingroup\$ Really! What gave it away? \$\endgroup\$
    – user46060
    Oct 12, 2015 at 6:30
  • 2
    \$\begingroup\$ Maybe I should have changed the letters! \$\endgroup\$
    – user46060
    Oct 12, 2015 at 19:14
  • 1
    \$\begingroup\$ Lol, with that many repeat characters and 64 bytes to work with you could easily make a function just print that string pretty easily. xD \$\endgroup\$ Oct 14, 2015 at 7:22
  • 4
    \$\begingroup\$ I have added the source. This is of course NOT anything related to genomes, but rather 80 digits of pi in base 4, encoded using "GATC" to make people think of double helixes. \$\endgroup\$
    – user46060
    Oct 19, 2015 at 11:52
11
\$\begingroup\$

ngn APL (safe)

0.675640430319848J0.8376870144941628

Range ≤ 8

Solution

*3○⍟⍣=42

Try it online.

How it works

  • ⍟⍣=42 applies natural logarithm () repeatedly to 42 until a fixed point is reached (⍣=), yielding 0.31813150520476413J1.3372357014306895.

    The initial value doesn't really matter here, as long as it's neither 1 nor 0.

  • 3○ applies tangent to its right argument, yielding 0.07343765001657206J0.8920713530605129.

  • * applies the natural exponential function to its right argument, yielding the desired output.

\$\endgroup\$
1
  • \$\begingroup\$ The absolute value isn't quite 1. Interesting. \$\endgroup\$
    – lirtosiast
    Oct 11, 2015 at 3:56
10
\$\begingroup\$

Pyth, cracked by Sp3000

1234465889612101271616181215168242024142718209323236243032163621242510

Range ≤ 8

\$\endgroup\$
1
  • \$\begingroup\$ Cracked :) \$\endgroup\$
    – Sp3000
    Oct 11, 2015 at 7:00
8
\$\begingroup\$

><> (Safe)

Tested on the online and official interpreters.

Range: <= 16

String: 4621430504113348052246441337820019217490490

This is pretty 1337, huh?

Explanation:

Here's the source code (15 bytes):

f1-:0(?;::0g*n!

f pushes 15 (our counter) onto the stack (this is skipped by the ! at the end so as not to push more than one counter)

1- subtracts 1 from the counter

:0(?; The frowny face tests if the counter is less than 0, the rest ends the program if it is

:: Duplicates the counter twice

0g Grabs the character at the point (c,0) in the source code where c is the counter

* Multiplies the second duplicate of the counter by the ASCII representation of the character previously grabbed

n Prints the result.

So, split up, the output is [462, 1430, 504, 1133, 480, 522, 464, 413, 378, 200, 192, 174, 90, 49, 0]. This corresponds to the ASCII interpretation of the code in reverse multiplied by the numbers 14 to 0 (i.e. [!*14, n*13, ... f*0]).

Probably the hardest part about cracking this would be figuring out how to split up the numbers correctly, but if you get the right ones it's just a matter of trying things until you get something that works.

\$\endgroup\$
8
\$\begingroup\$

Python, <=16 (cracked by kennytm)

[[[22111101102001]]]

This was produced via REPL (running a command in Python shell).

While I'm editing this, I'll also summarize the comments for future spoiler-free robbers: this doesn't work in all Pythons. It does work in a build of Python 2.7 where sys.maxint = 9223372036854775807.

\$\endgroup\$
11
  • 2
    \$\begingroup\$ This is very hard. \$\endgroup\$
    – J Atkin
    Oct 15, 2015 at 19:58
  • 1
    \$\begingroup\$ Does it work in both Python 2 and Python 3? \$\endgroup\$
    – DLosc
    Oct 15, 2015 at 21:43
  • 1
    \$\begingroup\$ Eep. Python 2 only, sorry. \$\endgroup\$
    – histocrat
    Oct 15, 2015 at 21:48
  • 1
    \$\begingroup\$ Meaning it categorically doesn't work in Python 3? \$\endgroup\$
    – DLosc
    Oct 15, 2015 at 21:56
  • 1
    \$\begingroup\$ That's a hint, but yes, I promise that it does not work in Python 3. \$\endgroup\$
    – histocrat
    Oct 15, 2015 at 22:11
7
\$\begingroup\$

Matlab, ≤16. Cracked by Wauzl

Range ≤16.

This works in Octave too.

The printed string is as follows:

ans =

     0     0     0     0     0     0     0     0     0
     0     0     0     0     9     4     0     0     0
     0     0     0     0    32    18     0     0     0
     0     0     0     9     1     0     3     0     0
     0     0     7     0     0     2    10     0     0
     0     0     3     0     2     2     3     0     0
     0     0     0    19    63    22     1     0     0
     0     0     0     4    13     4     0     0     0
     0     0     0     0     0     0     0     0     0
\$\endgroup\$
2
  • 3
    \$\begingroup\$ Good job, I tried to come up with something like this, but this one is really nice, I have really no clue how this should work=) \$\endgroup\$
    – flawr
    Oct 11, 2015 at 19:37
  • \$\begingroup\$ Cracked \$\endgroup\$
    – Wauzl
    Oct 12, 2015 at 10:15
7
\$\begingroup\$

Perl (safe)

84884488488444224424428844884884884488488444224424428844884884884488488444224424424422442442884488488488448848844422442442884488488488448848844422442442442244244244224424422211221221221122122144224424424422442442221122122144224424424422442442221122122144224424424422442442221122122122112212214422442442442244244222112212214422442442442244244222112212218844884884884488488444224424424422442442884488488488448848844422442442884488488488448848844422442442884488488488448848844422442442442244244288448848848844884884442244244288448848848844884884442244244244224424424422442442221122122122112212214422442442442244244222112212214422442442442244244222112212218844884884884488488444224424424422442442884488488488448848844422442442884488488488448848844422442442884488488488448848844422442442442244244288448848848844884884442244244288448848848844884884442244244244224424424422442442221122122122112212214422442442442244244222112212214422442442442244244222112212212212211222442442244244244224412212211222442442244244244224412212211221221221122244244224424424422442442442244488488448848848844882442442244488488448848848844882442442244244244224448848844884884884488244244224448848844884884884488244244224448848844884884884488244244224424424422444884884488488488448812212211222442442244244244224412212211222442442244244244224412212211221221221122244244224424424422442442442244488488448848848844882442442244488488448848848844882442442244244244224448848844884884884488244244224448848844884884884488244244224448848844884884884488244244224424424422444884884488488488448812212211222442442244244244224412212211222442442244244244224412212211221221221122244244224424424422441221221122244244224424424422441221221122244244224424424422441221221122122122112224424422442442442244244244224448848844884884884488244244224448848844884884884488244244224424424422444884884488488488448824424422444884884488488488448824424422444884884488488488448824424422442442442244488488448848848844882442442244488488448848848844882442442244488488448

Range ≤ 32

Solution

print 2**y/124589//for-951..1048

Try it online.

How it works

  • for-951..1048 executes the preceding command for each integer in this range, saving it in the implicit variable.

  • y/124589// performs transliteration, eliminating the specified digits from the implicit variable.

    y/// will return the number of eliminations, i.e., the number of occurrences of those digits in the implicit variable.

  • print 2** prints 2 to the power of eliminations (1, 2, 4 or 8).

\$\endgroup\$
0
7
\$\begingroup\$

Javascript (console), <= 32 (cracked by insertusernamehere)

"a,a,0,a,b,a,a,b,a,a,4,a,b,a,a,a,a,6,a,b,a,a"

Tested in Chrome and Firefox web consoles. That's a 43 character string.

My intended solution was a bit more elaborate than the linked one (curse you, ES6!).

'a,b,a,a'.replace(/(a)/g,Array)

Explanation:

When you call replace with a Regular Expression with the /g flag and a function, it replaces everything matching the regex with the result of calling the function with these arguments: The matched string, every capture group in the matched string, the index the matched string has in the whole string, and the whole string. In this case, that'll be "a", "a", 0 or 4 or 6, and "a,b,a,a". All of these arguments are passed into the Array constructor, which simply creates an array of everything passed in. Then replace converts that to a string, e.g. "a,a,0,a,b,a,a" and replaces the "a" character with it.

\$\endgroup\$
3
  • \$\begingroup\$ Got it down to 37 bytes. It looks like hex, so hope that helps. \$\endgroup\$
    – mbomb007
    Oct 15, 2015 at 22:02
  • \$\begingroup\$ Cracked? :) \$\endgroup\$ Oct 19, 2015 at 10:31
  • 1
    \$\begingroup\$ I can't upvote again, but that is a pretty nice program. \$\endgroup\$ Oct 19, 2015 at 13:31
7
\$\begingroup\$

Snowman 1.0.2

Range ≤32.

110110111011011001111100111111111101111110101000101000100001100001100011100011101110110111011011111011111011101011101111101111110111110111111011110101111010111100101100101001111001111111011111011010111010111000000100000011111001111100

The solution is:

"mO~(!#]/.}{k2'=+@|":2nBspsP;aE
\$\endgroup\$
2
  • \$\begingroup\$ This is such a weird language... need to figure it out before attempting to crack... \$\endgroup\$
    – GamrCorps
    Oct 12, 2015 at 3:16
  • 3
    \$\begingroup\$ Almost there... keep getting a segfault 11 though... \$\endgroup\$
    – GamrCorps
    Oct 12, 2015 at 3:54
6
\$\begingroup\$

><>, ≤ 8 [cracked]

oooooooooooo

That's a total of 12 os. The program halts without error, and works with both the official interpreter and the online interpreter.

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

TI-BASIC, ≤4 bytes, cracked by Reto Koradi

This took 5 days 23 hours to crack. So close...

Output (10 bytes):

.495382547

Program:

³√(tanh(7°

Since it's basically impossible for someone to guess this, my goal in designing this program was to make brute force the only possible approach.

To do this, I prevented the output, or the output with one of these inverse functions applied, from showing up on the ISC. ISC doesn't have hyperbolic tangent, and I figured that no similar tool would have tanh(7°.

To add some security against brute force, I used degree-to-radian conversion, a slightly obscure feature, but it wasn't enough.

\$\endgroup\$
19
  • 10
    \$\begingroup\$ @Conor O'Brien you only need 10 bytes to write out the decimal itself! \$\endgroup\$
    – Arcturus
    Oct 11, 2015 at 22:14
  • 1
    \$\begingroup\$ Here is a list of all TI-84+ BASIC commands, as well as thorough documentation. \$\endgroup\$
    – lirtosiast
    Oct 13, 2015 at 2:08
  • 2
    \$\begingroup\$ Just so it's clear too, Thomas (and I'd assume most people) consider things like sin( to be 1 byte on TI-BASIC. So something like sin(sin(sin(e would only be 4 bytes. \$\endgroup\$ Oct 13, 2015 at 9:33
  • 1
    \$\begingroup\$ In fact, for all we know, he could be using fPart(. \$\endgroup\$ Oct 13, 2015 at 12:13
  • 1
    \$\begingroup\$ @AlbertRenshaw Yes, I had picked up on that. The documentation that Thomas linked lists a "token size" for each operator. I figure that's what we're counting, and that the operators he uses would most likely come from this list: tibasicdev.wikidot.com/one-byte-tokens. \$\endgroup\$ Oct 15, 2015 at 6:06
6
\$\begingroup\$

CJam, ≤ 8 [safe]

379005901358552706072646818049622056

I don't like long numbers so here's a short one. Feel free to fiddle both offline and online.

Since I find number-only submissions pretty boring, I'll be slowly putting out a few hints to compensate.

Hint 1: The program ends with a single number of the stack, and none of the A-K variables are used.
Hint 2: The number encodes information that is completely retrievable if you reverse the process (i.e. no information has been lost).
Hint 3: The "information" from hint 2 is a single string which is created after the first four chars.


Solution

The program was

0W#sWcib

0W# is 0^-1, which instead of erroring out gives Infinity. s then casts this to a string (note that ` gives 1d0/ instead).

For the other half, Wc converts -1 to a char, which becomes code point 65535 due to the wraparound for chars (see this tip). i then converts the char back to an int, i.e. 65535.

Finally, b converts the string Infinity to base 65535 to give the above number.

\$\endgroup\$
5
\$\begingroup\$

Python, <= 32 (cracked by Egor Skriptunoff)

Output is 1832 bytes, including newlines:

163
485
559
1649
2707
8117
8415
24929
41891
124133
142639
423793
694675
2075317
2162655
6357089
10682531
31785445
36635183
108070513
177408659
531963829
551493855
1633771873
2745410467
8135173349
9347869999
27774121841
45526653331
136007297717
141733920735
416611827809
700079669411
2083059139045
2400886719023
7082401072753
11626476472979
34862249549749
36142149804255
107069239746913
179920475038627
533147175478501
612629840276783
1820177075697521
2983606407043475
8913418645908149
9288532499693535
27303489359118433
45881121294188707
136517446795592165
157346912904610351
464159319105013361
761964388609624723
2284767248741900213
2368648071721459935
7016996765293437281
11791448172606497699
34940303480791033061
40148795925132553519
119288945009988433777
195535487181321247123
584146895667469134517
608742554432415203295
1789334175149826506849
3006819284014656913571
8946670875749132534245
10311729937203639353903
30418680977547050616433
49935336207531756227219
149732221646300430475189
155229351380265876857055
459858883013505412260193
772752555991766826787747
2289849682101787770873061
2631225127929856733097263
7817601011229592008423281
12814491939404182769539475
38282841570818685533137589
39893943304728330352263135
117267593836794179779362913
197057915416468570144702627
586337969183970898896814565
675799844894514912336740911
1993549095225501056249169521
3272612129033008707863251603
9813000610033591312052461493
10173266001408484771580813535
30137771616056104203296268641
50643884262032422527188575139
150067460764265635881358255333
172437765505860562200296238383
512342117472953771456036566897
839818522529453467650609486227
2508891813142320379359897758389
2614529362361980586296269078495
7685131765672974922140201517153
12914190492831906312462400487587
38425658828364874610701007585765
44288542855785494654395594310191
\$\endgroup\$
7
  • \$\begingroup\$ I see a pattern of 4s. \$\endgroup\$
    – J Atkin
    Oct 14, 2015 at 22:27
  • \$\begingroup\$ cracked? \$\endgroup\$ Oct 14, 2015 at 22:54
  • \$\begingroup\$ @EgorSkriptunoff Yep--I used a different looping structure, but otherwise it's the same logic. \$\endgroup\$
    – DLosc
    Oct 15, 2015 at 5:13
  • \$\begingroup\$ @DLosc - Can it be made even shorter with another loop? \$\endgroup\$ Oct 15, 2015 at 9:39
  • \$\begingroup\$ @EgorSkriptunoff I used a Python golfing technique--I'm not going to post my code because I might do something similar in another answer, but you can find the concept on the Python tips page. \$\endgroup\$
    – DLosc
    Oct 15, 2015 at 18:17
5
\$\begingroup\$

CJam (cracked by Dennis)

Length <= 4

1737589973457545958193355601

I don't give this a very high chance of survival, but I wanted to try a 4 byte solution anyway.

My code was exactly what Dennis reverse engineered:

H     Push 17
J     Push 19.
K     Push 20.
#     Power.

CJam then prints all of the stack content, concatenated. So the output was 17 concatenated with 19^20.

\$\endgroup\$
3
  • \$\begingroup\$ Cracked. \$\endgroup\$
    – Dennis
    Oct 16, 2015 at 18:10
  • \$\begingroup\$ @Dennis Ok, officially marked as cracked. I didn't really expect it to hold up, but I'm interested anyway: Did you brute force it? Or did you have a good guess on what I probably did? \$\endgroup\$ Oct 17, 2015 at 2:04
  • 1
    \$\begingroup\$ The output is too large to be anything but a factorial or a power, and factorials this big would have a few trailing zeroes. I started with KK#, tried a few more powers, and finally found JK#. \$\endgroup\$
    – Dennis
    Oct 17, 2015 at 2:09
5
\$\begingroup\$

Pip, <= 16 (safe)

This is my final Pip submission, I promise. :)

0123456789
0        9
0        9
0        9
0        9
0        9
0        9
0        9
0        9
0        9
0        9
0123456789

I'll be surprised if anybody gets this down to 16 bytes--it took me quite a few tries to make it fit. (Take that as a challenge if you like!)


Answer:

Px:J,tLtP09JsX8x

This code makes use of the predefined variables t = 10 and s = space.

    ,t            Range(10)
   J              Join into string: "0123456789"
Px:               Assign to x and print
      Lt          Loop 10 times:
         09         This is a numeric literal, but it can act like a string "09" because
                    strings and numbers are the same data type in Pip
            sX8     8 spaces
           J        Join left arg on right arg: "0        9"
        P           Print
               x  Last expression in a program is autoprinted: "0123456789"
\$\endgroup\$
4
  • \$\begingroup\$ This is pretty cool. \$\endgroup\$
    – J Atkin
    Oct 17, 2015 at 3:10
  • \$\begingroup\$ Hmm... Each number is the column number, 0-indexed. :-/ \$\endgroup\$
    – user46167
    Oct 20, 2015 at 21:07
  • \$\begingroup\$ @JAtkin I think so too. ^_^ Explanation added. \$\endgroup\$
    – DLosc
    Oct 23, 2015 at 10:21
  • \$\begingroup\$ Very nice, have a +1 ;) \$\endgroup\$
    – J Atkin
    Oct 23, 2015 at 12:51
4
\$\begingroup\$

Ruby, cracked by kennytm

Range: ≤64.

#<MatchData "@@" 1:"@" 2:"@">
"#<ArgumentError: unknown command \"\\x00\">\nu#<ArgumentError: unknown command \"\\x00\">\nn#<ArgumentError: unknown command \"\\x00\">\nk#<ArgumentError: unknown command \"\\x00\">\nn#<ArgumentError: unknown command \"\\x00\">\no#<ArgumentError: unknown command \"\\x00\">\nw#<ArgumentError: unknown command \"\\x00\">\nn#<ArgumentError: unknown command \"\\x00\">\n #<ArgumentError: unknown command \"\\x00\">\nc#<ArgumentError: unknown command \"\\x00\">\no#<ArgumentError: unknown command \"\\x00\">\nm#<ArgumentError: unknown command \"\\x00\">\nm#<ArgumentError: unknown command \"\\x00\">\na#<ArgumentError: unknown command \"\\x00\">\nn#<ArgumentError: unknown command \"\\x00\">\nd#<ArgumentError: unknown command \"\\x00\">\n #<ArgumentError: unknown command \"\\x00\">\n\"#<ArgumentError: unknown command \"\\x00\">\n\\#<ArgumentError: unknown command \"\\x00\">\nx#<ArgumentError: unknown command \"\\x00\">\n0#<ArgumentError: unknown command \"\\x00\">\n0#<ArgumentError: unknown command \"\\x00\">\n\"#<ArgumentError: unknown command \"\\x00\">\n@#<ArgumentError: unknown command \"\\x00\">\n@#<ArgumentError: unknown command \"\\x00\">\n"

(And yes, all output is to STDOUT.)

Intended solution:

test'@@'=~/(.)(.)/ rescue p"#{$!}#{p$~}".gsub(//,$!.inspect+$/)
\$\endgroup\$
2
  • \$\begingroup\$ cracked \$\endgroup\$
    – kennytm
    Oct 11, 2015 at 18:24
  • \$\begingroup\$ @kennytm Wow, I'm impressed. You even managed to make it one character shorter than my original code! \$\endgroup\$
    – Doorknob
    Oct 11, 2015 at 18:36
4
\$\begingroup\$

TI-BASIC (cracked by Thomas Kwa)

TI-89 variant
Range: ≤8
Output length: 460

1257286521829809852522432602192237043962420111587517182185282167859393833998435970616540717415898427784984473447990617367563433948484506876830127174437083005141539040356040105854054119132085436114190914221684704295353373344661986220406465038338295680627940567692710933178603763184382721719223039895582218462276317539764129360057392146874652124017927952151332902204578729865820715723543552685154087469056000000000000000000000000000000000000000000000000000000000

I don't think you can use RIES on this but I doubt it will survive 7 days anyway. Oh well.

Code:

236!
\$\endgroup\$
3
4
\$\begingroup\$

MATLAB, cracked by Tom Carpenter

Range <= 16

ans =

        5760       22320
       13920       53940
\$\endgroup\$
4
  • \$\begingroup\$ Grr, 17 is the closest I can get! \$\endgroup\$ Oct 11, 2015 at 22:38
  • 8
    \$\begingroup\$ In fact I have so far found 8 ways to do it in 17 bytes! \$\endgroup\$ Oct 11, 2015 at 22:59
  • 2
    \$\begingroup\$ Cracked: codegolf.stackexchange.com/a/60436/42295 \$\endgroup\$ Oct 12, 2015 at 0:06
  • 2
    \$\begingroup\$ Man that was a fun challenge! \$\endgroup\$ Oct 12, 2015 at 0:07
4
\$\begingroup\$

Mathematica, Cracked by Sp3000

Range: <= 32

808017424794512875886459904961710757005754368000000000
\$\endgroup\$
1
  • \$\begingroup\$ Cracked \$\endgroup\$
    – Sp3000
    Oct 13, 2015 at 3:49
4
\$\begingroup\$

Thue - <= 64 Bytes, cracked by histocrat.

555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555

That's 2016 5s; by the way.

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

Lua, ≤ 4 (cracked by feersum)

Output:

9.5367431640625e-07

You need to find a string for Lua REPL which results in "1/M" constant.
It is simple, but not very trivial.

\$\endgroup\$
5
  • \$\begingroup\$ @LegionMammal978 - Hint: In Lua 5.3 REPL one can omit = before the expression. \$\endgroup\$ Oct 13, 2015 at 11:44
  • \$\begingroup\$ What I do know, however, is that there's no answer here... \$\endgroup\$ Oct 14, 2015 at 10:53
  • \$\begingroup\$ @LegionMammal978 - Yes, the link you have given is the right place to read. You already have all the information you need. Just solve it. \$\endgroup\$ Oct 14, 2015 at 11:01
  • \$\begingroup\$ cracked \$\endgroup\$
    – feersum
    Oct 17, 2015 at 23:02
  • \$\begingroup\$ interesting non-solution: 0x2p-21 \$\endgroup\$ Oct 19, 2015 at 8:33
4
\$\begingroup\$

CJam, ≤8 (safe)

\"3.341594\43181\

Original code:

P`_`_`er

That is, to start with 3.141592653589793 and replace each character in "3.141592653589793" with the corresponding character in "\"3.141592653589793\"". With the duplicates removed, it's actually replacing ".123456789 with ""35\.49831.

\$\endgroup\$
4
\$\begingroup\$

Python 2 (safe 16)

(1.06779146638-0.024105112278j)

Range ≤ 16. In case the version matters (for printing precision?), I'm using ideone.

I don't see a way of guessing the code without computer search, but you all have impressed me before.


Answer:

print.7j**8j**2j
\$\endgroup\$
3
  • 1
    \$\begingroup\$ Is this REPL or a full program? \$\endgroup\$
    – lirtosiast
    Oct 11, 2015 at 14:26
  • \$\begingroup\$ @ThomasKwa Full program. \$\endgroup\$
    – xnor
    Oct 11, 2015 at 17:49
  • \$\begingroup\$ Used dir(complex) to see what ops are defined for complex numbers. I didn't know you could use a modulus. Note that this won't likely be helpful, but maybe... \$\endgroup\$
    – mbomb007
    Oct 15, 2015 at 16:25
3
\$\begingroup\$

Pyth, Cracked by Sp3000

Range: <= 4

New, valid answer

I'm sure this can be brute forced with such a small program size, but lets see.

3582409715080948947248394822102989658717877178836918915255342812682764990143662880
\$\endgroup\$
3
  • \$\begingroup\$ The output must consist exclusively of printable ascii. \$\endgroup\$ Oct 11, 2015 at 17:34
  • \$\begingroup\$ @SuperJedi224 dang, fixed \$\endgroup\$
    – Maltysen
    Oct 11, 2015 at 17:35
  • \$\begingroup\$ Cracked \$\endgroup\$
    – Sp3000
    Oct 12, 2015 at 1:46
3
\$\begingroup\$

JavaScript ES6, ≤128 bytes - Cracked

Output (1124 bytes):

00371223425266831021221451701972262572903253624014424855305776266777307858429019621025109011571226129713701445152216011682176518501937202621172210230524022501260227052810291730263137325033653482360137223845397040974226435744904625476249015042518553305477562657775930608562426401656267256890705772267397757077457922810182828465865088379026921794109605980210001102021040510610108171102611237114501166511882121011232212545127701299713226134571369013925141621440114642148851513015377156261587716130163851664216901171621742517690179571822618497187701904519322196011988220165204502073721026213172161021905222022250122802231052341023717240262433724650249652528225601259222624526570268972722627557278902822528562289012924229585299303027730626309773133031685320423240132762331253349033857342263459734970353453572236101364823686537250376373802638417388103920539602400014040240805412104161742026424374285043265436824410144522449454537045797462264665747090475254796248401488424928549730501775062651077515305198552442529015336253825542905475755226556975617056645571225760158082585655905059537600266051761010615056200262501630026350564010

Have fun, and good luck!

Original code:

new Array(254) .fill(0).map((x,s)=>s*s-s/((5-s)||3)).map(Math.floor).join``
\$\endgroup\$
3
  • \$\begingroup\$ Still safe :3 \$\endgroup\$ Oct 13, 2015 at 16:56
  • 1
    \$\begingroup\$ I enjoyed this. Cracked \$\endgroup\$
    – SLuck49
    Oct 13, 2015 at 17:31
  • \$\begingroup\$ @SLuck49 I posted the code. \$\endgroup\$ Oct 14, 2015 at 0:26
3
\$\begingroup\$

TI-BASIC (cracked by Thomas Kwa)

Range: <= 2

String: -10

Code: Xmin

There's just no fooling this guy...

\$\endgroup\$
5
  • \$\begingroup\$ You haven't already cracked it have you? \$\endgroup\$ Oct 15, 2015 at 1:16
  • 1
    \$\begingroup\$ I would be seriously sad if you did this is pretty clever imo. \$\endgroup\$ Oct 15, 2015 at 1:16
  • \$\begingroup\$ In Python this is ~9 (bit inversion) \$\endgroup\$
    – user193661
    Oct 15, 2015 at 5:43
  • \$\begingroup\$ Sure, but you have to answer it in TI-BASIC. At any rate it doesn't really matter; Thomas already cracked it. I think he's waiting just to be nice (?). \$\endgroup\$ Oct 15, 2015 at 13:41
  • \$\begingroup\$ Cracked \$\endgroup\$
    – lirtosiast
    Oct 15, 2015 at 16:18
3
\$\begingroup\$

AppleScript, ≤ 2 Bytes Cracked

"Brute forced... grumble grumble..."

What's this? A short AppleScript answer? :o

missing value

(yes, this DOES print to stdout)

\$\endgroup\$
4
  • \$\begingroup\$ a= or a- 1= or 1- or ? I have no idea=) \$\endgroup\$
    – flawr
    Oct 15, 2015 at 18:41
  • \$\begingroup\$ Nope. Those will throw to STDERR as error #-2741. \$\endgroup\$ Oct 15, 2015 at 18:46
  • \$\begingroup\$ osascript -e 'say "Cracked."' \$\endgroup\$
    – r3mainer
    Oct 16, 2015 at 11:50
  • 1
    \$\begingroup\$ @squeamishossifrage You can shorten that by one byte using say"Cracked.", and, if you don't mind grammar, one more byte with say"Cracked". c: \$\endgroup\$ Oct 16, 2015 at 12:23
3
\$\begingroup\$

><> (Fish), Cracked by Sp3000

Length <= 8

>>>>>>>>>>>>>>>>>>>>>>>

The output is 23 >'s and the program produces no error.

\$\endgroup\$
1
  • \$\begingroup\$ Cracked \$\endgroup\$
    – Sp3000
    Oct 17, 2015 at 10:00
1
2 3 4 5
7

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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