Skip to content

Instantly share code, notes, and snippets.

View luk0y's full-sized avatar
🎯
Focusing

luk0y luk0y

🎯
Focusing
View GitHub Profile
Andhra Pradesh
Arunachal Pradesh
Assam
Bihar
Chhattisgarh
Goa
Gujarat
Haryana
Himachal Pradesh
Jammu and Kashmir
@luk0y
luk0y / gen-rsa-pubkey.sh
Created November 10, 2020 06:23 — forked from icetan/gen-rsa-pubkey.sh
Create a public RSA key from modulus and exponent on the command line
#!/bin/bash
set -e
b2hex() { echo -n $1|base64 --decode | xxd -p -u | tr -d \\n; }
modulus=$(b2hex u2/nlDLMbqLY+XBnWlqHv74a/wvmPoefKv+5NkTU0sbQAEMN7Gar9Hgp50uMUQhiOhwO6L4hezrY021etPyh2Q==)
exponent=$(b2hex AQAB)
asn1conf=$(echo -e "asn1=SEQUENCE:pubkeyinfo\n[pubkeyinfo]\nalgorithm=SEQUENCE:rsa_alg\npubkey=BITWRAP,SEQUENCE:rsapubkey\n[rsa_alg]\nalgorithm=OID:rsaEncryption\nparameter=NULL\n[rsapubkey]\nn=INTEGER:0x$modulus\ne=INTEGER:0x$exponent" | openssl asn1parse -genconf /dev/stdin -noout -out /dev/stdout | base64)
@luk0y
luk0y / example_image_utils.py
Created September 30, 2020 13:47 — forked from josephkern/example_image_utils.py
Layer on top of Python Imaging Library (PIL) to write text in images easily
#!/usr/bin/env python
# coding: utf-8
# You need PIL <http://www.pythonware.com/products/pil/> to run this script
# Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use
# any TTF you have)
# Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com]
# License: GPL <http://www.gnu.org/copyleft/gpl.html>
from image_utils import ImageText