Skip to content

Instantly share code, notes, and snippets.

@gz-c
gz-c / viper.go
Last active July 24, 2019 07:09
SublimeText GoSublime GoImports issue
package skycoin
import (
"fmt"
"log"
"path/filepath"
"strings"
"github.com/skycoin/skycoin/src/api"
"github.com/skycoin/skycoin/src/cipher/bip44"
@gz-c
gz-c / gist:bf70ce96b2488e5ccca65900086c75f5
Created March 1, 2019 04:08
Hal Finney efficiently computable endomorphism parameters secp256k1
Source: https://bitcointalk.org/index.php?topic=3238.msg45565#msg45565
Hal Finney's explanation of secp256k1 "efficiently computable endomorphism" parameters used secp256k1 libraries, archived:
I implemented an optimized ECDSA verify for the secp256k1 curve used by Bitcoin, based on pages 125-129 of the Guide to Elliptic Curve Cryptography, by Hankerson, Menezes and Vanstone. I own the book but I also found a PDF on a Russian site which is more convenient.
secp256k1 uses the following prime for its x and y coordinates:
p = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f
package main
import (
"encoding/hex"
"fmt"
"github.com/skycoin/skycoin/src/cipher"
"github.com/skycoin/skycoin/src/cipher/base58"
)

Symmetric Encryption

The only way to encrypt today is authenticated encryption, or "AEAD". ChaCha20-Poly1305 is faster in software than AES-GCM. AES-GCM will be faster than ChaCha20-Poly1305 with AES-NI. Poly1305 is also easier than GCM for library designers to implement safely. AES-GCM is the industry standard.

Use, in order of preference:

  1. The NaCl/libsodium default

Keybase proof

I hereby claim:

  • I am gz-c on github.
  • I am gzc (https://keybase.io/gzc) on keybase.
  • I have a public key whose fingerprint is 10A7 22B7 6F2F FE7B D238 0222 5801 631B D27C 7874

To claim this, I am signing this object:

@gz-c
gz-c / how-to-pgp-release.md
Created March 19, 2018 16:24 — forked from cyphar/how-to-pgp-release.md
Document describing how to create PGP-signed releases of projects.

Creating Releases with PGP Signatures

Aleksa Sarai

Creating a release of a free software project with PGP signatures is quite simple, especially if you have everything set up already. This guide uses GnuPG, but it should be roughly applicable to OpenPGP or other implementations. For completeness, I've included a (very) short introduction to how to create a PGP key and how PGP works.

Introduction