So, I’m late to the party (which ended around page 130). Nevertheless, I went through the source code myself and here’s a completely deobfuscated version of the javascript code from the KXMB article (which hasn’t been posted so far):
$.hit = function(event, rect) {
var elem = $(event.target),
X = event.offsetX,
Y = event.offsetY;
if (X === undefined) {
X = event.pageX - elem.offset().left;
Y = event.pageY - elem.offset().top;
}
return X >= rect.left && X <= rect.right && Y >= rect.top && Y <= rect.bottom;
};
(function() {
'use strict';
function switchRadio() {
on = !on;
audio.volume = on ? 0.05 : 0;
image.attr('src', on ? './assets/SSBuZXZlciBzdXNwZWN0ZWQgc3VjaCB0aGluZ3MgY291bGQgYmUuLi4=' : './assets/SWYgeW91IGludGVuZCB0byBnbyBvbiwgdGhlbiwgSSBiZWcgb2YgeW91LCBwcm9jZWVkIHdpdGggZXh0cmVtZSBjYXV0aW9uLg==');
}
var Context = AudioContext || webkitAudioContext;
if (Context !== undefined) {
var on = false,
image = $('img[src="./assets/SWYgeW91IGludGVuZCB0byBnbyBvbiwgdGhlbiwgSSBiZWcgb2YgeW91LCBwcm9jZWVkIHdpdGggZXh0cmVtZSBjYXV0aW9uLg=="]'),
context = new Context,
gain = context.createGain(),
audio = new Audio('./assets/RGllLi4ueW91IGFsbCBkaWUuLi55b3UgYWxsIGRpZS4uLg=='),
quantum = 52,
chars = [[' ', '.'], ['/', '-']],
quanta = {'.': quantum, '-': 3 * quantum, ' ': 3 * quantum, '/': 7 * quantum},
code = '64ab95eca3a4c9d56841ec8f55c641f4a2a16924c08ca862584605736908c0aca8e296ac07f1e70ec28aecc05c882d537ecc085e624b096bc05af17d260ca42c51e96282ee60c0ad0c762767c2868a1acf82490585c0ce085e62c62505ab719e6624e29...,
cachedImage = new Image;
cachedImage.src = './assets/SSBuZXZlciBzdXNwZWN0ZWQgc3VjaCB0aGluZ3MgY291bGQgYmUuLi4=';
gain.connect(context.destination);
gain.gain.value = 0.25;
audio.volume = 0;
audio.loop = true;
audio.play();
(function audioLoop(n) {
if (n === code.length) {
requestAnimationFrame(function() {
audioLoop(0);
});
return;
}
var oscillator = context.createOscillator(),
d = parseInt(code.charAt(n), 16),
l = d % 2,
t = d < 4 ? 0 : 1,
char = chars[l][t],
stop = false,
dur = quanta[char];
oscillator.frequency.value = 700;
oscillator.connect(gain);
setTimeout(function() {
if (on && ' ' !== char && '/' !== char) {
oscillator.start(0);
stop = true;
}
setTimeout(function() {
if (stop && ' ' !== char && '/' !== char)
oscillator.stop(0);
audioLoop(n + 1);
}, dur);
}, quantum);
})(0);
image.on('click', function(event) {
if ($.hit(event, {left: 158, right: 168, top: 74, bottom: 83}))
switchRadio();
})
}
})();
(function() {
'use strict';
$('#footer img').on('click', function(a) {
if ($.hit(a, {top: 126, bottom: 141, right: 124, left: 58}))
window.open('https://steampowered.com')
})
})();
console.log('[HEADCRAB ART]');
The morse code is completely extracted from the hex string hardcoded in the source code and has nothing to do with the noise sound file (see the lines 54-57). What’s interesting is that the format of this string is the same as the HALOS file we are stuck at. The string is treated as a sequence of hex digits, a sound is played when the digits is at least 4 and the effect is long and when the digit is odd. The digits are chosen so that it looks random at the first sight.
This suggests we are not dealing with cryptography, but with steganography. This goes well with Stormseeker’s comment that CIA couldn’t brute force it. I tried looking at the binary representation of each hex digit of the HALOS file, but I couldn’t find any pattern which would prove it’s not random (this is not a problem in the code from the KXBM article, disregarding the obviously nonrandom ending). It’s been randomized really well and there’s just too little data to do any statistics on. I’m out of ideas for now.