Skip to content

Instantly share code, notes, and snippets.

View atoponce's full-sized avatar
Crypto coffee

Aaron Toponce atoponce

Crypto coffee
View GitHub Profile
@atoponce
atoponce / gist:07d8d4c833873be2f68c34f9afc5a78a
Last active April 25, 2025 13:56 — forked from tqbf/gist:be58d2d39690c3b366ad
Cryptographic Best Practices

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@atoponce
atoponce / sha256-crypto.py
Last active April 17, 2025 00:56
Encryption and decryption with SHA-256
#!/usr/bin/python
import hashlib
nonce = 0
key = 'f3q4uszyt67cfatq'
pad = hashlib.sha256(str(nonce)+key).digest()
# encrypt
plaintext = 'the quick brown fox jumped over.'
@atoponce
atoponce / gist:4b495da9e3a876c44169
Last active February 21, 2016 18:31
My Vivint Wireless outages outside of my control
Uptime percentage: 99.91271
Account created 2015-12-12 12:00: http://ae7.st/s/w4tc6
- 104,940 minutes from 2015-12-12 12:00 to 2016-02-23 09:00
Outages:
240m: 2015-12-31 05:00 - 2015-12-31 09:00 (http://ae7.st/s/licq-)
600m: 2015-12-31 23:00 - 2016-01-01 09:00 (http://ae7.st/s/ic9lh)
600m: 2016-02-18 11:30 - 2016-02-18 21:30 (http://ae7.st/s/85hko)
7720m: 2016-02-18 00:20 - 2016-02-23 09:00 (http://ae7.st/s/ifgl4)
#!/bin/bash
HOME=/var/services/homes/backupchef
SNAPSHOT_DIR=$HOME/backups/myserver
LOG_DIR=$HOME/backups
KEY_ID=$HOME/.ssh/id_rsa
RM=/bin/rm;
MV=/bin/mv;
CP=/bin/cp;
$RM -rf $SNAPSHOT_DIR/daily.6;
#!/bin/bash
HOME=/var/services/homes/backupchef
SNAPSHOT_DIR=$HOME/backups/myserver
LOG_DIR=$HOME/backups
KEY_ID=$HOME/.ssh/id_rsa
RM=/bin/rm;
MV=/bin/mv;
CP=/bin/cp;
$RM -rf $SNAPSHOT_DIR/daily.6;
#!/bin/bash
HOME=/var/services/homes/backupchef
SNAPSHOT_DIR=$HOME/backups/myserver
LOG_DIR=$HOME/backups
KEY_ID=$HOME/.ssh/id_rsa
RM=/bin/rm;
MV=/bin/mv;
CP=/bin/cp;
$RM -rf $SNAPSHOT_DIR/daily.6;
### Keybase proof
I hereby claim:
* I am atoponce on github.
* I am atoponce (https://keybase.io/atoponce) on keybase.
* I have a public key whose fingerprint is E041 3539 273A 6534 A3E1 9259 22EE E048 8086 060F
To claim this, I am signing this object: