Skip to content

Provides a collection of cryptography functions and a command line tool with interactive prompts to demonstrate key encryption flows and algorithms.

Notifications You must be signed in to change notification settings

SiegeSailor/OpenSource.Formulas

Repository files navigation

Formulas

Provides a collection of cryptography functions and a command line tool with interactive prompts to demonstrate key encryption flows and algorithms.

Prerequisites

See engines in package.json:

"engines": {
    "node": ">= 16.0.0",
    "npm": ">= 8.0.0"
},

Instructions

File structure:

├── images/
├── patches/
├── source/
│   ├── algorithms/
│   │   ├── baby-step-giant-step/
│   │   └── ...
│   ├── common/
│   │   ├── constants/
│   │   ├── utilities/
│   │   └── ...
│   ├── illustration/
│   │   ├── ElGamal.ts
│   │   └── ...
│   ├── types/
│   ├── command.ts
│   └── entry-point.ts
└── README.md

Use the following commands to help you to run or develop this project locally:

git clone https://github.com/SiegeSailor/formulas.git

Go to the folder you just created with git clone. It should be typically named formulas:

cd formulas

Install all the packages you need. Remember that you have to run this under node >= 16.0.0 and npm >= 8.0.0. You can simply use nvm use 16 if you have multiple versions on your local machine:

npm install

Then you are able to run the command-line tool with:

npm run start

Command Start

Start

This command-line tool allows you to either demonstrate encryption flow or execute algorithms with the inputs from you. Here is an example of RSA:

Demonstrate RSA

Executing Euclidean algorithm with your own inputs:

Execute Euclidean

Test

Formulas uses Jest for unit tests purpose. You can generate the coverage report:

npm run test -- --coverage

Test Coverage

Or see the detail for each test case:

npm run test -- --verbose

Test Verbose

Issues

Jest has an issue working with the type bigint in multiple test files, which is widely used for algorithms in this project. In order to solve it, the property has been set in jest.config.js. Unfortunately, this setup will drag down some performance during testing:

module.exports = {
    ...
    maxWorkers: 1,
};

Algorithms

Available mathematic algorithm implantation:

Encryption Flows

Demonstrable command-line based encryption flow with three parties involved:

About

Provides a collection of cryptography functions and a command line tool with interactive prompts to demonstrate key encryption flows and algorithms.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published