Skip to content

Instantly share code, notes, and snippets.

@siddolo
Created September 10, 2021 16:13
Show Gist options
  • Save siddolo/95f20c53fd2cdd081d6e1d0c1e9dd19a to your computer and use it in GitHub Desktop.
Save siddolo/95f20c53fd2cdd081d6e1d0c1e9dd19a to your computer and use it in GitHub Desktop.
Enter the matrix (thechoiceisyours.whatisthematrix.com reverse engineering)
function stringToBytes(t) {
for (var e = [], i = 0; i < t.length; i++) e.push(255 & t.charCodeAt(i));
return e;
}
function bytesToString(t) {
for (var e = [], i = 0; i < t.length; i++) e.push(String.fromCharCode(t[i]));
return e.join('');
}
function bytesToWords(t) {
for (var e = [], i = 0, b = 0; i < t.length; i++, b += 8)
e[b >>> 5] |= t[i] << (24 - (b % 32));
return e;
}
function wordsToBytes(t) {
for (var e = [], b = 0; b < 32 * t.length; b += 8)
e.push((t[b >>> 5] >>> (24 - (b % 32))) & 255);
return e;
}
function bytesToHex(t) {
for (var e = [], i = 0; i < t.length; i++)
e.push((t[i] >>> 4).toString(16)), e.push((15 & t[i]).toString(16));
return e.join('');
}
function rotl(t, b) {
return (t << b) | (t >>> (32 - b));
}
function rotr(t, b) {
return (t << (32 - b)) | (t >>> b);
}
function endian(t) {
if (t.constructor == Number)
return (16711935 & rotl(t, 8)) | (4278255360 & rotl(t, 24));
for (var i = 0; i < t.length; i++) t[i] = endian(t[i]);
return t;
}
var b = 2,
e = 2,
g = 3,
r = 2;
function z(t, e) {
t.constructor == String
? (t = e && 'binary' === e.encoding ? stringToBytes(t) : stringToBytes(t))
: h(t)
? (t = Array.prototype.slice.call(t, 0))
: Array.isArray(t) || t.constructor === Uint8Array || (t = t.toString());
for (
var r = bytesToWords(t),
l = 8 * t.length,
a = 1732584193,
b = -271733879,
d = -1732584194,
m = 271733878,
i = 0;
i < r.length;
i++
)
r[i] =
(16711935 & ((r[i] << 8) | (r[i] >>> 24))) |
(4278255360 & ((r[i] << 24) | (r[i] >>> 8)));
(r[l >>> 5] |= 128 << l % 32), (r[14 + (((l + 64) >>> 9) << 4)] = l);
var v = function(a, b, t, e, r, s, n) {
var o = a + ((b & t) | (~b & e)) + (r >>> 0) + n;
return ((o << s) | (o >>> (32 - s))) + b;
},
y = function(a, b, t, e, r, s, n) {
var o = a + ((b & e) | (t & ~e)) + (r >>> 0) + n;
return ((o << s) | (o >>> (32 - s))) + b;
},
w = function(a, b, t, e, r, s, n) {
var o = a + (b ^ t ^ e) + (r >>> 0) + n;
return ((o << s) | (o >>> (32 - s))) + b;
},
M = function(a, b, t, e, r, s, n) {
var o = a + (t ^ (b | ~e)) + (r >>> 0) + n;
return ((o << s) | (o >>> (32 - s))) + b;
};
for (i = 0; i < r.length; i += 16) {
var _ = a,
S = b,
x = d,
dd = m;
(a = v(a, b, d, m, r[i + 0], 7, -680876936)),
(m = v(m, a, b, d, r[i + 1], 12, -389564586)),
(d = v(d, m, a, b, r[i + 2], 17, 606105819)),
(b = v(b, d, m, a, r[i + 3], 22, -1044525330)),
(a = v(a, b, d, m, r[i + 4], 7, -176418897)),
(m = v(m, a, b, d, r[i + 5], 12, 1200080426)),
(d = v(d, m, a, b, r[i + 6], 17, -1473231341)),
(b = v(b, d, m, a, r[i + 7], 22, -45705983)),
(a = v(a, b, d, m, r[i + 8], 7, 1770035416)),
(m = v(m, a, b, d, r[i + 9], 12, -1958414417)),
(d = v(d, m, a, b, r[i + 10], 17, -42063)),
(b = v(b, d, m, a, r[i + 11], 22, -1990404162)),
(a = v(a, b, d, m, r[i + 12], 7, 1804603682)),
(m = v(m, a, b, d, r[i + 13], 12, -40341101)),
(d = v(d, m, a, b, r[i + 14], 17, -1502002290)),
(a = y(
a,
(b = v(b, d, m, a, r[i + 15], 22, 1236535329)),
d,
m,
r[i + 1],
5,
-165796510
)),
(m = y(m, a, b, d, r[i + 6], 9, -1069501632)),
(d = y(d, m, a, b, r[i + 11], 14, 643717713)),
(b = y(b, d, m, a, r[i + 0], 20, -373897302)),
(a = y(a, b, d, m, r[i + 5], 5, -701558691)),
(m = y(m, a, b, d, r[i + 10], 9, 38016083)),
(d = y(d, m, a, b, r[i + 15], 14, -660478335)),
(b = y(b, d, m, a, r[i + 4], 20, -405537848)),
(a = y(a, b, d, m, r[i + 9], 5, 568446438)),
(m = y(m, a, b, d, r[i + 14], 9, -1019803690)),
(d = y(d, m, a, b, r[i + 3], 14, -187363961)),
(b = y(b, d, m, a, r[i + 8], 20, 1163531501)),
(a = y(a, b, d, m, r[i + 13], 5, -1444681467)),
(m = y(m, a, b, d, r[i + 2], 9, -51403784)),
(d = y(d, m, a, b, r[i + 7], 14, 1735328473)),
(a = w(
a,
(b = y(b, d, m, a, r[i + 12], 20, -1926607734)),
d,
m,
r[i + 5],
4,
-378558
)),
(m = w(m, a, b, d, r[i + 8], 11, -2022574463)),
(d = w(d, m, a, b, r[i + 11], 16, 1839030562)),
(b = w(b, d, m, a, r[i + 14], 23, -35309556)),
(a = w(a, b, d, m, r[i + 1], 4, -1530992060)),
(m = w(m, a, b, d, r[i + 4], 11, 1272893353)),
(d = w(d, m, a, b, r[i + 7], 16, -155497632)),
(b = w(b, d, m, a, r[i + 10], 23, -1094730640)),
(a = w(a, b, d, m, r[i + 13], 4, 681279174)),
(m = w(m, a, b, d, r[i + 0], 11, -358537222)),
(d = w(d, m, a, b, r[i + 3], 16, -722521979)),
(b = w(b, d, m, a, r[i + 6], 23, 76029189)),
(a = w(a, b, d, m, r[i + 9], 4, -640364487)),
(m = w(m, a, b, d, r[i + 12], 11, -421815835)),
(d = w(d, m, a, b, r[i + 15], 16, 530742520)),
(a = M(
a,
(b = w(b, d, m, a, r[i + 2], 23, -995338651)),
d,
m,
r[i + 0],
6,
-198630844
)),
(m = M(m, a, b, d, r[i + 7], 10, 1126891415)),
(d = M(d, m, a, b, r[i + 14], 15, -1416354905)),
(b = M(b, d, m, a, r[i + 5], 21, -57434055)),
(a = M(a, b, d, m, r[i + 12], 6, 1700485571)),
(m = M(m, a, b, d, r[i + 3], 10, -1894986606)),
(d = M(d, m, a, b, r[i + 10], 15, -1051523)),
(b = M(b, d, m, a, r[i + 1], 21, -2054922799)),
(a = M(a, b, d, m, r[i + 8], 6, 1873313359)),
(m = M(m, a, b, d, r[i + 15], 10, -30611744)),
(d = M(d, m, a, b, r[i + 6], 15, -1560198380)),
(b = M(b, d, m, a, r[i + 13], 21, 1309151649)),
(a = M(a, b, d, m, r[i + 4], 6, -145523070)),
(m = M(m, a, b, d, r[i + 11], 10, -1120210379)),
(d = M(d, m, a, b, r[i + 2], 15, 718787259)),
(b = M(b, d, m, a, r[i + 9], 21, -343485551)),
(a = (a + _) >>> 0),
(b = (b + S) >>> 0),
(d = (d + x) >>> 0),
(m = (m + dd) >>> 0);
}
return endian([a, b, d, m]);
}
function genera(t, b, time, e, g, r) {
var n =
'string' == typeof time
? time.split('')
: time
.toTimeString()
.split(/\s/)[0]
.split(':')
.flatMap(function(t) {
return t.split('');
}),
o = n,
h = o[0],
f = o[1],
c = o[2],
l = o[3],
d = ''
.concat(t, '-a-b')
.concat(b, '-c')
.concat(h)
.concat(f)
.concat(c)
.concat(l, '-d-e')
.concat(e, '-f-g')
.concat(g, '-h')
.concat(r, '-i');
key = (function(t) {
if (null == t) throw new Error('XXX Illegal argument' + t);
var r = wordsToBytes(z(t, e));
return e && e.asBytes
? r
: e && e.asString
? bytesToString(r)
: bytesToHex(r);
})(''.concat('17').concat(d));
console.log(
'https://thechoiceisyours.whatisthematrix.com/generated/v7/high/' +
key +
'.mp4'
);
console.log(key);
//console.log(d);
console.log(h, f, c, l);
}
/* ----------------- ENTER THE MATRIX ----------------- */
ora = '05';
minuto = '50';
pillola = 'red';
genera(pillola, b, ora + minuto, e, g, r);
/* ----------------- sid ----------------- */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment