Skip to content

Instantly share code, notes, and snippets.

View ace0's full-sized avatar
💭
hacking.hacking.hacking.

ace ace0

💭
hacking.hacking.hacking.
View GitHub Profile
@ace0
ace0 / BLS_Signature.md
Last active April 27, 2020 15:39
BLS Signature for Busy People

BLS Signature for Busy People

Summary

  • BLS stands for

    • Barreto-Lynn-Scott: BLS12, a Pairing Friendly Elliptic Curve.
    • Boneh-Lynn-Shacham: A Signature Scheme.
  • Signature Aggregation

  • It is possible to verify n aggregate signatures on the same message with just 2 pairings instead of n+1.

#!/usr/bin/env python3
'''
Simple vimgolf that downloads challenges at random and compares output
to the expected output.
'''
import feedparser, filecmp, requests, random, subprocess, tempfile
def main():
# Select a challenge link from the challenges feed at random
"""
Symmetric encryption tool
"""
from base64 import b64encode
import sys
def main():
usage = "Usage: {sys.argv[0]} [test | encrypt | decrypt | crack]"
# If no argument, print the command usage

Cryptopuzzle

We're going to build a simple symmetric encryption scheme using the XOR function. And then we'll show how to break this encryption scheme.

This puzzle is heavily influenced by this: https://cryptopals.com/sets/1/challenges/1

If you like this puzzle, see that set of puzzles which goes much deeper

@ace0
ace0 / hybridenc.py
Created February 26, 2018 21:54
Demonstrates hybrid encryption, using symmetric encryption and public key encryption (AES-GCM + RSA).
"""
Demonstrates hybrid encryption (AES-GCM + RSA): encrypts a message
under a public key and that can only be recovered using the corresponding
secret key.
Requires: Python 2; pycryptodomex
"""
from Crypto.Cipher import AES, PKCS1_OAEP
from Crypto.PublicKey import RSA
from Crypto.Random import get_random_bytes
"""
Quickly find paths to keys or values deeply embedded in complex structures of JSON.
Written in python 3.
Example:
sampleStructure = {
'AmiLaunchIndex': 0,
'Monitoring': {