| Bytes | Lang | Time | Link |
|---|---|---|---|
| nan | This challenge is intriguing and encourages creative solutions! To participate | 241116T102440Z | United k |
| 007 | brainfuck | 170808T211542Z | user6318 |
| 186 | Python 3 | 170806T130749Z | rexroni |
| 130 | CJam | 170807T042905Z | Esolangi |
| 094 | 6502 machine code C64 | 170811T131134Z | Felix Pa |
| 038 | TeX | 170806T162701Z | A Gold M |
| 053 | 6502 machine code C64 | 170807T095357Z | Felix Pa |
| 159 | Cubically | 170805T195717Z | MD XF |
| 143 | JavaScript ES6 | 170807T073413Z | Voile |
| 538 | ><> | 170807T040338Z | Not a tr |
| 023 | Perl 5 | 170808T001825Z | Chris |
| 023 | Explode | 170806T001611Z | Stephen |
| 080 | C gcc | 170807T125623Z | Felix Pa |
| 102 | JavaScript ES6 | 170807T103914Z | Voile |
| 6107 | JavaScript ES6 107 Bytes [Thanks Евгений Новиков] Cracked | 170807T061055Z | Ephellon |
| 088 | Ruby | 170807T131710Z | histocra |
| 094 | PHP | 170807T115110Z | LP154 |
| 119 | JavaScript ES6 | 170807T094819Z | Voile |
| 071 | Röda | 170807T091914Z | fergusq |
| 092 | JavaScript ES6 | 170807T080505Z | Voile |
| 062 | Bash | 170806T060523Z | Sisyphus |
| 084 | C GCC on TIO | 170806T204346Z | MD XF |
| 044 | Lua 5.1 | 170806T030355Z | tehtmi |
| 089 | tcc | 170805T234016Z | Joshua |
| 021 | Jelly | 170805T230934Z | Jonathan |
| 192 | Python3 | 170806T054135Z | rexroni |
| 152 | C# .NET Core | 170805T203151Z | Grzegorz |
| 006 | MATL | 170806T030750Z | Luis Men |
| 007 | CJam | 170805T202941Z | Erik the |
| 012 | Ly | 170806T005302Z | LyricLy |
| 020 | 05AB1E | 170805T200110Z | Adnan |
| 059 | Octave | 170805T193343Z | Stewie G |
| 011 | Jelly | 170805T183726Z | Erik the |
| 095 | JavaScript Browser only | 170805T183154Z | user7234 |
| 018 | Pyth | 170805T181126Z | Mr. Xcod |
| 063 | Python 2 | 170805T172749Z | totallyh |
This challenge is intriguing and encourages creative solutions! To participate, you must write a program that outputs "Hello, World!" for at least one input while ensuring it’s crack-resistant for a week. The shortest uncracked solution wins, so brevity is key. Be sure to test thoroughly and follow submission guidelines, including runnable code on TIO. https://therutificador.cl/verificador-de-rut/
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
CJam, 130 bytes (safe)
q'p/{'s/{{"cjaei"#}%{)},{`}%S*}%']*}%'[*~]Y8#,:Y;0a\{{__a#{\{_T=}{1$E}w\;}{"T(:T; _T=co T)
:T)0e] _T=)Y=T\t _T=(Y=T\t"S/=~}?}/}:E~;
This is split across two lines for clarity; the newline is not included.
This is semi-golfed, which makes it that much harder to understand.
There are an infinite number of solutions here. If anybody wants to try and find one, I wish them good luck...
Solution:
aipeepceeaiaeeeaeeeccsiiiiaesnccccjccccijcjjccejccccjaajaaaijcjeeejaajaijcccccej
6502 machine code (C64), 94 bytes (Cracked)
00 C0 20 FD AE 20 9E AD 20 A3 B6 A0 00 B9 25 C0 C0 01 F0 21 C0 07 F0 1D C0 0B
F0 19 20 20 C0 C8 D0 EB 51 22 4C D2 FF F0 48 FA A2 1C 6D 72 30 06 A9 03 48 7C
A3 8D 48 C0 B9 26 C0 8D 45 C0 B9 27 C0 8D 46 C0 A2 00 BD FD AE 49 23 20 20 C0
C8 E8 E0 03 D0 F2 C0 0E D0 B5 49 1A 8D 18 D0 60
Disassembled:
00 C0 .WORD $C000 ; load address
20 FD AE JSR $AEFD
20 9E AD JSR $AD9E
20 A3 B6 JSR $B6A3
A0 00 LDY #$00
B9 25 C0 LDA $C025,Y
C0 01 CPY #$01
F0 21 BEQ $C033
C0 07 CPY #$07
F0 1D BEQ $C033
C0 0B CPY #$0B
F0 19 BEQ $C033
20 20 C0 JSR $C020
C8 INY
D0 EB BNE $C00B
51 22 EOR ($22),Y
4C D2 FF JMP $FFD2
F0 48 BEQ $C06F
FA .BYTE $FA
A2 1C LDX #$1C
6D 72 30 ADC $3072
06 A9 ASL $A9
03 .BYTE $03
48 PHA
7C A3 .WORD $A37C
8D 48 C0 STA $C048
B9 26 C0 LDA $C026,Y
8D 45 C0 STA $C045
B9 27 C0 LDA $C027,Y
8D 46 C0 STA $C046
A2 00 LDX #$00
BD FD AE LDA $AEFD,X
49 23 EOR #$23
20 20 C0 JSR $C020
C8 INY
E8 INX
E0 03 CPX #$03
D0 F2 BNE $C044
C0 0E CPY #$0E
D0 B5 BNE $C00B
49 1A EOR #$1A
8D 18 D0 STA $D018
60 RTS
Online demo
Important: When load from disk (like in this online demo), the program only works after issuing a NEW command! Without first doing NEW, you'd only ever get an ?OUT OF MEMORY ERROR when trying to pass a string.
Usage: SYS49152,"[string]", where [string] is your input string.
Yes, input is a string this time, and the white area in the screenshot below doesn't tell you anything about the required length.
This should be quite hard to crack, but it's possible calculating everything back, no hashes or similar involved ;) You might need some reference for the C64 ROMs though. Further tip: look for an area only containing data in the disassembly listing :)
Like with my previous entry, here's a BASIC loader to paste into vice, just RUN this and the program is placed at $C000:
0fOa=49152to49243:rEb:pOa,b:nE
1dA32,253,174,32,158,173,32,163,182,160,0,185,37,192,192,1,240,33,192,7,240,29
2dA192,11,240,25,32,32,192,200,208,235,81,34,76,210,255,240,72,250,162,28,109
3dA114,48,6,169,3,72,124,163,141,72,192,185,38,192,141,69,192,185,39,192,141,70
4dA192,162,0,189,253,174,73,35,32,32,192,200,232,224,3,208,242,192,14,208,181
5dA73,26,141,24,208,96
Solution:
8bitsareenough
Explanation:
The code basically uses an XOR key of the same length as
Hello, World!\n. As this would be quite simple to crack, the key isn't placed in the code as is but there are 3 times 3 bytes that are calculated from the C64's ROMs.
The 3 times 3 bytes in the data are in the format<key>, <low>, <high>, where<low>, <high>is the start address of 3 bytes in the ROM that are taken as part of our XOR key after XOR'ing them with<key>.
It's possible to crack it with some reference / disassembly to the C64 ROMs. Of course, it's easier to just try and get the key from the running program. I attempted to prevent the easiest method of doing this (just entering"Hello, World!\n", as XOR is reversed with the same key) by forcing a crash on wrong input. The crack linked cleverly modified the program, so it won't crash.
Another nice possibility to crack this would have been to spot the single place where output happens:EOR ($22),Y; JMP $FFD2. If you know that fetching a string using the BASIC routines will place a pointer to that string in$22/$23, all you have to do is set a breakpoint atEOR ($22),Yand get the XOR key delivered in the accumulator byte by byte.
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.
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 toD018, 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 decimal23. 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.
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
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!
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!'
><>, 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< | | ^
Perl 5, 23 bytes (Cracked)
eval<>;END{print$x='x'}
Usage: takes one line of input of stdin and evals it. The END block keeps simple attempts like print"Hello, World!\n";exit from working.
our $x;package X;require Tie::Scalar;@ISA=qw(Tie::Scalar);sub TIESCALAR{my$v;return bless\$v,'X';}sub STORE{}sub FETCH{return "Hello, World!\n"}tie $x,'X';
Explode, 23 bytes, Cracked
@_?&4_-j>5&f^~c>&6\|4>7
More coming, this is just the beginning >:)
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.
C (gcc), 80 bytes, Cracked
#define O(c)(((char**)v)+c)
#define W(c)*(O(c)-**O(2)+x)
main(x,v){puts(W(42));}
Provide command line arguments for the desired output.
The intended input commandline was:
"Hello, World!" ,
Quick explanation:
The program does some pointer arithmetics on
argv[], using the firstcharof the second argument and the argument count. See the robbers' post for a full explanation. There are other solutions possible, but the one over there is the most simple one.
Important: This won't work when e.g. built for amd64, therefore the compiler switch -m32 on tio.
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)
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))
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.
Ruby, 88 bytes, Cracked by w0lf
require'prime'
n=gets.to_i
n.prime?&&$><<n.to_s(36)[0,5].capitalize
$><<", #$'"if/30191/
PHP, 94 bytes, Cracked
<?=constant(explode(',',$argv[1])[0]."::".explode(',',$argv[1])[1])==262144?"Hello, world
":a;
Try it online! First codegolf submission, feel free to help me improve this
Cracked, intended input :
ReflectionFunction,IS_DEPRECATED
Because
ReflectionFunction::IS_DEPRECATED = 262144
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
Röda, 71 bytes (Cracked)
{[[head(_)]..[unpull(1)if[_1>1]]]|[_()|chars|unorderedCount|[_*(_-1)]]}
Usage: push(/* input */) | f() (where f is a variable that holds the function above).
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)
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.
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);
}
- Golfed: Try it online!
- Ungolfed: Try it online!
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!
]]
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.
Jelly, 20 21 bytes (Cracked)
+1 byte - "...and a trailing newline"
œ?“¥ĊɲṢŻ;^»œ?@€⁸ḊFmṪ⁷
There are, in fact, infinite solutions.
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)
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()
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
CJam, 7 bytes (cracked)
q5/:i:c
Intended input:
65608656376564465644656476558065568656236564765650656446563665569
Ly, 12 bytes (Cracked)
n[>n]<[8+o<]
I don't expect this to last very long, but oh well. It didn't last very long.
05AB1E, 20 bytes (Cracked)
Shouldn't be too hard though:
•GG∍Mñ¡÷dÖéZ•2ô¹βƵ6B
Uses the 05AB1E encoding. Try it online!
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:
It basically says: "Print the input string, unless the input is 'Hello, World!', in which case it should print nothing (or the null-character).
Jelly, 11 bytes (cracked)
sLƽ$Xṙ5O½Ọ
Intended input:
〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ〡㋄ⶐ✐сᑀ⟙ⶐⶐ〡ސЀᶑ
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.
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.
Python 2, 63 bytes, cracked
Just to get the ball rolling...
#coding:rot13
cevag vachg()==h'Hello, World!'naq'Hello, World!'


