Significant Whitespace: Cops

51

2

For the purpose of this challenge, we'll define whitespace as only linefeeds (0x0A) and spaces (0x20). Note that most languages and regex flavours consider many other characters as whitespace as well, both inside and outside the ASCII range so you might not be able to make use of the corresponding built-ins.

The Cops' Challenge

You should write a program or function in a language of your choice, which takes a string, consisting of ASCII (except NUL) characters, as input and outputs it with all whitespace removed. For example if you received the following input:

H e l l o,
 W o r l  d!

You should output

Hello,World!

Your submission will then be your source code with all whitespace removed (the same process as passing your solution as input to itself, although your solution may also contain characters outside the ASCII range). Your goal is to make it as hard as possible to figure out where whitespace needs to be inserted to recover a valid solution in your language of choice. Note that robbers may insert fewer whitespace than you removed, but not more. Also remember that robbers don't have to match your exact code, they just have to find any valid solution.

Your answer should contain the following:

  • The language (and version if necessary) in which you wrote your solution.
  • The byte count of your solution before removing whitespace.
  • Your solution with whitespace removed.

Your solution may be either a program or function, but not a snippet and you must not assume a REPL environment. You may take input via STDIN, command-line argument or function argument and output via STDOUT, function return value or function (out) parameter.

In the interest of fairness, there must be a freely available interpreter or compiler for your chosen language.

You must not use built-ins for hashing, encryption or random number generation (even if you seed the random number generator to a fixed value). Your solution must be able to process any string of 100 characters or less in under 10 seconds on a reasonable desktop machine.

If your answer has not been cracked within 7 days (168 hours), you may reveal your own solution at which point your answer is considered safe. As long as you don't reveal your solution, it may still be cracked by robbers, even if the 7 days have already passed. The shortest safe answer wins (measured before removing whitespace).

If your answer does get cracked, please indicate this in the header of your answer, along with a link to the corresponding robber's answer.

Go here for the robbers' part.

Uncracked Submissions

<script>site = 'meta.codegolf'; postID = 5686; isAnswer = false; QUESTION_ID = 103182;</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>

Martin Ender

Posted 2016-12-14T19:30:15.213

Reputation: 184 808

Related. (Inspiration, in fact.) – Martin Ender – 2016-12-14T19:34:00.987

7Seems like Whitespace would break this challenge... – NoOneIsHere – 2016-12-14T19:51:10.333

8@SeeOneRhino Why? The robber just has to solve the problem in Whitespace, not using more bytes than the cop. Unless a cop finds a crazily well-golfed Whitespace answer that no one can match, Whitespace answers are generally the most vulnerable in this challenge. – Martin Ender – 2016-12-14T19:53:05.440

I guess I misunderstood. I thought whitespace would do something strange... – NoOneIsHere – 2016-12-14T20:07:03.297

1@SeeOneRhino Also, tabs don't count as whitespace, so they wouldn't be removed. – mbomb007 – 2016-12-14T20:59:34.987

4No hexagony submissions this time, I guess – MildlyMilquetoast – 2016-12-15T00:03:33.610

If my language accepts input one character at a time (and outputs one character at a time as well), can I separate my input/output by lines? – Gabriel Benamy – 2016-12-15T14:46:55.403

@GabrielBenamy how would you represent linefeeds in that case? I don't see why reading input character by character would make the task a problem? – Martin Ender – 2016-12-15T14:48:13.273

When COW reads ASCII input, it reads the first character, stores its code point in memory, and then continues reading and discarding characters until it reaches a \n. So to represent a newline in your input, simply have two newlines in a row. – Gabriel Benamy – 2016-12-15T14:52:46.227

@GabrielBenamy if that's the only way to represent an arbitrary string, I'm fine with it, but please state this in your answer. – Martin Ender – 2016-12-15T14:57:12.760

The snippet doesn't seem to do anything for me on Firefox, though it throws a "400 (Bad Request)" error on Chrome. – ETHproductions – 2016-12-15T16:08:37.607

It strikes me that a winning solution in PERL would be using acme::Bleach; followed by a bunch of whitespace, well golfed. Gives the robbers literally no information to go from! Anyone feel like coding that? – Cort Ammon – 2016-12-16T17:03:55.970

Answers

17

Haskell, 100 bytes, cracked by nimi

main=interact$iddoidlinesidwordsdoidoidoid=doiddoid<-dooiidoid<-dooiddoiddodoid

This is a full program and a dadaistic poem.


Code with withspace (Try it online!)

main=interact$id doid lines id words
doid oi d o id=do
 iddoid<-do oi id
 oid<-do o iddoid
 do d oid

Still looking quite poetic, if you ask me.

De-obfuscated

