Skip to content

Instantly share code, notes, and snippets.

briansmith /
Created Nov 20, 2020
Bootstrap a working native aarch64-apple-darwin Rust toolchain
# "Bash Strict Mode with logging"
set -eux -o pipefail
case $(uname -p) in
briansmith /
Last active Dec 3, 2020
How to generate & use private keys using the OpenSSL command line tool

How to Generate & Use Private Keys using OpenSSL's Command Line Tool

These commands generate and use private keys in unencrypted binary (not Base64 “PEM”) PKCS#8 format. The PKCS#8 format is used here because it is the most interoperable format when dealing with software that isn't based on OpenSSL.

OpenSSL has a variety of commands that can be used to operate on private key files, some of which are specific to RSA (e.g. openssl rsa and openssl genrsa) or which have other limitations. Here we always use

View SECG-Curve-Seeds.txt
SECG 1.0:
ASCII "MinghuaQu"
1. secp112r1 00F50B028E|4D696E676875615175|290472783FB1
2. secp112r2 002757A111|4D696E676875615175|5316C05E0BD4
----| |
3. secp128r1 000E0D|4D696E676875615175|0CC03A4473D03679
View 2^((nBits `div` 2) - 100) apart
In[121]:= p = NextPrime[RandomInteger[{2^2047, 2^2048}]]
Out[121]= \
View example-crypto-bench-results.txt
Running target/release/crypto_bench_fastpbkdf2-33c7a66054d7f888
running 3 tests
test pbkdf2::hmac_sha1 ... bench: 18,086,881 ns/iter (+/- 192,553)
test pbkdf2::hmac_sha256 ... bench: 46,551,859 ns/iter (+/- 412,079)
test pbkdf2::hmac_sha512 ... bench: 59,626,892 ns/iter (+/- 2,230,720)
test result: ok. 0 passed; 0 failed; 0 ignored; 3 measured
Running target/release/crypto_bench_octavo-a3a92e776155ebd1
View onename
Verifying that +briansmith is my blockchain ID.
View multiplication.txt
Copyright 2015 Brian Smith.
One Way to do Multi-precision Multiplication
You can’t perform that action at this time.