15
1
For robbers' post, Cheapo Enigma machine (Robbers)
A cop's submission will consist of a program/function that accepts a single byte of data and return a single byte of data. Every possible input must produce a unique output. (In the other words, your function must be bijective)
Robbers will attempt to create the inverse function of yours using as short a code as possible. So your objective is to make your function difficult to invert.
You cannot use built-ins that have the sole purpose of hashing or encryption.
Your byte count cannot exceed 64 bytes. 0-byte solutions are not eligible for winning.
Input/Output format
8 bits (0 or 1), or a base-10 integer in range 1-256, 0-255 or -128 to 127. Can use standard I/O or file I/O. Function can also return a value as output. Input and output should belong to the same range (binary, 1-256, 0-255 or -128 to 127). The robber will also be required to use this range for input and output.
Scoring
Ratio of your byte count to that of the best robber's attempt against you. Lowest score wins.
You are eligible to win (as a cop) only if a robber has attempted to defeat you. (This robber may be you)
Example
C++, uses 0-255 range, 31 bytes
int x;
cin>>x;
cout<<(x+1)%256;
Possible robber submission in C++, 32 bytes
int f(int x)
{return x?x-1:255;}
Using the same language or a similar algorithm isn't a requirement
This gives a score of 31/32 = 0.97 to both the cop and the robber.
1What does a cop submission consist of? Language, size and full program/function code? – Arnauld – 2017-04-22T10:27:52.370
1isn't it a bit broken if the cop can just make an arbitrarily large thing? – Destructible Lemon – 2017-04-22T10:32:43.370
1This robber may be you What if I post a 64-byte cop answer that maps N to N and a robber answer that does the same thing in one byte? – Arnauld – 2017-04-22T11:04:42.947
@Arnauld Yes, cop submission consists of a single program/function. – ghosts_in_the_code – 2017-04-22T13:44:16.090
@Arnauld I already mentioned, the robber's code isn't competitive in that case; only the cop's code is. – ghosts_in_the_code – 2017-04-22T13:44:53.217
@DestructibleLemon That's why there's a limit of 64 bytes. – ghosts_in_the_code – 2017-04-22T13:49:25.887
1You may want to specify if / how the cop submission should be updated when robbers answer it. (The usual "cracked" update doesn't apply here, I guess. At least not as a unique and definitive crack.) – Arnauld – 2017-04-23T13:28:49.857
Using the same language or a similar algorithm isn't a requirement I missed that at first. Especially the part about the language should be made more prominent. – Dennis – 2017-04-24T18:19:32.840
3On second thought, you might want to remove that rule altogether. I can destroy most answers by posting a robber in Jelly. – Dennis – 2017-04-24T18:25:39.333
Can I also try to out-cop a robber submission? – flawr – 2017-04-24T19:48:35.167
Does the OP mean "injective" instead of "bijective"? – Leaky Nun – 2017-04-25T11:56:34.967
@LeakyNun if every input maps to a different output in the same range, it is bijective within that range. – fəˈnɛtɪk – 2017-04-25T12:29:06.660
@Dennis Yes, you are free to. Otherwise someone may win the challenge simply by using a language others are not familiar with, or have no interest in coding in. – ghosts_in_the_code – 2017-04-25T14:26:19.720
@flawr Yes, you can post multiple answers with multiple function mappings. If you haven't changed the mapping, you can edit the original answer. – ghosts_in_the_code – 2017-04-25T14:27:28.990
@Dennis Also certain functions may be missing in certain languages, making it difficult to invert the function. – ghosts_in_the_code – 2017-04-25T14:34:44.330
@LeakyNun If you have a function that from a finite set to another finite set of the same size, then bijective, injective and surjective are all equivalent. – flawr – 2017-04-25T16:10:24.217