Skip to content

Instantly share code, notes, and snippets.

View cmdruid's full-sized avatar
💭
Looking to contribute

cmd cmdruid

💭
Looking to contribute
  • Freelance
  • Austin, TX
  • 10:00 (UTC -06:00)
View GitHub Profile
@johnzweng
johnzweng / SEC_2_Prime_order_koblitz_curves_generators_mystery.sage
Last active October 17, 2024 16:48
The mystery of the generation points of the secpXXXk1 curves.. :)
# The mystery around secpxxxk1 generation points :)
# -------------------------------------------------
#
# The SEC 2 familiy of elliptic curves are defined in https://www.secg.org/sec2-v2.pdf
# and widely used in cryptography.
#
# The generation points G of these curves are defined in the standard paper without any nearer
# explanation how they were chosen. Interestingly the generation points (G) of all prime order
# koblitz curves of the SEC 2 family (secp160k1, secp192k1, secp224k1, secp256k1) share some
# unusual mysterious property.
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active November 4, 2024 07:33
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@nakov
nakov / secp256k1-example.js
Last active April 9, 2024 16:32
ECDSA in JavaScript: secp256k1-based sign / verify / recoverPubKey
let elliptic = require('elliptic');
let sha3 = require('js-sha3');
let ec = new elliptic.ec('secp256k1');
// let keyPair = ec.genKeyPair();
let keyPair = ec.keyFromPrivate("97ddae0f3a25b92268175400149d65d6887b9cefaf28ea2c078e05cdc15a3c0a");
let privKey = keyPair.getPrivate("hex");
let pubKey = keyPair.getPublic();
console.log(`Private key: ${privKey}`);
console.log("Public key :", pubKey.encode("hex").substr(2));