Skip to content

Instantly share code, notes, and snippets.

View jack-om's full-sized avatar

Jack Sullivan jack-om

View GitHub Profile
@jack-om
jack-om / pubkey-file-encryption.sh
Last active April 21, 2024 10:39
Demo of public key file encryption using the openssl CLI
#!/bin/bash
#
# This demonstrates using the `openssl` CLI to encrypt and decrypt data with
# public-key cryptography (RSA), to share data across an untrusted communication
# medium.
#
# Public keys that are used to encrypt cannot be used to decrypt, so they can
# be shared freely ("public" keys).
#
# Private keys that can decrypt data are never shared, so the data cannot be
@jack-om
jack-om / quantify-loc.sh
Created September 10, 2020 22:13
Quantify lines of code in a directory of git repositories.
#!/bin/bash
###########################################################
#
# Quantify a directory of git repos by measuring LoC.
# Generates report for each repo, and an aggregate report.
#
###########################################################
REPORT_DIR="_report_cloc_$(date +'%Y%m%d%H%M')"
@jack-om
jack-om / lxml-xxe.py
Created December 18, 2019 00:42
Explain, demonstrate, and mitigate XXE in the Python XML library lxml.
#!/usr/bin/env python3
"""
lxml and XXE vulnerabilities: explanation, examples, and recommendation.
Requirements:
- lxml == 4.4.1
Contents: