Skip to content

Instantly share code, notes, and snippets.

View honzajde's full-sized avatar
🏠
Working from home

honza honzajde

🏠
Working from home
View GitHub Profile

PKI for busy people

Public-key infrastructure (PKI) is an umbrella term for everything that has to do with keys and certificates.

This is a quick overview of the important stuff.

Public-key cryptography

Public-key cryptography involves a key pair: a public key and a private key. Each entity has their own. The public key can be shared around, the private key is secret.

@Dexaran
Dexaran / ERC20_token_standard_vulnerability_classification.md
Last active June 22, 2024 22:51
ERC20 token standard vulnerability classification.

Previously described at: ERC20 critical problems medium article.

Description.

ERC20 is the most common Ethereum token standard. It should be noted that it is also the first Ethereum's token standard as well.

It is also important that the original ERC20 proposal is a definition of token interface. EIP20 does not define a reference implementation for this token standard. Here is OpenZeppelin implementation of ERC20 token: https://github.com/OpenZeppelin/zeppelin-solidity/tree/master/contracts/token/ERC20

ERC20 token standard implementation assumes two ways of token transferring: (1) transfer function and (2) approve + transferFrom pattern.

@abraithwaite
abraithwaite / config.go
Created March 15, 2017 03:03
Awesome way to do configuration in go. Taken from https://github.com/influxdata/telegraf
package main
import (
"io/ioutil"
"log"
"github.com/naoina/toml"
"github.com/naoina/toml/ast"
)
@mark-kubacki
mark-kubacki / get-video.sh
Last active October 6, 2016 19:26
gets videos from the internet and stores them as MKV
#!/bin/bash
#
# Gets videos, for example from YouTube, as best-quality separate tracks
# and stitches them, video by video, into a MKV – avoiding excess clutter files.
#
# wrapper to: mkvtoolnix youtube-dl iconv jq file
#
# author: W-Mark Kubacki <wmark@hurrikane.de>
set -e -o pipefail
@jonhoo
jonhoo / README.md
Last active July 19, 2021 10:49
Distributed RWMutex in Go
@denji
denji / golang-tls.md
Last active July 1, 2024 05:41 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@mark-kubacki
mark-kubacki / create-all.sh
Last active September 21, 2023 07:50
a dummy Certificate Authority for development and testing
#!/bin/bash
#
# Copyright (c) 2015 W. Mark Kubacki <wmark@hurrikane.de>
# Licensed under the terms of the RPL 1.5 for all usages
# http://www.opensource.org/licenses/rpl1.5
#
set -e -o pipefail
CAsubj="/C=DE/ST=Niedersachsen/L=Hannover/O=Dummy CA/CN=Sign-It-All"
@stefanotorresi
stefanotorresi / FormDirectiveAutofillDecorator.js
Last active August 24, 2016 20:50
angular form directive decorator to fix Safari autofill bug
use 'strict';
/**
* workaround for: https://github.com/angular/angular.js/issues/1460
* source: http://victorblog.com/2014/01/12/fixing-autocomplete-autofill-on-angularjs-form-submit/
* decoration tips: http://angular-tips.com/blog/2013/09/experiment-decorating-directives/
* credits: https://github.com/evictor
*
* note: this directive only fixes the behaviour on form submit event,
* it doesn't fix the bidirectional data binding
@michaljemala
michaljemala / tls-client.go
Last active July 18, 2024 11:40
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)
@danmactough
danmactough / comment.md
Created December 31, 2013 00:22
Isaac's description of process.nextTick vs. setImmediate

I agree the point you’re making here, 100%. However, a slight correction about Node’s APIs.

First of all, process.nextTick is actually first in, first out. Proof:

$ node -e 'process.nextTick(console.log.bind(console, 1)); process.nextTick(console.log.bind(console, 2))'
1
2