Skip to content

Instantly share code, notes, and snippets.

View jackvandrunen's full-sized avatar

Jack VanDrunen jackvandrunen

View GitHub Profile
@jackvandrunen
jackvandrunen / liquid.md
Last active July 14, 2018 00:38
Whitepaper on a technical implementation of a liquid (delegative) democratic system with a centrally-managed, append-only database.

Liquid Democracy

Following is a brief whitepaper on a technical implementation of a liquid (delegative) democratic system with a centrally-managed, append-only database.

Document Information/Revision History

The first version of this document was authored by Jacob VanDrunen on July 13, 2018.

The rights reserved for this document are those enumerated in the Detachable Public License.

Keybase proof

I hereby claim:

  • I am jackvandrunen on github.
  • I am jackv (https://keybase.io/jackv) on keybase.
  • I have a public key whose fingerprint is 6559 3C81 0258 FBFD 88CE 1DE0 58C0 33FA 62B7 9F60

To claim this, I am signing this object:

@jackvandrunen
jackvandrunen / encrypt.py
Created May 19, 2015 05:08
Unbreakable encryption.
def government_level_encryption(plaintext):
return "*" * len(plaintext)
if __name__ == '__main__':
print(government_level_encryption("hunter2"))
__author__ = 'Fortinbras'
import math
# Thought this might be a good idea
from random import randint, choice
def good_line(aX, aY, aDir,
@jackvandrunen
jackvandrunen / can.py
Created November 11, 2014 07:47
A simple but full-fledged web server in Python 2.7 for Bottle and Gevent. Site content goes in ./static/
from bottle import route, error, static_file, default_app
from gevent import wsgi
@route('/')
def serve_index():
return static_file('index.html', root='./static', mimetype='text/html')
@route('/raw/<filepath:path>')
def serve_raw(filepath):
@jackvandrunen
jackvandrunen / crysis.jpg
Created November 8, 2014 06:46
Can it run Crysis?
(10:42:38 PM) Locke: what should I use my craptop for?
(10:42:46 PM) Hobbes: hummmmm
(10:42:58 PM) Hobbes: playing Crysis?
(10:43:01 PM) Locke: lol
(10:43:03 PM) Locke: I don't have it
(10:43:28 PM) Hobbes: well then I guess you can't...*puts on sunglasses*...run Crysis!
(10:43:33 PM) Hobbes: yeaaaaaaaaah
(10:43:34 PM) Locke: wat.
(10:43:36 PM) Locke: no.
(10:43:37 PM) Locke: just no.
@jackvandrunen
jackvandrunen / shtream.py
Created July 31, 2013 20:20
A simple stream cipher that uses SHA-2 as its PRF. Because it has not seen real use yet, I can only theorize about security, but it is essentially a sponge function with a very large capacity and very small rate, which means that it should be very secure as long as the SHA-2 hash function (a government standard) remains secure.
from hashlib import sha512
from array import array
from binascii import hexlify, unhexlify
def encrypt(message, key, nonce=''):
key = sha512(key).digest()
nonce = sha512(nonce).digest()
stream = sha512(key + nonce).digest()
out = array('B')
@jackvandrunen
jackvandrunen / smallmodel.py
Created July 31, 2013 06:30
A stupid, inefficient, but flexible database engine.
'''A manager for SmallTable tables
Features many things needed to begin developing user driven applications with
the library'''
from smalltable import Table, load
class Model(Table):
'A container for a SmallTable table'
@jackvandrunen
jackvandrunen / sessions.py
Last active December 20, 2015 10:48
Persistent, PHP-like sessions for the Bottle microframework.
'''The unofficial Sessions addon for Bottle (bottlepy.org)
Made by Magnie Mozios and Falling Duck
License: MIT
Usage:
from sessions import start, destroy
@route('/')
@jackvandrunen
jackvandrunen / freeze.py
Created July 30, 2013 22:50
A password based key derivation function similar to others in the field, such as PBKDF2. Because it has not seen real use, I can only theorize about how secure it is. Increasing the number of iterations should increase security.
'''The PassFreeze algorithm is as follows:
1. 'hord' is generated by taking the sum of the ASCII values of all characters
in the password modulo 256
2. If there is no specified salt, generate a 128-bit random salt using a
cryptographically secure (P)RNG and skip to step 4
3. If there is a specified salt, decrypt it by XORing each of the 16 bytes of
the salt with 'hord'
4. Execute the following pseudocode ('.' denotes concatenation):