main = interact f
f s = do
 l <- lines s
 w <- words l
 id w

Explanation

The do-notation is only syntactic sugar, so f can equivalently be written as

f s = lines s >>= words >>= id

For lists the >>=-operator is defined as concatMap, so f becomes

f = concat . map id . concat . map words . lines

So given an input "a b\nc", lines splits the input at newlines ["a b","c"], words splits each line at white space yielding [["a","b"],["c"]] (as I realised only now this includes newlines, so lines actually isn't needed). Concatenating once gives ["a","b","c"], id is the identity function and as such has no effect and the final concatenation yields the string "abc".

Laikoni

Posted 2016-12-14T19:30:15.213

Reputation: 23 676

3Do I need to say that I like dadaistic poems? – Dada – 2016-12-14T21:54:21.790

1my guess – nimi – 2016-12-14T22:57:31.897

@nimi yes, well done. – Laikoni – 2016-12-14T23:01:22.103

12

C, 475 bytes, cracked by Riley

Certain parts of C make it really really easy to see where whitespace should go. The c pre-processor, however, does not. So this code is sort of in two halves: up to line 17 (236 characters with whitespace) the code is virtually unobfuscated, and after that (239 characters with whitespace), good luck!

Not gonna win this competition by a long shot, but I wanted to see what could be done with the c pre-processor.

#include<unistd.h>#defineachar#defineb*#definecwrite#definedstdin#defineestdout#definefread#defineg(#defineh)#defineiwhile#definejif#definek0#definel&#definem,#definen=#defineo;#definep1#definegpmlmlh#defineabo#definemldmp#definejgdoabo#definelbabod#definegfhaboc#definejgmben#definepmlfg#definegpmlbintmain(){ajgajgmljgigpmlkmlgpmlhjgd!=''&&gpm!='\n'gfgpmlgpmlo}

Compiles (with warnings, if you enable them) with gcc -std=c89 -ansi and works like cat file | ./a.out


This was cracked much faster than I thought, congrats! My strategy was to use #defines to remove obvious token boundaries (like ';') and then use more #defines to make it REALLY unintuitive how they were shuffled around.

This, by the way, is what the code looks like after only the obvious whitespace has been added:

#include <unistd.h>
#define a char
#define b *
#define c write
#define d stdin
#define e stdout
#define f read
#define g (
#define h )
#define i while
#define j if
#define k 0
#define l &
#define m ,
#define n =
#define o ;
#define p 1
// thus begins the obfuscation
#define gpmlmlh
#define abo
#define mldmp
#define jgdoabo
#define lbabod
#define gfhaboc
#define jgmben
#define pmlfg
#define gpmlb
int main(){
    ajgajgmljgigpmlkmlgpmlhjgd!=''&&gpm!='\n'gfgpmlgpmlo
}

rexroni

Posted 2016-12-14T19:30:15.213

Reputation: 386

5Welcome to PPCG! :) – Martin Ender – 2016-12-15T13:49:06.050

1Cracked This one way really fun. – Riley – 2016-12-15T15:54:47.740

9

Octave, 69 bytes, SAFE!

@(U)eval([85329685312682956148388531268295156241''])

Input format: Newlines can't be inputted directly in the command prompt. Create the string by concatenation like this:

str = ['This is ',10,'a',10,'string']
str = This is
a
string

Call the function like this (add whitespace):

f=@(U)eval([85329685312682956148388531268295156241''])  
f(['This is ',10,'a',10,'string'])

Original code:

You only needed 66 bytes for this to work, but I wrote 69 in the header in order to not give away too much information.

The original code looks like this:

@(U)eval([853 296 853 126 829 561 48 38 853 126 829 51 562 41 ''])

Explanation:

@(U)eval(.....)    % Anonymous function taking U as the input variable

U is code point 85 in the ASCII table, so it would appear like the first space should be after 85. Wrong!

If we insert the space after 853 instead, we should get character number 853, right..? Using char to check if that's a recognizable character:

char(853)
warning: range error for conversion to character value

However, we don't use char in the code, we use the shorter version where we concatenate the numbers with an empty string [853 '']. Instead of giving an out of range error, the shorter version simply takes the numbers modulus 256.

It just so happen to be that 85+3*256 = 853. While char(853) gives a warning, [853,''] returns U.

The obvious way to do this task in Octave is:

@(U)U(U~=10&U~=32)

We know that there has to be an opening parentheses (code point 40) after the first U. 29 obviously doesn't fit so we shift the space one further right and get 296. mod(296,256) = 40. Bingo!

Continue like this and end up with the sequence:

[853 296 853 126 829 561 48 38 853 126 829 51 562 41 '']
ans = U(U~=10&U~=32)

Finally, we use eval to turn the string into code.

Stewie Griffin

Posted 2016-12-14T19:30:15.213

Reputation: 43 471

3+1 for explaining input format in 2 lines while it took me 10 :-D – Luis Mendo – 2016-12-16T00:06:11.350

1Well, still no idea, except that now I recognize letter U among that bunch of numbers :-) – Luis Mendo – 2016-12-17T16:33:05.867

2

Very good trick! It's crazy that Octave does that with character codes. I had no idea about it. But then, what can you expect when the official doc says that Octave supports Unicode by accident... :-P

– Luis Mendo – 2016-12-23T00:45:33.177

7

JavaScript ES6, 199 bytes, cracked by SLuck49

A rather bulky entry with 33 bytes of whitespace to add.

s=>eval(atob`ISYgJiAtOkI8Qk97BRBeaxZFShoUZSsiOGkMenNy`.replace(/./g,(c,i)=>String.fromCharCode(c.charCodeAt()^(k+="SecretCode".split(/\w/)[i%11].length)),k=0)).join``

Arnauld

Posted 2016-12-14T19:30:15.213

Reputation: 111 334

Nice one.. I guess we need to add the proper amount of whitespace to "SecretCode" in order to xor the encrypted string and get the proper source~ – Patrick Roberts – 2016-12-16T18:53:30.333

@PatrickRoberts Yes, exactly. – Arnauld – 2016-12-16T20:32:49.597

I've already got an automated script testing all possible combinations, it's just a matter of time... wrings hands together, knowing his evil plan is working – Patrick Roberts – 2016-12-16T20:33:48.487

Phew... this is taking longer than I thought. I'm thinking of writing a code golf challenge to calculate the number of permutations possible, given an array of length N and a sum S that the elements must sum to. Right now I'm at [ 10, 0, 0, 0, 0, 9, 8, 1, 5, 0, 0 ] for the gap sequence and my iteration function for the array is (a)=>{for(var x=0;!a[x];x++);if(a.length-x>1){a[0]=a[x]-1;a[x]=(x==0?a[x]:0);a[x+1]++;}else{a[0]=a[x]+1;a[x]=0;i=0}}. I started at [ 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]. – Patrick Roberts – 2016-12-16T22:04:30.677

I just reached [ 32, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ]... I might spawn another program that iterates backwards. – Patrick Roberts – 2016-12-16T22:10:43.220

3Obligatory movie reference – Arnauld – 2016-12-16T22:30:36.540

I'm gonna be so mad if it turns out there's supposed to be spaces in the regexp... – Patrick Roberts – 2016-12-16T23:30:09.297

@PatrickRoberts I did the math, there's 1,917,334,783 combinations assuming all 33 spaces are part of the key – SLuck49 – 2016-12-16T23:32:36.257

@SLuck49 thanks! That's not too bad when you think about it. My very rough estimate was magnitudes larger than that. You've given me hope! – Patrick Roberts – 2016-12-16T23:33:35.013

Just reached [ 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ] on my forward iteration. My backward iteration is around... [ 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 28 ], but its iteration is overlapping some with the forward iteration, so only Arnauld knows which one will get there first! – Patrick Roberts – 2016-12-16T23:54:21.807

Cracked. Sorry @PatrickRoberts I beat you to it, I've been running mine all day and exhausted like 95% of the search space... that was nuts. – SLuck49 – 2016-12-17T00:39:04.970

@SLuck49 darn.. I was probably only about another hour behind. – Patrick Roberts – 2016-12-17T00:43:50.850

@SLuck49 okay I was wrong... my program finished probably about 20 minutes ago. Nice job. – Patrick Roberts – 2016-12-17T04:00:04.130

6

Befunge-93, 58 bytes, Safe!

_vv$v<~:!`:<#^0*@-:0*5|845\+`-v0,<#-^<

Try it online!

Original Program

_vv
 $ v<
 ~:!`
 :<#^0
*  @
-:0
*5 |
8
45
\+`
-
v0,<
#-
^<

Try it online!

The trick to this was that the path of execution was more vertical than horizontal, then various spaces were inserted at random in the code to further shuffle the vertical paths. Once the line breaks and whitespace were finally removed, there was hopefully then very little to indicate how the operations related to each other.

In case that wasn't difficult enough, I also threw in a bit of interleaving, so a number of operations ended up being executed by different code paths flowing perpendicular to each other. The idea being that if you thought you'd found the correct position for a particular command, you wouldn't realise you might need to use it again later in the code.

Not sure if it was worth all that effort trying to make things complicated, or people didn't even bother trying to solve it. :)

Code Explanation

