
Ask HN: Decode Youtube 500 page - aeon10
This is youtube&#x27;s 500 page. I wonder if someone knows how the &#x27;information&#x27; is encoded. It is not base64. Does anyone know how to decode it.<p>http:&#x2F;&#x2F;paste.pm&#x2F;raw&#x2F;dme
======
WhatsName
An analysis of this can be found here: [http://www.cambus.net/decoding-
youtube-http-error-500-messag...](http://www.cambus.net/decoding-youtube-http-
error-500-message/)

~~~
27182818284
Honestly I'd be happier seeing this on HN. You should submit if you haven't
already.

------
djthorpe
The code is indeed very useful to debug issues. When asked for it by YouTube,
please provide the actual text rather than a screenshot...I get sent the
screenshot a lot and then I have to use OCR software in order to decode it.

~~~
aeon10
Can you divulge what kinds of information is stored in it. Or the encoding it
uses?

------
Perseids
Why do you assume it is not base64 encoded? I have always come to believe it
is some encrypted data. If I was Google I would probably give every server a
UUID and a symmetric key. If an error occurs encrypt (and authenticate) the
stacktrace and other debug information with that symmetric key and prepend the
UUID. As a developer you can then find out the server that produced the error
message, log in via SSH and decrypt the debug information.

But it would be interesting to collect a lot of this error messages to check
if they appear to be completely random.

~~~
nwh
They change completely on every load. Encoding would likely have similar
sections between page refreshes, as it doesn't we can assume your theory of
encrypted data is correct. It makes sense anyway, it means they can have a
user supply a stack trace or similar without exposing any information to them.

~~~
aeon10
Actually the first few characters remained the same with page loads.

~~~
nwh
CBC mode AES?

~~~
drdaeman
More likely a header. It's 3081 byte blob after base64 decoding. If we
consider it's encrypted with some block cipher with 128 or 256-bit blocks (IV
and/or MAC would be likely to be 128-bit, too), there are 9 bytes for some
header and/or padding.

~~~
nwh
Good catch.

------
slashdotaccount
It is non-standard base64: it uses '_' and '-' instead of '+' and '/'. You can
read in Wikipedia at
[https://en.wikipedia.org/wiki/Base64](https://en.wikipedia.org/wiki/Base64)

------
kaivi
It is surely an encrypted stack trace, encoded in base64, which is probably
being spit out by the load balancer proxy. I would not be surprised if Youtube
developers used their own Chrome extension for making that binary meat
readable.

I have once set out to write a module for Nodejs for the same purpose, but
never finished it. Can't really see a downside in this way of reporting
errors.

------
goblin89
Perhaps questions like this one should be asked somewhere else, possibly
StackOverflow: [http://stackoverflow.com/questions/21681084/decoding-
youtube...](http://stackoverflow.com/questions/21681084/decoding-youtubes-
error-500-page)

~~~
nulagrithom
Isn't that OT?

~~~
eitland
Every interesting question is OT over there. Or has ultiple answers. Or
doesn't belong there for some other reason.

( I used to like SO very much and I hope someone will come up a similar site
with more useful guidelines. : )

------
babawere
1\. Non-standard base64 and 2\. Definitely Compressed ... by guess would be
snappy compression 3\. Possibility of serialization using protocol buffer 4\.
not sure if such information would be encrypted after such a server failure

------
nigma
Using Python 3.3:

    
    
        import base64
        base64.urlsafe_b64decode(s)

~~~
aeon10
I cant seem to get any legible data.

------
tamiriis
Tudo 2

