de Bruijn Sequences

Objective #3
East Hall Corridor

When you break into the speaker unpreparedness room, what does Morcel Nougat say?

For hints on achieving this objective, please visit Tangle Coalbox and help him with Lethal ForensicELFication Cranberry Pi terminal challenge.

Tangle Coalbox

Opening a Ford Lock Code hint from Tangle Coalbox
Opening a Ford with a Robot and the de Bruijn Sequence


de Bruijn Sequence Generator hint from Tangle Coalbox
de Bruijn sequence generator


Have you been able to solve the lock with the funny shapes?
It reminds me of something called "de Bruijn Sequences."
You can optimize the guesses because there is no start and stop -- each new value is added to the end and the first is removed.
I've even seen de Bruijn sequence generators online.
Here the length of the alphabet is 4 (only 4 buttons) and the length of the PIN is 4 as well.
Mathematically this is k=4, n=4 to generate the de Bruijn sequence.
Math is like your notepad and pencil - can't leave home without it!
I heard Alabaster lost his badge! That's pretty bad. What do you think someone could do with that?

Opening Door Passcode and trying to guess some sequence:

incorrect door passcode

Using de Bruijn sequence generator with k=4 and n=4 gives following sequence:

Sequence length: k^n = 4^4 = 256 (with the "wrap": k^n+(n-1) = 4^4+(4-1) = 259)
Sequence:
0 0 0 0 1 0 0 0 2 0 0 0 3 0 0 1 1 0 0 1 2 0 0 1 3 0 0 2 1 0 0 2 2 0 0 2 3 0 0 3 1 0 0 3 2 0 0 3 3 0 1 0 1 0 2 0 1 0 3 0 1 1 1 0 1 1 2 0 1 1 3 0 1 2 1 0 1 2 2 0 1 2 3 0 1 3 1 0 1 3 2 0 1 3 3 0 2 0 2 0 3 0 2 1 1 0 2 1 2 0 2 1 3 0 2 2 1 0 2 2 2 0 2 2 3 0 2 3 1 0 2 3 2 0 2 3 3 0 3 0 3 1 1 0 3 1 2 0 3 1 3 0 3 2 1 0 3 2 2 0 3 2 3 0 3 3 1 0 3 3 2 0 3 3 3 1 1 1 1 2 1 1 1 3 1 1 2 2 1 1 2 3 1 1 3 2 1 1 3 3 1 2 1 2 1 3 1 2 2 2 1 2 2 3 1 2 3 2 1 2 3 3 1 3 1 3 2 2 1 3 2 3 1 3 3 2 1 3 3 3 2 2 2 2 3 2 2 3 3 2 3 2 3 3 3 3

Let's write a simple Python program to help with guesswork.

import requests
s = '0000100020003001100120013002100220023003100320033010102010301110112011301210122012301310132013302020302110212021302210222022302310232023303031103120313032103220323033103320333111121113112211231132113312121312221223123212331313221323133213332222322332323333'
u = 'https://doorpasscode.kringlecastle.com/checkpass.php?i='

for i in range(len(s)-3):
        guess = s[i:i+4]
        print('{0}'.format(guess))
        r = requests.get(u + guess + '&resourceId=undefined')
        if b'Incorrect guess.' not in r.content:
                print(r.content)
                break

By running it, pretty soon the answer is revealed.

python guess.py
0000
0001
0010
0100
1000
0002
0020
0200
2000
0003
0030
0300
3001
0011
0110
1100
1001
0012
0120
b'{"success":true,"resourceId":"undefined","hash":"0273f6448d56b3aba69af76f99bdc741268244b7a187c18f855c6302ec93b703","message":"Correct guess!"}'

Correct sequence is 0120 or triangle, square, circle, triangle.

correct door passcode

Afterwards, door to Speaker UNpreparedness Room are open and, after entering, chat with Marcel Nougat reveals:

Marcel Nougat

Welcome unprepared speaker!

Answer to this objective is Welcome unprepared speaker!