_      Since an empty stack is treated as zero, this initially just branches right.
v      The program flow is then directed downwards.
$      And this drop command initially does nothing because the stack is still empty.
~      A character is read from stdin.
::     Two duplicates are created.
55+-   We subtract 10 from the first copy (the 0- is just a nop to confuse things).
\48*-  And subtract 32 from the second copy.
*      The product of those two will be zero if the character is a newline or space.
_      So if we got whitespace, our branch goes right again repeating the loop.

v      If not, we go left, wrapping around till we hit the down arrow in column 3.
:<:    Again we make two duplicates of the character.
0`!|   One copy is used to compare if it's not greater than zero.
@      If it's not (i.e. it's the EOF), the branch goes up and we terminate.
<      Otherwise we go down and to the left.
,      Output the second copy of the character, leaving one remaining on the stack.
0      Push a zero to force the next branch right.
v      Redirect the flow down, wrapping to the top again.
_      Back at our initial branch, the zero we pushed forces us right.
v      Again the program flow is directed downwards.
$      And the drop command gets rid of the last duplicate character.
~      So now we're back reading the next character and the loop repeats.

James Holderness

Posted 2016-12-14T19:30:15.213

Reputation: 8 298

6

><>, 40 bytes, Cracked by Teal pelican

v<<i/\:=::a?0/>/1?o-=="?;">^

I used fishlanguage.com by the way, just in case there are differences between interpreters.

DanTheMan

Posted 2016-12-14T19:30:15.213

Reputation: 3 140

3Cracked – Teal pelican – 2016-12-15T11:45:40.003

5

C#6, 201 bytes, Cracked by Link Ng

usingSystem.Linq;_=>string./**/#iftrueJoin(/*"*//*/""/**//*/"*/",#elseConcat(//*/,#endiffrommin""letp=$@"{@""[1]}"fromiin(_.Replace(p,@""))where!new[]{p[0]^32^10}.Contains(i)select@i);

184 bytes collapsed, leaving you 17 bytes of whitespace.

Cracked solution using the Concat whereas my intended solution used the Join, here's the intended solution:

_=>string./**/
#if true
Join(/*"* //*/""/**//*/"* /",#elseConcat(//*/,
#endif
from m in" "let p=$@"{@"  "[1]}"from i in(_.Replace(p,@"
"))where!new[]{p[0]^32^10}.Contains(i)select@i);

milk

Posted 2016-12-14T19:30:15.213

Reputation: 3 043

This needs c# 6+ to work, can you add that in? – TheLethalCoder – 2016-12-15T15:33:49.997

This has been cracked by @Link Ng: http://codegolf.stackexchange.com/a/103233/38550

– TheLethalCoder – 2016-12-15T16:08:53.357

5

MATL, 22 bytes. Cracked and cracked.

This is a program that takes input through STDIN and produces the output through STDOUT.

Code without spaces or newlines:

t'@*'dm1e5%Mdw%Y(

The input format is a little awkward because of how MATL takes string input. Strings with newlines cannot be entered directly through STDIN, because each input has to be a single line (newline marks the end of input). So the format is as follows:

  1. A string is enclosed with single quotes. If the string content includes single quotes, they are escaped by duplicating. Example: 'I''m a string'

  2. To enter a string with newlines one needs to split the string at newlines and concatenate everything (by means of square brackets), including numbers as ASCII codes. For example, consider the string formed by my first and last names with a newline in between. It would be entered as ['Luis' 10 'Mendo'].

    This allows entering any other (possibly non-printable) ASCII codes. So the string in item 1 above could be alternatively entered as ['I' 39 'm ' 97 32 'string']. Check it here.

    The only condition is that at least one of the parts within the brackets is a string. That forces any numbers to be interpreted as ASCII codes when concatenating.

Sorry about the awkward Good luck using this format!

Original solution

t' @ *'dm1e 5%
Mdw%Y
(

Each % is a comment symbol, and so the rest of the line is ignored.

Spaces do nothing, but serve as separators. For example, 1e5, without the space, would be interpreted as the number 100000.

t takes the input and duplicates it.

' @ *' pushes that string, and d computes its consecutive differences, which gives [32 -32 10] (the -32 is useless).

m gives a logical row array indicating which characters are 32 or 10 (or -32).

1 followed by e reshapes as a row. This is no-op here.

5 followed by M pushes 1 again (last input to the most recent multiple-input function, which is e).

d computes consecutive differentes of 1, and so gives [] (empty array).

w swaps, and finally ( assigns [] to whitespace characters, i.e. removes them.

Luis Mendo

Posted 2016-12-14T19:30:15.213

Reputation: 87 464

1You're lying! No way this works! (+1)... – Stewie Griffin – 2016-12-16T08:14:01.597

2cracked? – MickyT – 2016-12-16T19:09:14.027

2

Crap... I didn't notice it was already cracked... Well, double cracked.

– Stewie Griffin – 2016-12-16T19:26:57.887

Nice work both of you! :-) Not exactly my intented solution but it works perfectly – Luis Mendo – 2016-12-16T19:29:38.453

4

Ruby, 86 bytes + 1 flag = 87 (cracked by Dom Hastings)

Requires command-line flag -p.

eval"(T$}{(!//;:678?32.&&)".gsub(/|(.)/){$1&&$&.ord.^($'.count('')).chr}

The code is actually valid in this form, it's just a no-op.

histocrat

Posted 2016-12-14T19:30:15.213

Reputation: 20 600

This is awesome, I love it! So mean... – Dom Hastings – 2016-12-15T08:54:45.287

Cracked! – Dom Hastings – 2016-12-15T10:38:56.467

4

RProgN, 15 Bytes Cracked!

''`R""`R

You can toy with the code here. A relatively simple solution, hopefully the annoying nature of how RProgN handles strings will leave this uncracked.

Original Program

' ' ` R
"
" ` R

Explination

Firstly, the input is implicitly pushed to the stack. Stack: <INPUT>

Then, we use ' ' to push a space to the stack. Stack: <INPUT> " "

the ` actually tries to push a string represented by `(WORD) but because there's whitespace after it, it just pushes an empty string. Stack: <INPUT> " " ""

The R here is sugar for the Replace command. Stack: <INPUTWITHOUTSPACES>

Next, the "NEWLINE" pushes a string containing a newline, which is nice because RProgN doesn't use escapes, it just straight up lets you push a string like that. Stack <INPUTWOSPACES> "\n"

Then, we use the ` trick again, and Replace, which gives our output.

ATaco

Posted 2016-12-14T19:30:15.213

Reputation: 7 898

Is this supposed to work in firefox? – Conor O'Brien – 2016-12-14T22:20:04.613

I'm running it in firefox, is there an issue? Can you get a screenshot? – ATaco – 2016-12-14T22:21:49.180

cracked? – MickyT – 2016-12-14T22:31:12.320

Well that was fast. I nearly lasted half an hour! – ATaco – 2016-12-14T22:34:08.740

4

Beam, 72 bytes, Safe!

Now for a 2d language. Can be played with on TIO Nexus.

s'''>`+++)+Ss`n\
 n`sS+(+++`<``/
 >rgn\
 ^ @<(\  
     H         <
 ^    /

A fairly straight forward program without a lot in there to try and fool people.

s'''>`+++)+Ss`n\ # Sets the memory slot 0 to 0, 10 to 10 and 32 to 32. n will redirect down
 n`sS+(+++`<``/  # since memory != store. \ is a red herring and not hit.
 >rgn\           # read in from input and set store to memory value. For all characters
 ^ @<(\          # other than space, LF and end of input this will be different and n will 
     H         < # redirect down then through to the print and back to read. Space, LF and  
 ^    /          # end of input get directed to the ( which tests for 0. This will redirect 
                 # space and LF to path back to read, otherwise it will skip over and halt

MickyT

Posted 2016-12-14T19:30:15.213

Reputation: 11 735

1I think I'll move the interpreter to Node when I have time so Dennis can add it to TIO... – ETHproductions – 2016-12-14T23:44:29.257

1

I've created a Node clone of the interpreter, and Dennis has now added it to TIO!

– ETHproductions – 2016-12-15T04:06:36.423

4

Labyrinth, 127 bytes

);""{"".@"-;,""""":"##"*"(:"+":}-;{";;"*#{:;"#""+("-;"";;"})"";""""""""

Hopefully I did this right :) this is my first cops and robbers entry.

Original Code

 ) ;""{"".@
"-;, "" ""
"  :
" ##
" *
" (:
"  +
"  :}-;{
"    ; ;
" *#{: ;
" #    "
" +("-;"
"    ; ;
"    })"
"      ;
""""""""

Robert Hickman

Posted 2016-12-14T19:30:15.213

Reputation: 661

Your answer is now safe, you can add your original code and an explanation. – Laikoni – 2017-02-17T07:27:34.923

4

Java, 3241 + 28 Bytes for a big Integer import

This entry is solely to prove the possibility of a purely cryptographically secure entry. I believe this is within the rules, but if it is against the spirit, please let me know and I will delete out of fairness. I will leave this "unsafe" indefinitely until such a time when (and if) a crack gets found. This is a monstrosity and could surely be further optimized, but here it is.

interfacer{staticvoidmain(String[]A){Strings=",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,",q=",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,",a="",b="";for(Stringt:s.split(",")){a+=t.length();}for(Stringt:q.split(",")){b+=t.length();}if((newBigInteger(a).multiply(newBigInteger(b)).toString()).equals("3649760552772806991406184564114682549877113954361462782925976763675666255653486225665808494957477900238166874367635068317805381406282572366371821972593595701388544127398102379288357379612333197280663769935384647844344358594407966485992727383589962048236726744715096711312156760311643104858212670342667229690568585229658813910569607411855770280546861422837629553847973043531578541545436967345783407835402474562087790816775240815912495599135241317")){System.out.println(A[0].replaceAll("","").replaceAll("\n",""));}}}

Out of fairness to robbers, here is it with all the "obvious" whitespace added.

interface r {

    static void main(String[] A) {
        String s = ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", q = ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", a = "", b = "";
        for (String t : s.split(",")) {
            a += t.length();
        }
        for (String t : q.split(",")) {
            b += t.length();
        }
        if ((new BigInteger(a).multiply(new BigInteger(b)).toString()).equals("3649760552772806991406184564114682549877113954361462782925976763675666255653486225665808494957477900238166874367635068317805381406282572366371821972593595701388544127398102379288357379612333197280663769935384647844344358594407966485992727383589962048236726744715096711312156760311643104858212670342667229690568585229658813910569607411855770280546861422837629553847973043531578541545436967345783407835402474562087790816775240815912495599135241317")) {
            System.out.println(A[0].replaceAll("", "").replaceAll("\n", ""));
        }
    }
}

Good luck, I would love to see this cracked. In fact I will even institute an unlimited bounty on this. If at any point you do crack this, you will be awarded 500 rep infinite accolade on stack exchange (as well as likely a wonderful mathetatical paper).


Rohan Jhunjhunwala

Posted 2016-12-14T19:30:15.213

Reputation: 2 569

There are more }s than {s. Are you sure that was intended? – user41805 – 2016-12-17T17:51:07.750

@KritixiLithos sorry, while I was developing this, I had it inside of another nested class – Rohan Jhunjhunwala – 2016-12-17T17:52:26.193

2Your solution and mine will likely walk down the ages uncracked. – Joshua – 2016-12-22T23:33:42.200

1To the downvoter, is there something illegitimate about this submision? – Rohan Jhunjhunwala – 2016-12-24T13:53:34.523

1There is actually a trivial solution for this (that does not involve factoring an RSA-440 number equivalent), unfortunately it requires an extra ~10,000 bytes... – SLuck49 – 2017-01-03T13:54:01.190

1@SLuck49 can you comment it to me? – Rohan Jhunjhunwala – 2017-01-03T15:26:00.203

1@SLuck49 wow! I just realized what you were looking at! I almost lost 500 reputation. – Rohan Jhunjhunwala – 2017-01-03T15:28:10.537

1Yeah, for anyone curious basically you use one space to make b=1, and you make a=364976... by using 36 spaces, 49 spaces, 76 spaces, etc... unfortunately I couldn't find a way to shorten that. Just goes to show it's usually far easier to attack a crypto-implementation than a crypto-algorithm. – SLuck49 – 2017-01-03T15:35:19.410

When I just try to compile the code with the 'obvious whitespace', javac is complaining about the "static" at the interface. What am I doing wrong there? (Without the 'static', it compiles.) – ProgramFOX – 2017-06-30T13:46:16.533

@ProgramFOX I'm not sure why I had added that "static" in. I have now removed it. – Rohan Jhunjhunwala – 2017-06-30T14:22:29.257

3

C, 140 bytes, cracked by Riley

Let's start with an easy one.

#include<stdio.h>intmain(){inta=getchar();while(a!=EOF){//\a=getchar();if(a!=10&&a!=32)//\\putchar(a^10^32);putchar(a);a=getchar();}}

(I hope I'm doing this right.)

betseg

Posted 2016-12-14T19:30:15.213

Reputation: 8 493

1Cracked. Not the indended solution as I have 1 less byte. – Riley – 2016-12-14T20:16:35.153

@Riley add an extra newline on the end and you'll be fine ;) – Alfie Goodacre – 2016-12-14T22:03:19.067

3

Befunge 98, 65 bytes, cracked by Pietu1998

~v>#@>::':'0--\'[';--!8v1+!*1+j!j,v>#@

Original program

~v           >#@
 >::':'0--\'[';--!8v1+!
*1+j !j,     v     >
#@

ninjalj

Posted 2016-12-14T19:30:15.213

Reputation: 3 018

1I think I got it. – PurkkaKoodari – 2016-12-15T13:19:13.433

2

V, 37 bytes Cracked by nmjcman101

OVrS200@"kIi|D@"Aüî|D@"

Since this has unprintables, here is the readable version:

O<esc>Vr<C-a>S200<esc>@"kIi<C-v><C-v><esc>|D@"<esc>Aüî<esc>|D@"

Or if you prefer, a hexdump:

00000000: 4f1b 5672 0153 3230 301b 4022 6b49 6916  O.Vr.S200.@"kIi.
00000010: 161b 7c44 4022 1b41 fcee 1b7c 4440 22    ..|D@".A...|D@"

James

Posted 2016-12-14T19:30:15.213

Reputation: 54 537

Cracked That was a really cool puzzle – nmjcman101 – 2016-12-15T14:45:36.393

2

Vitsy, 73 bytes, safe

This is downright evil.

5mW3m7m7m2mD&EPamX}<m15mEnl9mZD\[4m]^P-cm(D_2-3*bmD1-dmrnu-'

Good luck! 13 items of whitespace to add.

Original code:

5m
W3m7m
7m
2m
D&EPamX}
<m1
5mEn
l9mZ
D
\[4m]
^P-cm(D
_2-3*
bmD1-dmrnu-
'

Try it online!

This roughly simplifies down to:

<m1
W2\[2m]Z
l\[D&EP^P-_2-3*D1-rnu-(DX}]

Addison Crump

Posted 2016-12-14T19:30:15.213

Reputation: 10 763

Please do not look at the edit history, as I had a bug in my code remaining. – Addison Crump – 2016-12-15T16:37:37.647

You do not know evil. I know evil. – Joshua – 2016-12-17T03:11:36.473

It is just past 0300 for me, so I'll add an explanation in the morning. – Addison Crump – 2017-01-01T03:09:07.833

2

Minkolang v0.15, 88 bytes, Cracked!

$oI[dd""=$r'10'=1J,?1R]r$O3.14$$$Cdollars>$$$Ceverywhere>x

Try it online!

user41805

Posted 2016-12-14T19:30:15.213

Reputation: 16 320

cracked? – MickyT – 2016-12-18T21:48:52.413

2

JavaScript ES6, 380 bytes, safe

This is the kind of entry that I was initially planning to release. It's huge and has nearly no chance to win, but I think it should be cryptographically strong enough to withstand 7 days. Now, I may be proven wrong!

67 bytes of whitespace to add.

s=>{for(k=`|||`.split`|`.map(s=>s.replace(/\s/g,c=>(k-=(c<'')+1,n=n<<2|k&3),k=n=0)&&n),x=10106050295,y=-4955405499,i=32,d=2654435769,t=d*i;i--;y-=(x<<4^x>>>5)+x^t+k[t>>>11&3],t-=d,x-=(y<<4^y>>>5)+y^t+k[t&3]);returns[atob(([x,y].map(n=>String.fromCharCode(n&255,n>>8&255,n>>16&255,n>>24)).join``))](/[\n]/).join``}

Solution

This is an implementation of the Extended Tiny Encryption Algorithm. The 64-bit whitespace-encoded key expands to the following 128-bit key:

K = [0xd224de37, 0x89e34e79, 0xe34e7748, 0x939e2789]

enter image description here

Source: Wikipedia

Once decrypted and converted to ASCII, the 64-bit block [x, y] reads as c3BsaXQ=, which is the Base64 encoded representation of split.

let f =

s=>{for(k=` 
 


   

 
 

|


 
 
 
    
  |  
 
    



 

|
     
 

 
 

 `.split`|`.map(s=>s.replace(/\s/g,c=>(k-=(c<' ')+1,n=n<<2|k&3),k=n=0)&&n),x=10106050295,y=-4955405499,i=32,d=2654435769,t=d*i;i--;y-=(x<<4^x>>>5)+x^t+k[t>>>11&3],t-=d,x-=(y<<4^y>>>5)+y^t+k[t&3]);return s[atob(([x,y].map(n=>String.fromCharCode(n&255,n>>8&255,n>>16&255,n>>24)).join``))](/[ \n]/).join``}

console.log(f(`H e l l o
W o r l d`))

Arnauld

Posted 2016-12-14T19:30:15.213

Reputation: 111 334

1I started brute forcing this thinking maybe I'll get lucky and you made each of the 4 key values have the same length (8 bits). Except it would be 16 bits each... woops. Brute force isn't going to happen, time for another approach. – SLuck49 – 2016-12-20T13:55:05.397

1

reticular, 43 bytes, cracked

ISBqv<>>$$4jE:d/v$v?c+91d/v?E;!?l$/o$

The version on TIO is outdated, but you can get yourself a copy from the github.

Conor O'Brien

Posted 2016-12-14T19:30:15.213

Reputation: 36 228

The version on Nexus was already up-to-date. I pulled on v1 as well. – Dennis – 2016-12-15T04:29:05.573

Just checking, does this work if the input contains two consecutive linefeeds? – Martin Ender – 2016-12-15T10:22:20.023

@MartinEnder it should. It depends on whether or not the input is piped or not. When piped it should read all of stdin. – Conor O'Brien – 2016-12-15T12:01:27.707

@Dennis thanks! I meant to ask you in chat. – Conor O'Brien – 2016-12-15T12:01:54.423

Cracked – James Holderness – 2016-12-18T04:13:59.650

1

C#, 159 bytes, Cracked by milk

usingSystem.Linq;s=>string.Join("",string.Join("",s.Split(@"".Replace(newstring((char)0x0D,1),"").ToCharArray())).Select(c=>c+""!=""?c+"":"").ToArray());

153 collapsed so only 6 bytes of whitespace to find, shouldn't be too hard...

TheLethalCoder

Posted 2016-12-14T19:30:15.213

Reputation: 6 930

1Cracked – milk – 2016-12-15T19:05:58.633

1

Wolfram, 132

Probably has more that one solution (hint: Mersenne)

StringReplace[#,""->"",Limit[x/(x-1),x->Boole[PrimeQ[
212821282128228281282128228821282128212821282-1]]]]&

Solution

StringReplace[#," "->"",Limit[x/(x-1),x->Boole[PrimeQ[
2 128 2 128 2 128 2 2 8 2 8 128 2 128 2 2 8 8 2 128 2 128 2 128 2 128 2-1]]]]&

swish

Posted 2016-12-14T19:30:15.213

Reputation: 7 484

ockquote>

Your submission will then be your source code with all whitespace removed

– user41805 – 2016-12-17T15:26:35.290

@KritixiLithos It is removed – swish – 2016-12-17T15:27:06.307

What about the spaces before the second line and the newline between the first and second line? – user41805 – 2016-12-17T15:28:21.990

Well, you're right, it is just for readability... – swish – 2016-12-17T15:29:15.793

I think you can post the solution now. – CalculatorFeline – 2017-05-06T21:51:13.170

@CalculatorFeline Forgot about this one completely, thx! – swish – 2017-05-06T23:32:49.040

1

Whitespace, 81 74 bytes

																					

Human readable version:

ttttttttttttttttttttt (21 tab characters)

I know this is an old challenge but hopefully someone is willing to have a go at cracking this. I attempted to optimise for bytecount but it may be possible to make something shorter with the same number of tab characters.

Ephphatha

Posted 2016-12-14T19:30:15.213

Reputation: 581

0

S.I.L.O.S, 159 bytes Safe!

loadLinedef:lblgetagetzzzz/za=256:aX=getax=Xy=Xz=xx-10x|ifxbGOTOx:by-32y|ifycGOTOx:cprintCharX:xa+1z+1x=getaifxa:b

Should be fairly trivial. It is my first cops and robbers entry.

No one attacked it, probably due to the esoteric nature of my own language. Seems like a sleazy way to slide by, but it doesn't really matter as shorter ones are safe.

loadLine
def : lbl geta get z zz
z/z
a=256
:a
X=get a
x=X
y=X
z=x
x-10
x |
if x b
GOTO x
:b
y-32
y|
if y c
GOTO x
:c
printChar X
:x
a+1
z+ 1
x=get  a
if x a
:b

Feel free to try it online

Rohan Jhunjhunwala

Posted 2016-12-14T19:30:15.213

Reputation: 2 569

0

tcc, 850 bytes

To avoid pasting a very long line I passed this through tr -d '\n ' | fold -b -w 60.

#!/usr/bin/tcc-run#include<stdio.h>typedefunsignedcharu;um[]
={104,105,16,152,94,131,43,42,112,214,53,207,116,170,185,210
};intmain(){uS[256];uk[256];ui,j,t;intc,n=0;FILE*f;f=fopen(_
_FILE__,"r");/*cannotfail*/while(-1!=(c=fgetc(f)))if(c==''||
c==10)k[++n]=c;fclose(f);i=0;do{S[i]=i;}while(++i!=0);j=0;i=
0;do{j=j+S[i]+k[i%n];t=S[i];S[i]=S[j];S[j]=t;}while(++i!=0);
i=0;do{if(S[i]!=m[i])j=1;}while(++i<sizeof(m));if(j==1){i=0;
do{printf("%d,",(int)S[i]);}while(++i<sizeof(m));printf("\n"
);}else{while(-1!=(c=fgetc(stdin)))if(c!=''&&c!=10)fputc(c,s
tdout);}returnj;}

Joshua

Posted 2016-12-14T19:30:15.213

Reputation: 3 043

Link to interpreter? – Addison Crump – 2016-12-18T21:50:55.860

@VoteToClose: apt-get install tcc did it for me. – Joshua – 2016-12-18T21:52:23.710