Skip to content

Instantly share code, notes, and snippets.

View suut's full-sized avatar
🔐

suut

🔐
View GitHub Profile
@suut
suut / 1_README.md
Created October 27, 2026 15:56
Thales SGP.32 eSIM management tool

eSIM tool

Dependency: pyscard

Usage: run ./eSIM.py to list IPAe support, active profiles and the EID.

Run ./eSIM.py enable ICCID to enable a profile, and ./eSIM.py disable ICCID to disable a profile.

You do not need to first disable a profile in order to enable a new one.

@suut
suut / setup-tpm2-fde.py
Created September 22, 2026 10:14
Setup TPM2+PIN full disk encryption with LUKS2 using systemd-cryptsetup
#!/usr/bin/env python3
import subprocess
import os
import sys
import yaml
import json
import hashlib
import argparse
import base64
@suut
suut / scp03.py
Created July 8, 2026 09:30
SCP-03 implementation with chaining quirk to support OpenFIPS201 v2.0.0
#!/usr/bin/env python
# coding: utf-8
from Crypto.Hash import CMAC
from Crypto.Cipher import AES
from enum import IntEnum
import struct
from smartcard.reader.Reader import Reader
from smartcard.CardConnection import CardConnection
import os
@suut
suut / 1_README.md
Created May 5, 2026 15:10
Parse JCOP 4 / 4.5 information

Usage:

gp -s "80CA00FE02DF28" | grep -Po '\[df28\] \K.*' | ./parse-jcop4-info.py
@suut
suut / 1_Blake2s.md
Last active May 1, 2026 17:24
JavaCard implementation of Blake2s
  • The card needs to have int support
  • The card needs to support the javacardx.framework.util.intx package
  • The input message is 32 bytes
  • The key is 32 bytes
  • The output message is 32 bytes
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
###########################################################################
# This is free and unencumbered software released into the public domain. #
# #
# Anyone is free to copy, modify, publish, use, compile, sell, or #
# distribute this software, either in source code form or as a compiled #
# binary, for any purpose, commercial or non-commercial, and by any #
# means. #
{% extends "base.html" %}
{% block body %}
<h1>{{ icon('shopping-cart') }} Produits</h1>
<dl class="sub-nav">
<dd class="active"><a href="/products/view">{{ icon('info') }} lister</a></dd>
<dd><a href="/products/add">{{ icon('fi-plus') }} ajouter</a></dd>
</dl>
<hr />
<div class="panel radius">
def split(txt, target):
# split according to \n in text
# split in 512 bytes (and be careful not to split in the middle of a UTF-8 control code)
final_text = []
for i in txt.split('\n'):
if len(i.encode())+11+len(target) >= 512:
s = i.encode()
splitted = []
cursor = 512-11-len(target)
while ''.join(j.decode() for j in splitted) != i:
#!/usr/bin/python3.3
#!/usr/bin/python3.3
# -*- coding: utf-8 -*-
from functions_core import Function
from core import ToSend
@Function('ping')
def ping(cmd, args, source, target):
return ToSend(target, 'pong')
#!/usr/bin/python3.3
# -*- coding: utf-8 -*-
# core.py
# Functions:
# [X] ToSend object
# [X] loading servers details
# [ ] loading servers config (in which is found username, etc.)
# [ ] logging to disk commands and status
# [ ] loading and providing configuration e.g. is_enabled()