Experimentation and research in cryptography.
Contains a number of experimental utilities for building cryptographic primitives and a few experimental implementations.
In particular the implementations, computation algorithms and tests could be useful to help improve understanding.
npm install @andybry/crypto-testing
shared/big-int: working with and converting to and from big ints
shared/bit: working with and converting to and from bits
shared/byte: working with and converting to and from bytes
shared/curve: elliptic curve implementation
shared/fp2: implementation of field of order p squared
shared/random: secure random generators
shared/secp256k1: parameters and associated elliptic curve implementation
shared/string: working with and converting to and from string representations of data
shared/zn: implementation of field of order p (or could be used for rings if n is not prime)
npm run des: implementation of the Data Encryption Standard (for 1 64-bit block)
npm run des:node: the same thing using nodes
cryptoAPI for comparison
npm run ecdsa: demonstrates the implentation of ECDSA using secp256k1
npm run ecdsa:vs-ethereum: compares local signing and recovery with the Ethereum version (from web3.js)