# 8-bit Lock and Key

So my birthday is in a week and my dad and I have a tradition of presenting the other with a puzzle. If you can solve the puzzle before your birthday, you get the present!

This year, he presented to me a chest with a lock and gave me the conditions.

"Here are the rules for your puzzle this year. It's pretty simple. It's called '8-bit Lock and Key.' You open the chest, you win. But you can only try it once per day."

I complained, "That's not fair, there's nothing to go off of! I just have a lock and the title, that's not nearly enough! How am I supposed to guess the combination?"

"Not true, you have a clue on the chest and all the resources in the world to use. Feel free to use your friends and get their help, although you may find groups of two are your best bet. Also, 'combination' isn't the word you're looking for. Try 'password' instead."

I got a brief look at the chest before he put it away for the day. The lock is a 6-digit lock with each digit ranging from 0 to 9. Above the lock are the symbols | & ^

I get one guess a day, so I've only got 7 tries and a million possibilities. Can you help me?

# First Hint

"Perhaps I was a bit too vague to start with. I've already told you all the clues you need to solve it, but a more direct hit may be in order.

You may not realize what you heard,
when I said to use a password.
8 bits transformed will be your key,
but you're thinking too numerically.
You may see the lock in the base of ten,
but with the alphabet is where you'll begin.

That ought to get you moving. You'd better not take the whole week like you did last year."

Thanks, Dad. Now it's a riddle AND a number puzzle.

# Second Hint

I tried 318008 the first day and my dad just laughed.

"You're not even trying. No hint for you today."

So I went with E.Nigma's answer for the second attempt: 029035. I showed him the work that went with it and he seemed pleased with the progress.

"Now you're getting somewhere. You're pretty close, but still missing something. I hope this next hint will get you the rest of the way.

The sheer choices of answers is far less scary.
When the answers are limited to only binary.
When the answer is revealed, you will find
A set of 1's and 0's, 3 of each kind.
Like E.Nigma I'm not fond of operator properties
But operators can be used as many times as you please

I've still got 5 tries and 5 days left but it seems like we're pretty close!

# Final Hint

I haven't updated it in the last day or two cause I actually solved it! Almost forgot to share it with you guys.

I showed my dad Enigma's work again and he gave me another clue that got me the rest of the way.

"8 paired is four, 4 paired is two,
Paired again leaves but one, present for you."

If someone gets the last part I'll let you know what was in the chest.

And if it helps, one more hint from me. I'm not as good at making riddles though so it's just a straight sentence

You end up with an 8 digit answer, but the first two zeros can be dropped to get the combination.

Now that it's been answered, if anyone is interested, here's what I got for my present.

2 tickets to go see "Newsies" broadway.

I have some weird combinations of interested xD

