Skip to content

Instantly share code, notes, and snippets.

View CameronLonsdale's full-sized avatar
💿
Hyper Beam

Cameron Lonsdale CameronLonsdale

💿
Hyper Beam
View GitHub Profile
@CameronLonsdale
CameronLonsdale / enterprise_grade_encryption.py
Created April 17, 2018 04:56
Exploit the block cipher more to recover the secret
#!/usr/bin/env python
from Crypto.Cipher import AES
from binascii import hexlify
from base64 import b64decode
KEY = b64decode("WUVMTE9XIFNVQk1BUklORQ==")
cipher = AES.new(KEY, AES.MODE_ECB)
@CameronLonsdale
CameronLonsdale / data
Created April 17, 2018 01:27
Find the ECB encrypted data
0b2e71329e3c0a04060d89e159492a584f05095a5b016508c57690c2b79cf29d7316ab606c67cfd7befd410bad993f05ea5250d06cdea5ff642024938c75832fa58f96a1a761a7d3345f740f76115446caab9bf8cd221332b136b3b7a22d3482cc33e2ed01a9a6831c3aac3207eb5e0d
61e553a93b30afe90c5be2b7dc343cb002972b572a038e431f3f565604d3585b8f74337b7e9b6f581f1410995bf25027e8a7c0125506f112d906920504fc4599e81dc02215e4f29ecdb329efd3229307b9553f2dd721be995e261012c1bf23339b2f451bbc573d771e435fe05c90f5f5
fd2555400aa665c2f2189520165e7253a13faf39ef6c78f33a5434f13a0478fddd8f7a45f9b304ed29a66e46eb7ce05ea0d9a1f68ff1b6b55436f67be042c09f540028ec9ded341ac4ab5331db61330f702d04f3c7a79d5490f074c28b844b5c862a5b1ad737d9a701b42b96fc9094c7
a173ffbcdff4c52523624df3de9342fa48cd5d2226cab49ad137e1fbdff650b107f11d9905577084962c97069118d2e6a9901f10b44be4d054c335e25a5e685687e29bc1de7ca9429778ff682b2c449d4af59fb7cfc2812bdc5b76c3f471ee71
e24e104808077aaa6df3a180361a53c182c47f7db5f5d777a1068f21d4b000a296c0d76f64c3b453f5d5a01533c35f1a067862af6ed07e72aa55902460d5ddb9d8fc4de74a48f5c0e917821abda5
@CameronLonsdale
CameronLonsdale / simple_aes8.java
Created April 16, 2018 06:23
8 bit block AES - Brute force attack
/*
* 8-bit AES cipher.
*
* (C) Peter Breuer 2013 (ptb@inv.it.uc3m.es) for any parts I’ve written
* myself, the whole of this source having been created by reverse
* engineering some unattributed fragments of C for larger block AES which I
* found publicly available on the web via Google with no licence or author
* named inside (or anywhere around, under, over, etc) those sources.
*
* For the record those sources were
@CameronLonsdale
CameronLonsdale / simple_aes8.java
Last active April 16, 2018 06:31
8 bit block AES - Codebook Attack
/*
* 8-bit AES cipher.
*
* (C) Peter Breuer 2013 (ptb@inv.it.uc3m.es) for any parts I’ve written
* myself, the whole of this source having been created by reverse
* engineering some unattributed fragments of C for larger block AES which I
* found publicly available on the web via Google with no licence or author
* named inside (or anywhere around, under, over, etc) those sources.
*
* For the record those sources were
#!/usr/bin/env python
from PIL import Image
from Crypto.Cipher import AES
KEY = "YELLOW SUBMARINE"
INPUT = "logo.png"
OUTPUT = "encrypted.png"
@CameronLonsdale
CameronLonsdale / birthday.basic
Created December 4, 2017 07:24
Happy Birthday Basic
100 print chr$(147); chr$(154)
101 read s : if s = 0 goto 109
102 read s$ : gosub 1000
103 read x1, y1, x2, y2, x3, y3
104 goto 101
109 restore : print chr$(19); chr$(5);
110 l1 = 54272 : l2 = 54279: l3 = 54286
120 h1 = l1 + 1 : h2 = l2 + 1 : h3 = l3 + 1
130 v1 = l1 + 4 : v2 = l2 + 4 : v3 = l3 + 4
140 poke 54296, 15
@CameronLonsdale
CameronLonsdale / detect.py
Last active October 17, 2017 12:48
Reverse Engineering ROCA Key fingerprinting
# Taken (and commented, a lot) from https://github.com/crocs-muni/roca/blob/master/roca/detect.py
# The name of the paper`The Return of Coppersmith's Attack: Practical Factorization of Widely Used RSA Moduli`
# Hints that the Coppersmith atttack will come into play. The Coppersmith attack is a class of attacks
# based on the Coppersmith method (https://en.wikipedia.org/wiki/Coppersmith_method).
# From my limited understanding, it uses complex maths to factorize the modulus given already known information
# about one of the prime factors.
# From deduction, it seems like this fingerprinting function is to determine whether or not the required information
# from one prime factor can be deduced, and hence determining if the modulus is vulnerable to the coppersmith attakck
#!/usr/bin/python3
"""
MD2 Message Digest Algorithm.
Implemented by Cameron Lonsdale to the spec of RFC 1319.
"""
import binascii
# Permutation of 0..255 constructed from the digits of pi.
@CameronLonsdale
CameronLonsdale / periodic_substitution_solver.py
Last active July 1, 2017 00:09
Automatically solve a Periodic Substitution Cipher
"""Automatically solve a Periodic Substitution Cipher"""
import random
import string
import lantern
from lantern import fitness
from lantern.analysis.search import hill_climb
from lantern.modules import simplesubstitution, vigenere

Keybase proof

I hereby claim:

  • I am CameronLonsdale on github.
  • I am clonsdale (https://keybase.io/clonsdale) on keybase.
  • I have a public key whose fingerprint is F082 6983 C6E0 05BD 7291 10BD C561 BE60 65E7 CD5C

To claim this, I am signing this object: