Skip to content

Instantly share code, notes, and snippets.

# https://www.reddit.com/r/thethirdcave/
import secrets
import hashlib
quotes = []
init_salt = "?".encode()
salt = init_salt
@shakna-israel
shakna-israel / Prose.md
Last active November 15, 2023 22:06
Obfuscating Python

Obfuscating Python

Obfuscation isn't difficult in most programming languages. It's why we have "good practices" because it is so easy to hide what you mean in badly written code.

Obfuscation tends to be even easier in dynamic languages because of how forgiving they tend to be - and because they tend to give you direct access to the environment so that you can manipulate it.

Today, for fun, I'm going to obfuscate this code:

def _(n):

if n <= 0:

@shakna-israel
shakna-israel / Prose.md
Created October 23, 2019 23:32
Obfuscating Lua

Obfuscating Lua

I've had some fun ruining Python recently, but Python is what I use at work. I prefer to use other languages when I'm doing stuff for fun.

And obfuscation only really makes sense in fun and competition - given a suffeciently determined actor, your code will be reverse engineered. Unless you write it in Malboge.

For this particular experiment, I'll be using Lua 5.3. As I'll probably need to dive into some of the less portable functions to commit our atrocities, I can't guarantee it will run on other popular versions like Luajit or 5.1.


..--- ..-. / ...-- ----. / -.... .- / ..--- ..-. / ...-- ....- / ....- .---- / ....- .---- / ..... .---- / ..... ...-- / -.... -... / ..... .- / ....- .- / ..... ..--- / -.... --... / ....- .---- / ....- ..--- / ....- .---- / ..... .---- / ....- ..... / ....- .---- / ..... ...-- / ....- .---- / ....- ..--- / ....- ----. / ....- .---- / ....- .---- / ....- ....- / ..--- ..-. / ...-- ..--- / --... --... / ....- ..--- / ....- ....- / ....- .---- / ....- .---- / ....- -.. / ....- ...-- / ....- .---- / -.... --... / ....- -.. / ....- ...-- / ....- .---- / -.... --... / ....- -.. / ....- ....- / ....- .---- / --... --... / ....- -.. / ....- ..... / ....- .---- / --... --... / ....- -.. / ....- ..... / ....- ..--- / ..... .---- / -.... --... / ....- -.... / ....- ..--- / ..... .---- / ..... .---- / ....- ..... / ....- ..--- / ..... .---- / -.... ..-. / ....- ---.. / ....- ..--- / --... --... / ..... ----. / ....- ----. / ....- ....- / ....- .---- / -.... ..-. / ....- -.. / ....- ....- / ....- .---- / --... ...-- / .
@shakna-israel
shakna-israel / LetsDestroyC.md
Created January 30, 2020 03:50
Let's Destroy C

Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?