• "Lock" & "Key"? – James Apr 26 '16 at 21:57
• This does seem a bit too much like "guess what arbitrary thing I'm thinking of". Here's one sample arbitrary thing. Your dad is a fan of old 8-bit microcomputers. On the 6502 (clearly the best of the old 8-bit micros) the opcodes for immediate AND, OR, XOR operations were 0x29, 0x09 and 0x49 respectively. So the combination is 290949. ... But there are a bunch of other addressing modes that produce other opcodes that use only hex digits 0..9. And there are a bunch of other 8-bit micros with AND, OR and XOR instructions. And I bet the actual answer is quite different. – Gareth McCaughan Apr 27 '16 at 1:02
• With the hint, it's gotta be 319009! – Wesley Situ Apr 27 '16 at 1:29
• @WesleySitu Nah. 318008 – SendersReagent Apr 27 '16 at 2:34
• I guess the present must be $ :p – Jonathan Allan Apr 27 '16 at 5:40 ## 4 Answers I would propose 000111 The idea being Start with the word 'password', consider the ASCII codes (here in binary) p = 01110000 a = 01100001 s = 01110011 s = 01110011 w = 01110111 o = 01101111 r = 01110010 d = 01100100 OR (|) the codes pairwise, p|a = 01110001 s|s = 01110011 w|o = 01111111 r|d = 01110110 then AND (&) the resulting codes pairwise, (p|a)&(s|s) = 01110001 (w|o)&(r|d) = 01110110 and XOR (^) the remaining codes. ((p|a)&(s|s))^(w|o)&(r|d) = 00000111 When you drop 2 zeroes, you get indeed 1's and 0's, 3 of each kind. • You get the same answer if you use ascii for the letters, which might be more in line with "8-bit" – ffao May 3 '16 at 19:43 • Would you care to update it to use the ascii values? – ChronoD May 3 '16 at 19:46 • Agree with @ffao, also matches the clue that the final answer is 8 digits, then you need to drop the two leading 0s. – Dan Russell May 3 '16 at 19:46 • Aah... I didn't see the last clue telling about a 8-bit answer. I aimed for a 6-digit solution. But OK, I fixed it. – Florian F May 3 '16 at 20:40 ## Try n°1 My guess: 15 04 14 Reasoning: • 6 digits base 10 = 3 numbers base 16 = 3 ASCII symbols • The 3 symbols are likely to be the word "key", which are, in ASCII : • "k" = 0x6B = 0110 1011 • "e" = 0x65 = 0110 0101 • "y" = 0x79 = 0111 1011 • We then apply the corresponding (in order) bitwise operators, resulting in : • "k" = 0110 | 1011 = 1111 = 15 • "e" = 0110 & 0101 = 0100 = 04 • "y" = 0111 ^ 1001 = 1110 = 14 The beauty of it being that even if your father thought of an upper-case K, both "K" (4B / 0100 1011) and "k" (6B / 0110 1011) result in 15 after applying the | bitwise operator. ## Try n°2 After reading the clue again, I'm not satisfied with my use of the bitwise operators. Your father designed them as a "clue", whereas I used them as the main tool for computing the code. Also, I'm considering that the word we have to work on might actually be "password", but I'm not sure which operations to perform unto it. Nevertheless (3rd part is octal, just in case) : • "p" = 0x70 = 160 = 0111 0000 • "a" = 0x61 = 141 = 0110 0001 • "s" = 0x73 = 163 = 0111 0011 • "s" = 0x73 = 163 = 0111 0011 • "w" = 0x77 = 167 = 0111 0111 • "o" = 0x6F = 157 = 0110 1111 • "r" = 0x72 = 162 = 0111 0010 • "d" = 0x64 = 144 = 0110 1000 I thought about combining these letters in "groups of 2" (as the clue says), resulting one of the following : • pa, ss, wo, rd • pw, ao, sr, sd (if placing "pass" on one row, "word" on another and reasoning vertically) And now we have 4 groups, on which we could apply the bitwise operators : • pa | ss & wo ^ rd • pw | ao & sr ^ sd But I'm not fond of this solution because it implies using the bitwise operators priorities (& ^ |). It leads to : • pa | ss & wo ^ rd • = 0111 0000 0110 0001 | 0111 0011 0111 0011 & 0111 0111 0110 1111 ^ 0111 0010 0110 1000 • = 0111 0000 0110 0001 | 0111 0011 0110 0011 ^ 0111 0010 0110 1000 • = 0111 0000 0110 0001 | 0000 0001 0000 1011 • = 0111 0001 0110 1011 • = 29035 • pw | ao & sr ^ sd • = 0111 0000 0111 0111 | 0110 0001 0110 1111 & 0111 0011 0111 0010 ^ 0111 0011 0110 1000 • = 0111 0000 0111 0111 | 0110 0001 0110 0010 ^ 0111 0011 0110 1000 • = 0111 0000 0111 0111 | 0001 0010 0000 1010 • = 0111 0010 0111 1111 • = 29311 Both of these answers being 5 numbers long, you might try to add a 0 in front of them. The solutions of my 2nd try (29035 being the most likely of the two), albeit quite sketchy, have the benefit of using all the obvious clues : the "8 bits transformed" (ASCII to binary), the bitwise operators, the excessive mention of the "password" word, the mention of "groups of two"; whereas my 1st try lacks the use of the "password" word ## Try n°3 The sheer choices of answers is far less scary. When the answers are limited to only binary. That leads me to believe the answer is only binary, which may seem a bit weird at first, but considering that binary locks are (almost?) nonexistent, it makes sense your father would use a common 10-digits one. When the answer is reveals, you will find A set of 1's and 0's, 3 of each kind. If I'm interpreting this correctly, the answer contains 3 "0" and 3 "1", which now reduces the scope of possibilities to a few dozens (I'm too lazy to do some non-binary math!) Another interpretation is that taking the "reveals" word as an input outputs a binary number with 3 "0" and 3 "1". Here is for reference, but so far I have no idea which operators to apply: • "r" = 0x72 = 0111 0010 • "e" = 0x65 = 0110 0101 • "v" = 0x76 = 0111 0110 • "e" = 0x65 = 0110 0101 • "a" = 0x61 = 0110 0001 • "l" = 0x6C = 0110 1100 • "s" = 0x73 = 0111 0011 Also, I had a question : do these hints come in written form? I'm asking because of the "operator properties" mention (as I spoke of priorities and not properties): it would be a shame to work on "reveals" if the word was "reveal" or something like that ;) • I had thought along the same lines but didn't think to split into two words of length 4. Looks like | & ^ =$ is coming their way... – Jonathan Allan Apr 27 '16 at 13:50
• ...and the the k, K must be a confirmation. – Jonathan Allan Apr 27 '16 at 13:55
• I accepted your edit, but you may wish to contact SE to merge your new account with the one you originally used - go here and describe what happened and someone should be able to help. – Jonathan Allan Apr 29 '16 at 12:57
• Also you can ask questions in the comments section of the question – Jonathan Allan Apr 29 '16 at 12:59

My guess is:

386007

From hint:

Characters in the string "8 bits", including the space, has the following ascii hex values: 38 20 62 69 74 73

These in binary gives:

00111000 00100000 01100010 01101001 01110100 01110011

Apply the operators |, &, and ^ to each of the pairs above:

00111000 01100000 00000111

The above binary values in hex gives:

38 60 07

Even though my guess came from the hint, the "key" in my guess was part of the original puzzle.

One possibility could be:

732655

Reasoning:

First I changed the three symbols to ASCII in hexadecimal (since a pair of hexadecimal digit is 8-bits)
This gave | --> 7C, & --> 26, ^ --> 5E
Then I took the two letters and mapped them to numbers using A == 1, B == 2, etc.. and got | --> 73, & --> 26, ^ --> 55
Putting these three together you get 732655

• That was what I was thinking, but I wasn't sure it was right. – Vincent Tang Apr 28 '16 at 2:06