Skip to content

Instantly share code, notes, and snippets.

View socram8888's full-sized avatar
🐲
Unprofessional lizardman

Marcos Del Sol Vives socram8888

🐲
Unprofessional lizardman
View GitHub Profile
@socram8888
socram8888 / rc4mi.py
Last active April 3, 2024 05:14 — forked from h3ku/rc4mi.py
Encryption and decryption tool for Xiaomi Mi Home's API
from base64 import b64decode, b64encode
import hashlib, argparse
def rc4mi(data, key):
S, j, out = bytearray(range(256)), 0, bytearray()
for i in range(256):
j = (j + key[i % len(key)] + S[i]) % 256
S[i], S[j] = S[j], S[i]