16
\$\begingroup\$

This is the cops' thread. The robbers' thread is here.

Your challenge is to write a program or function that, with a certain input, prints the exact string Hello, World! and a newline. Capitalization, spacing and punctuation must be exact.

Input may be taken via standard input, a file, or command-line/function arguments. Output may be given via return value, writing to a file, or standard output.

Your program must print Hello, World! for at least one input. When your program is given the wrong input (i.e. the input that does not make it print Hello, World!), it can do whatever you like - crash, print random nonsense, call Chuck Norris, etc.

You may not use a hashing algorithm or any similar methods of obscuring the required input.

Submissions are preferred to be runnable & crackable on TIO. Submissions not runnable or crackable on TIO are allowed, but please include instructions to download / run them.

After one week, this challenge will be closed to future cop submissions. The winner is the shortest code that is uncracked after a week of posting it ("it" being the code, not this challenge). The winner will be accepted after two weeks.

After a week has passed since posting, please mark your answer as safe and show the input (in a > ! spoiler quote). If a robber cracks your submission (before the week ends), please mark it as cracked and show the halting input (in a > ! spoiler quote).

Looking for uncracked submissions?

fetch("https://api.stackexchange.com/2.2/questions/137742/answers?order=desc&sort=activity&site=codegolf&filter=!.Fjs-H6J36vlFcdkRGfButLhYEngU&key=kAc8QIHB*IqJDUFcjEF1KA((&pagesize=100").then(x=>x.json()).then(data=>{var res = data.items.filter(i=>!i.body_markdown.toLowerCase().includes("cracked")).map(x=>{const matched = /^ ?##? ?(?:(?:(?:\[|<a href ?= ?".*?">)([^\]]+)(?:\]|<\/a>)(?:[\(\[][a-z0-9/:\.]+[\]\)])?)|([^, ]+)).*[^\d](\d+) ?\[?(?:(?:byte|block|codel)s?)(?:\](?:\(.+\))?)? ?(?:\(?(?!no[nt][ -]competing)\)?)?/gim.exec(x.body_markdown);if(!matched){return;}return {link: x.link, lang: matched[1] || matched[2], owner: x.owner}}).filter(Boolean).forEach(ans=>{var tr = document.createElement("tr");var add = (lang, link)=>{var td = document.createElement("td");var a = document.createElement("a");a.innerHTML = lang;a.href = link;td.appendChild(a);tr.appendChild(td);};add(ans.lang, ans.link);add(ans.owner.display_name, ans.owner.link);document.querySelector("tbody").appendChild(tr);});});
<html><body><h1>Uncracked Submissions</h1><table><thead><tr><th>Language</th><th>Author</th></tr></thead><tbody></tbody></table></body></html>

\$\endgroup\$
  • \$\begingroup\$ Very similar not a dupe though. \$\endgroup\$ – Sriotchilism O'Zaic Aug 5 '17 at 17:22
  • 13
    \$\begingroup\$ As I said in the sandbox, I feel that this is a duplicate of the halting question since any answer there could be posted here instead but with code for and infinite loop replaced with code to print hello world. I won't vote yet because I'd hammer, but I'm pretty convinced this is a dupe. \$\endgroup\$ – FryAmTheEggman Aug 5 '17 at 18:07
  • 5
    \$\begingroup\$ Obviously sha3 falls into that category, but otherwise where do you draw the line? I mean the mod 1e3 is also a hash function, and I'd even go so far and argue that many of the submissions are going to be hash functions, as this challenge is basically asking for such. \$\endgroup\$ – flawr Aug 5 '17 at 21:52
  • 1
    \$\begingroup\$ Based on the answers I've seen in the past day, nothing has appeared that convinces me this isn't a duplicate. I'm going to close the cop challenge for now, and if the community disagrees it can be reopened, and if the community agrees they can close the robber thread too. \$\endgroup\$ – FryAmTheEggman Aug 6 '17 at 13:30
  • 1
    \$\begingroup\$ @Dopapp this has already been discussed, here (some comments deleted) and in chat. Answers cannot be copy-pasted, nor very easily ported, from that challenge to this one, so they are not duplicates. \$\endgroup\$ – MD XF Aug 6 '17 at 17:49

35 Answers 35

3
\$\begingroup\$

Python 3, 191 186 bytes (SAFE!)

Same as my previous answer, but without the noob eval statement, so that somebody actually has to solve the problem I created.

import sys
from numpy import *
e=enumerate
c='Hello, World!'
print(''.join([c[int(sum([c*cos(n*i)for i,c in e(fromiter(sys.argv[1:],float))])+.01)]for n in[2*i+ord(n)for i,n in e(c)]]))

now execute it with the correct parameters, such as python3 hw.py 1 2 3


Edit: previous version was missing a comma in "Hello, World!", and also I realized that it had an unnecesary ennumerate, which is now gone.


Edit 2: Just for fun, here is an almost identical Pyth version (47 bytes) of the same code:

KEJ"Hello, World!"jkm@J.Rs.e*b.t*dk1K0.e+*2kCbJ

Input is taken from stdin and is in the form of a list of arguments, such as [1,2,3]

I see no point in posting a separate answer because if you crack the Pthyon3 version, then you also crack the Pyth version, even without knowing Pyth.


Answer:

python3 hw.py 10.72800138 13.23008796 19.30176276 16.13233012 18.10716041 0.98306644 8.18257475 19.20292132 10.99316856 -2.15745591 6.01351144 5.45443094 10.41260889

Explanation of code:

''.join() creates the hello world string out of an array of characters from the string "Hello, World!". The puzzle is solved when those indicies are [0,1,2,3,4,5,6,7,8,9,10,11,12]. Each index is calculated from an input and the constants given on the command line. The inputs are a hard coded series: [2*i+ord(c) for i,c in enumerate('Hello, World!')]. The funtion that relates the input, the constants, and the output (indicies) is this: sum([c*cos(x*i) for i,c in enumerate(CONSTANTS)]). This is a classic modelling problem, where you are trying to fit data to your model.

Arriving at the solution, in python:

from scipy import optimize
x = [2*i+ord(c) for i,c in eumerate('Hello, World!')]
y = [0,1,2,3,4,5,6,7,8,9,10,11,12].
# make your function: 13 terms means we can achieve 13 exact outputs
def f(x,a,b,c,d,e,f,g,h,i,j,k,l,m):
    return sum([c*cos(x*i) for i,c in enumerate([a,b,c,d,e,f,g,h,i,j,k,l,m])])
# curve fit
ans,_ = optimize.curve_fit(f,x,y)
# check answer
[round(f(a,*ans),0) for a in x] # should be 0-12

\$\endgroup\$
  • 2
    \$\begingroup\$ Just in case you didn't know, literal_eval() in the ast module can be used to safely evaluate expressions, so that the print( code injection problem wouldn't work. It's probably not relevant here, but I just thought I'd mention it. \$\endgroup\$ – Esolanging Fruit Aug 7 '17 at 4:36
  • 2
    \$\begingroup\$ are you sure this can print Hello, World!? Haven't cracked yet, but it looks like it's missing a comma (only 12 iterations in join loop) \$\endgroup\$ – Uriel Aug 7 '17 at 13:07
  • \$\begingroup\$ Oh, you are right, it is missing a comma. I will correct it now. \$\endgroup\$ – rexroni Aug 7 '17 at 13:45
  • \$\begingroup\$ @Challenger5 thank you, I did not know that. \$\endgroup\$ – rexroni Aug 7 '17 at 13:53
12
\$\begingroup\$

TeX - 38 bytes Cracked(ish)

This is worth a shot, because I can't imagine anyone on a site about writing short pieces of code would know TeX:

\read16to\x\message{Hello, World!}\bye

To run it, you should get a hold of some form of TeX that allows interactive mode. Save this to a file, and run TeX (or pdfTeX, XeTeX, etc.) on it.

Edit: I'm currently considering this semi-cracked. The intended solution uses input from stdin, but TeXnically input from the way the program is invoked is valid. I'll be adding more devious TeX answers if someone gets the intended method.

Here's the intended solution:

^C Ia - The first key is control-c, which causes an error. Then, you press I (capital i) to input a command. Then you type a (or anything else to be typeset). Normally, the message that was printed to stdout would be followed by a space and then a ')'. When you typeset something, it causes the font information to be output after the message. That means that a newline is thrown in, and the ')' gets moved later.

That may be underhanded, but should still be within the rules of the game.

\$\endgroup\$
  • \$\begingroup\$ Welcome to PPCG. Good first answer \$\endgroup\$ – Евгений Новиков Aug 7 '17 at 7:21
  • \$\begingroup\$ Wouldn't it suffice to use tex \ Hello, world!\bye (23 bytes)? \$\endgroup\$ – Werner Aug 7 '17 at 10:09
  • \$\begingroup\$ @Werner that would allow user input? \$\endgroup\$ – A Gold Man Aug 7 '17 at 10:41
  • \$\begingroup\$ Is this actually meant to be cracked? :o \$\endgroup\$ – Felix Palmen Aug 7 '17 at 14:44
  • 3
    \$\begingroup\$ texnically oh, gosh. \$\endgroup\$ – MD XF Aug 8 '17 at 22:02
7
\$\begingroup\$

><>, 538 bytes, Cracked by rexroni

v
\">/v>v\v</>"
/!?lp%*2di%*2di
a
v   "        "       "
   "l"      "o"  /  "e"
v   "        "     " "
      "   /       "l"/
v    "!"           "
 //   " " "      \
v     \"d"o"   " "    "
      " " "   "o"r"  "!"
v"   "H"       " "    "
"l"   ""
""    "r" "         "
    \  " "l"       "d"  "
v   "     "      "  "  "H"
   "e"         /","     "
v " " "     "  " "
 "e" "W"  /"d""l"
v " " "     "  "      "
   "H"               "!"
v   "                 "
                        v
>>"Hello world?"       >o<
                        ^

Try it online, or you may want to use the fish playground.

The first three lines read in a string from STDIN and use its charcodes mod 26 as coordinates to put the characters ">/v>v\v</>" into the maze below. The intended solution is a 20-character string made of the letters A–Z only (although you're allowed to use anything you want, of course).

Solution:

The intended input is OCEANICWHITETIPSHARK (it's a fish!). The path through the maze looks like:

v
\">/v>v\v</>"
/!?lp%*2di%*2di
a                |  |
v   "        "   |  |"
| v"l"______"o"__/  "e"
v | "        "     " "
| |   "   /       "l"/
v |  "!"           "|
|//   " " "    v_\  |
v|    \"d"o"   " "  | "
||    " " "   "o"r" |"!"
v"   "H"       " "  | "
"l"___""_______ _/__/_____
""    "r" "    | |  "
|>__\  " "l"   | | "d"  "
v   "     "    | "  "  "H"
|  "e"v________/"," |   "
v " " "     "  " "  |
|"e"|"W"  /"d""l"|  |
v " " "     "  " |  | "
<  "H">__________ __\"!"__
v   "            |  | "
    >____________ __ ___v
>>"Hello world?" |  |  >o<
                 |  |   ^

\$\endgroup\$
  • \$\begingroup\$ Cracked! Took me forever. \$\endgroup\$ – rexroni Aug 9 '17 at 15:53
  • 3
    \$\begingroup\$ Hey, I suspected the answer might be a word, but I didn't make any attempt to unscramble it. I stand even more impressed. \$\endgroup\$ – rexroni Aug 10 '17 at 4:26
6
\$\begingroup\$

Octave, 59 bytes, Cracked

This works in Octave 4.2.0. I can't guarantee compatibility with all versions.

i=input('');printf('%c',i*~all(isequal(i,'Hello, World!')))

Note: This doesn't print any trailing spaces or newlines. This is what it looks like:

enter image description here

It basically says: "Print the input string, unless the input is 'Hello, World!', in which case it should print nothing (or the null-character).

\$\endgroup\$
  • \$\begingroup\$ I'm not sure if %c means string or char...maybe you're hiding something? Also the *~ makes me a bit suspicious... \$\endgroup\$ – Erik the Outgolfer Aug 5 '17 at 19:56
  • \$\begingroup\$ I'm not sure, but cracked? \$\endgroup\$ – ბიმო Aug 5 '17 at 20:17
  • \$\begingroup\$ @BruceForte prints a null byte at the end of output, I'm not sure that's valid... link \$\endgroup\$ – MD XF Aug 5 '17 at 20:18
  • 1
    \$\begingroup\$ I'm pretty sure the intended solution is this kind of thing. \$\endgroup\$ – Jonathan Allan Aug 6 '17 at 0:15
  • 1
    \$\begingroup\$ @BruceForte, no. there was no \n. I thought the question text said "optional trailing newline". \$\endgroup\$ – Stewie Griffin Aug 6 '17 at 6:44
5
\$\begingroup\$

CJam, 7 bytes (cracked)

q5/:i:c

Try it online!

Intended input:

65608656376564465644656476558065568656236564765650656446563665569

\$\endgroup\$
  • \$\begingroup\$ Cracked \$\endgroup\$ – Jonathan Allan Aug 5 '17 at 20:49
  • \$\begingroup\$ @JonathanAllan Darn! That wasn't the intended input though. \$\endgroup\$ – Erik the Outgolfer Aug 6 '17 at 8:37
5
\$\begingroup\$

MATL, 6 bytes. Cracked

tsZp?x

Try it online!

\$\endgroup\$
  • \$\begingroup\$ Cracked, but if this isn't the intended solution, it feels a bit like cheating. \$\endgroup\$ – Dennis Aug 6 '17 at 5:14
  • \$\begingroup\$ @Dennis The intended solution was ['Hello,' 1 'World!']. Why cheating? :-( The doc/help for D says Most input characters below 32 are replaced by space \$\endgroup\$ – Luis Mendo Aug 6 '17 at 10:01
  • \$\begingroup\$ I meant cheating on my part, turning an LF newline into a CR+LF newline. \$\endgroup\$ – Dennis Aug 6 '17 at 15:22
  • \$\begingroup\$ @Dennis Ah, I see. Well, I think it's perfectly valid too \$\endgroup\$ – Luis Mendo Aug 6 '17 at 16:23
5
\$\begingroup\$

Explode, 23 bytes, Cracked

@_?&4_-j>5&f^~c>&6\|4>7

More coming, this is just the beginning >:)

Try it online!

Explorer Explanation

There are four explorers in this program. I'm not entirely sure that wait (>) is working correctly.

@_?

Read user input (?), write and extend the tape (@) down (_).

&4_-j>5

For 4 ticks (4), modify the tape (&) downwards (_), jumping by 5 (5), by subtracting (-) 19 (j).

&f^~c>

For 16 ticks (f), modify the tape (&) upwards (^) in a wave (~), alternating no affect, +13, no affect, and -13 (c).

&6\|4>7

For 6 ticks (6), modify the tape (&) in both directions (|), decreasing (\) by 4 (4) each time, and jumping by 7 (7). Decreasing means that it subtracts 4 the first time, 8 the second time, etc.

\$\endgroup\$
  • 3
    \$\begingroup\$ Cracked but feel free to give an explanation of the goings on :) \$\endgroup\$ – Jonathan Allan Aug 6 '17 at 0:50
  • \$\begingroup\$ @JonathanAllan explanation added, sorry I took so long \$\endgroup\$ – Stephen Aug 8 '17 at 14:31
5
\$\begingroup\$

JavaScript (ES6), 173 169 163 150 151 148 143 bytes (Cracked)

Let's have something totally different... and totally evil.

const e=eval,p=''.split,c=''.slice,v=[].every,f=s=>(t=c.call(s),typeof s=='string'&&t.length<81&&v.call(p.call(t,`\n`),l=>l.length<3)&&e(t)(t))

Usage: f(something) // returns 'Hello, World!'

Try it online!

\$\endgroup\$
  • \$\begingroup\$ Let us continue this discussion in chat. \$\endgroup\$ – Евгений Новиков Aug 7 '17 at 9:06
  • \$\begingroup\$ Cracked \$\endgroup\$ – DanTheMan Aug 10 '17 at 7:15
  • \$\begingroup\$ Nice! That's a real crack. \$\endgroup\$ – Voile Aug 10 '17 at 7:23
  • \$\begingroup\$ This was really tough to crack. Good job! \$\endgroup\$ – DanTheMan Aug 10 '17 at 7:49
  • \$\begingroup\$ It's directly taken from one of the puzzles I've created on elsewhere :) (I'll let people figure out where I posted the original puzzle.) \$\endgroup\$ – Voile Aug 10 '17 at 8:31
4
\$\begingroup\$

C# (.NET Core), 130 152 bytes, CRACKED

+22 bytes, I forgot about trailing newline... Program works the same as before, the newline is added to any output.

a=>a.Distinct().Select((x,y)=>a.Reverse().Skip(y).First()*x%255).Take(a.First()-33).Concat(new int[]{10}).Select(x=>(char)x).ToArray()

Try it online!

Byte count also includes

using System.Linq;

For a start I went for something not too crazy. It can has multiple answers.

The "official" crack:

. !$0%>5&8'#?)S*TuE[MRX`+9

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

tcc, 89 bytes, cracked by Dennis

#!/usr/bin/tcc -run
#include <stdio.h>

int main()
{
    puts("\n");
}
#include "/dev/stdin"

This is particularly evil due to tcc's dynamic resolution. Lots of functions are predeclared and trying to overwrite them simply doesn't work.

\$\endgroup\$
  • \$\begingroup\$ Could you create a working TIO link for people to play with? (this is no doubt incomplete - maybe it needs compiler flags or something, I have no idea) TBH I don't even know how this is meant to take input...? \$\endgroup\$ – Jonathan Allan Aug 6 '17 at 1:57
  • \$\begingroup\$ Tio's tcc is not going to work. It doesn't get that this must be used as tcc -run rather than a separate compile and link phase. \$\endgroup\$ – Joshua Aug 6 '17 at 2:58
  • \$\begingroup\$ Maybe it's runnable via a shell through there then, bash is available (I know very little regarding either tcc or bash though). Otherwise I think you should give some detailed instructions to get people going (unless my personal lack of knowledge is the issue here - as I said I don't even know how your code gets any input, all I see is a puts and I thought that outputs.) \$\endgroup\$ – Jonathan Allan Aug 6 '17 at 3:08
  • \$\begingroup\$ Almost have a crack but I'm on mobile and mprotect is being a butt. \$\endgroup\$ – MD XF Aug 6 '17 at 3:23
  • \$\begingroup\$ cracked \$\endgroup\$ – Dennis Aug 6 '17 at 4:43
4
\$\begingroup\$

Bash, 62 bytes, (cracked by ArchDelacy)

[[ ! "${1////x}" =~ [[:alnum:]] ]]&&[[ $# = 1 ]]&&bash -c "$1"

No alphanumerics or forward slashes. You should have fun with this one.

Try it online!

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

brainfuck, 7 bytes cracked

,+[.,+]

Try it online!

Good luck. (doesn't work with every BF interpreter

\$\endgroup\$
  • \$\begingroup\$ Does your input work with any BF interpreter, including ones with different tape lengths? Does your input work locally, and not just on TIO? \$\endgroup\$ – Stephen Aug 8 '17 at 21:20
  • \$\begingroup\$ @StepHen any length of type afaik \$\endgroup\$ – Christopher Aug 8 '17 at 21:22
  • \$\begingroup\$ cracked \$\endgroup\$ – rexroni Aug 8 '17 at 22:00
  • 1
    \$\begingroup\$ Does your intended solution work on TIO? \$\endgroup\$ – totallyhuman Aug 8 '17 at 22:03
  • \$\begingroup\$ @totallyhuman thanks, edited the comment so it looks pro. I don't know how to put non-printable input on TIO. I passed input on stdin from a C program with a single printf statement. \$\endgroup\$ – rexroni Aug 8 '17 at 22:06
3
\$\begingroup\$

JavaScript (ES6), 102 bytes (Cracked)

The previous version has a massive cheese. Let's try this again...

f=s=>{let r='',i=0;while(i<13)r+=!s[i][0]||s[i]=='Hello, World!'[i]||s[i++];return r};Object.freeze(f)

Try it online!

Author solution:

new Proxy({v:Array(13).fill(0)},{get:(o,p)=>['a','','Hello, World!'[p]][o.v[p]++]})

Usage:

var p=new Proxy({v:Array(13).fill(0)},{get:(o,p)=>['a','','Hello, World!'[p]][o.v[p]++]}) console.log(f(p))

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

Cubically, 159 bytes (Cracked)

+53$!7@6:2/1+551$?7@6:5+52$!7@66:3/1+552$?7@6:5+3/1+4$!7@6:5/1+3$?7@6:5+1/1+54$!7@6:3/1+552$?7@6:5+1/1+552$?7@6:5+52$!7@6:1/1+551$?7@6:5+1/1+3$!7@6:1/1+1$(@6)7

This will be pretty easy to those who are comfortable with Cubically. Try it online!

\$\endgroup\$
  • 1
    \$\begingroup\$ Is anybody comfortable with Cubically? :P \$\endgroup\$ – totallyhuman Aug 5 '17 at 21:02
  • \$\begingroup\$ @totallyhuman The language is actually pretty simple once you get used to it, and it's fun to use! \$\endgroup\$ – TehPers Aug 6 '17 at 5:11
  • \$\begingroup\$ @totallyhuman It looks like there aren't any turning instructions, so this seems like mostly just math with multiples of 9. Very, very convoluted math. \$\endgroup\$ – Robert Fraser Aug 6 '17 at 8:42
  • \$\begingroup\$ Cracked? I think I got the intended input, but it doesn't quite work, but I'm pretty sure it fails due to an interpreter bug. See my explanation in crack post. If I am right, then you were right that it was actually darn easy : ) \$\endgroup\$ – rexroni Aug 10 '17 at 5:40
3
\$\begingroup\$

6502 machine code (C64), 51 53 bytes (Cracked)

00 C0                     .WORD $C000     ; load address
20 FD AE                  JSR $AEFD
20 EB B7                  JSR $B7EB
8A                        TXA
0A                        ASL A
45 14                     EOR $14
8D 21 C0                  STA $C021
45 15                     EOR $15
85 15                     STA $15
49 E5                     EOR #$E5
85 14                     STA $14
8E 18 D0                  STX $D018
A0 00                     LDY #$00
B1 14                     LDA ($14),Y
20 D2 FF                  JSR $FFD2
C8                        INY
C0 0E                     CPY #$0E
D0 F6                     BNE *-8
60                        RTS
C8 45 4C 4C 4F 2C 20 D7   .BYTE "Hello, W"
4F 52 4C 44 21 0D         .BYTE "orld!", $D

Online demo

Usage: SYS49152,[x],[n], where x is a 16bit unsigned integer and n is an 8bit unsigned integer.

Input is 52768 and 23 (SYS49152,52768,23)

The second parameter is directly written to D018, a control register of the VIC-II graphics chip. Using a suitable reference, you can deduce what to write there for setting lowercase mode without changing other modes and the address of the screen memory: $17, or decimal 23. With that, you can follow the arithmetics in the code, so the first parameter ends up with the correct string address in $14/$15 (little-endian). A more in-depth explanation can be found in the crack.

Screenshot

Invoked with wrong values, a crash is very likely.

For cracking, you might want to run it in a local installation of vice, so here's a BASIC loader to paste into the emulator (RUN it to place the program at $C000):

0fOa=49152to49202:rEb:pOa,b:nE
1dA32,253,174,32,235,183,138,10,69,20,141,33,192,69,21,133,21,73,229,133,20,142
2dA24,208,160,0,177,20,32,210,255,200,192,255,208,246,96,200,69,76,76,79,44,32
3dA215,79,82,76,68,33,13

Update: Added two bytes for the load address to make this an executable C64 PRG file in response to the discussion on meta

\$\endgroup\$
  • \$\begingroup\$ Are you sure you need to call the comma checking function at the beginning? I'm under the impression that b7eb does that check, too. \$\endgroup\$ – A Gold Man Aug 10 '17 at 4:51
  • \$\begingroup\$ b7eb calls aefd, but only after calling ad8a (parse number as float (!)(wtf)(MS)) and b7f7 (convert that float to 16bit unsigned int) -- so I have to first call aefd myself for consuming the first comma. \$\endgroup\$ – Felix Palmen Aug 10 '17 at 5:14
  • \$\begingroup\$ Cracked! Sweet sweet vengeance! \$\endgroup\$ – A Gold Man Aug 10 '17 at 16:01
  • \$\begingroup\$ @AGoldMan finally edited my post. Again, well done! Maybe I can come up with another C64 code that's a bit harder to crack (without being unfair), not sure yet :) \$\endgroup\$ – Felix Palmen Aug 11 '17 at 7:02
2
\$\begingroup\$

Python 2, 63 bytes, cracked

Just to get the ball rolling...

#coding:rot13
cevag vachg()==h'Hello, World!'naq'Hello, World!'

Try it online!

\$\endgroup\$
  • 1
    \$\begingroup\$ Is it generally accepted for the OP to crack submissions? \$\endgroup\$ – MD XF Aug 5 '17 at 17:33
  • 1
    \$\begingroup\$ cracked \$\endgroup\$ – Sriotchilism O'Zaic Aug 5 '17 at 17:42
  • 3
    \$\begingroup\$ That's interesting... I hadn't realized any "normal" language supports coding in ROT13 o_o \$\endgroup\$ – ETHproductions Aug 5 '17 at 18:04
  • 13
    \$\begingroup\$ @Arnauld And you're claiming PHP is a normal language? \$\endgroup\$ – NoOneIsHere Aug 5 '17 at 18:35
  • 1
    \$\begingroup\$ @NoOneIsHere Er... no. My bad. :-P \$\endgroup\$ – Arnauld Aug 5 '17 at 18:53
2
\$\begingroup\$

Pyth, 18 bytes (Cracked)

IqGQ"Hello, World!

This is extremely easy, and anyone that knows Pyth would crack it in the blink of an eye, but still... Note that you must put the String between quotes.

Try it online!

\$\endgroup\$
  • \$\begingroup\$ If anyone cracks it, please edit in yourselves. \$\endgroup\$ – Mr. Xcoder Aug 5 '17 at 18:12
  • \$\begingroup\$ Cracked? \$\endgroup\$ – totallyhuman Aug 5 '17 at 18:18
  • 1
    \$\begingroup\$ @totallyhuman Yep \$\endgroup\$ – Mr. Xcoder Aug 5 '17 at 18:18
2
\$\begingroup\$

JavaScript (Browser only), 95 bytes (Cracked)

try{a=JSON.parse(prompt());try{a=='[object Object]'}catch(a){alert('Hello, World!')}}catch(a){}

Not too hard. Has multiple solutions.

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

Jelly, 11 bytes (cracked)

sLƽ$Xṙ5O½Ọ

Try it online!

Intended input:

〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ

\$\endgroup\$
  • \$\begingroup\$ Cracked \$\endgroup\$ – HyperNeutrino Aug 5 '17 at 19:32
  • \$\begingroup\$ @HyperNeutrino Heh that was sneaky, given it lived for over half an hour. ;) \$\endgroup\$ – Erik the Outgolfer Aug 5 '17 at 19:48
  • \$\begingroup\$ Heh that's cuz I only saw it 10 minutes before seeing it ;P \$\endgroup\$ – HyperNeutrino Aug 5 '17 at 20:08
2
\$\begingroup\$

05AB1E, 20 bytes (Cracked)

Shouldn't be too hard though:

•GG∍Mñ¡÷dÖéZ•2ô¹βƵ6B

Uses the 05AB1E encoding. Try it online!

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

Ly, 12 bytes (Cracked)

n[>n]<[8+o<]

Try it online!

I don't expect this to last very long, but oh well. It didn't last very long.

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

Python3, 192 bytes Cracked I guess

from sys import *
from numpy import *
e=enumerate
c='Hello World!'
w=eval(argv[1])
x=[ord(n)+2*i for i,n in e(c)]
print(''.join([c[int(sum([c*cos(n*i)for i,c in e(w)])+.01)]for i,n in e(x)]))

The text it reads is the first program argument: python3 hw.py '[1,2,3]'

Don't be lame and try to put a print("Hello World!") statement as the argument... it prints an error afterwards anyways (at least on the command line), so I don't think that should count. (Edit: somebody did exactly that)

\$\endgroup\$
  • 4
    \$\begingroup\$ Cracked. Lame crack, but unrestricted eval must be punished =) \$\endgroup\$ – Sisyphus Aug 6 '17 at 6:11
2
\$\begingroup\$

Jelly,  20  21 bytes (Cracked)

+1 byte - "...and a trailing newline"

œ?“¥ĊɲṢŻ;^»œ?@€⁸ḊFmṪ⁷

Try it online!

There are, in fact, infinite solutions.

\$\endgroup\$
  • \$\begingroup\$ I think I cracked this. My crack works with the which is for some reason missing from the TIO link, so I hope I didn't confuse myself. \$\endgroup\$ – tehtmi Aug 6 '17 at 5:51
  • \$\begingroup\$ Sorry about the TIO mistake! \$\endgroup\$ – Jonathan Allan Aug 6 '17 at 13:10
2
\$\begingroup\$

Lua 5.1, 44 bytes (Cracked)

s=...loadstring(#s>4+#s:gsub("%l","")or s)()

Note that Lua 5.1 is a different language than Lua 5.2 or Lua 5.3. "Try it online" doesn't have Lua 5.1. You can check your Lua version by running print(_VERSION). (There should be a solution in any implementation that uses PUC-Rio's Lua 5.1 core.)

As a test harness, you can use something like this:

function test(...)s=...loadstring(#s>4+#s:gsub("%l","")or s)()end

test[[
This is my input!
It can have multiple lines!
]]

Test harness on repl.it

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

C (GCC on TIO), 84 bytes golfed (Cracked)

#include<stdio.h>
main(x){scanf("%d",&x);printf("%2$s","Hello, World!\n",(void*)x);}

Here's an ungolfed version that works too:

#include <stdio.h>
int main(void)
{
    int x;
    scanf("%d",&x);

    printf("%2$s","Hello, World!\n",(void*)x);
}
\$\endgroup\$
2
\$\begingroup\$

JavaScript (ES6), 92 bytes (Cracked)

This simple string copy function seems to be really resisting you to copy any strings resembling Hello, World!...

f=s=>{let r='',i=0;while(i<13)r+=s[i]=='Hello, World!'[i]||s[i++];return r};Object.freeze(f)

Try it online!

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

Röda, 71 bytes (Cracked)

{[[head(_)]..[unpull(1)if[_1>1]]]|[_()|chars|unorderedCount|[_*(_-1)]]}

Try it online!

Usage: push(/* input */) | f() (where f is a variable that holds the function above).

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

JavaScript (ES6), 135 119 bytes, (Cracked)

const t='Hello, World!',g=q=>eval(`(function(p,q${q}){return eval(p),eval(q)})`),f=s=>g('')(s,0)==t&&g('=1')(s,0)!=t&&t

Try it online!

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

Ruby, 88 bytes, Cracked by w0lf

require'prime'
n=gets.to_i
n.prime?&&$><<n.to_s(36)[0,5].capitalize
$><<", #$'"if/30191/

Try it online!

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

JavaScript (ES6) 107 Bytes [Thanks Евгений Новиков] (Cracked)

i=r=>{for(e="",n=0;r.length>n;o=r.charCodeAt(++n),e+=String.fromCharCode(((3^o^19)<<1^15^13)<<1));return e}

Call on the i function using a string.

The console.log... is for testing purposes.

Try It Online!

\$\endgroup\$
  • \$\begingroup\$ Welcome to PPCG! You can save 8 bytes: (1) remove var, (2) () from one arrow-function argument, (3) replace return to eval("") (4) delete ; at the end. 110 bytes solution: pastebin.com/qwdm7fT7 Good luck \$\endgroup\$ – Евгений Новиков Aug 7 '17 at 7:19
  • \$\begingroup\$ Finally got 50 rep, so: Cracked \$\endgroup\$ – Voile Aug 7 '17 at 11:09

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.