diff --git a/.github/workflows/deploy-npm.yml b/.github/workflows/deploy-npm.yml new file mode 100644 index 0000000..420f2b7 --- /dev/null +++ b/.github/workflows/deploy-npm.yml @@ -0,0 +1,51 @@ +name: Deploy to npm + +on: + push: + branches: + - master + +jobs: + publish-npm: + runs-on: ubuntu-latest + + steps: + # Checkout the repository + - name: Checkout repository + uses: actions/checkout@v3 + + # Set up Node.js environment + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + registry-url: 'https://registry.npmjs.org/' + + # Install dependencies + - name: Install dependencies + run: npm install + + # Get the short hash of the last commit + - name: Get short commit hash + id: get_hash + run: echo "HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + + # Update the version in package.json + - name: Update version + run: | + VERSION="0.0.1-alpha.$HASH" + jq --arg ver "$VERSION" '.version = $ver' package.json > tmp.json && mv tmp.json package.json + + # Build the package + - name: Build package + run: npm run build + + # Run tests + - name: Run tests + run: npm test + + # Publish to npm + - name: Publish to npm + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm publish diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..4b2c1ce --- /dev/null +++ b/.npmignore @@ -0,0 +1,31 @@ +# Ignore the following common files and directories: + +# Node.js modules +node_modules/ + +# Ignore development files and directories +dist/ # Exclude the build output directory (if not needed) +src/ # Exclude the source files (if only publishing dist) + +# Ignore common configuration files +.eslintignore # ESLint ignore file +.eslintrc # ESLint config file +.babelrc # Babel config file +.npmrc # npm config file +.vscode/ # VS Code settings folder +.git/ # Git version control directory + +# Ignore testing files and directories +tests/ # Exclude any test directories +test/ # Exclude any test directories +**/*.test.js # Ignore all test files with .test.js extension + +# Ignore other common files +*.log # Ignore log files +*.tmp # Ignore temporary files +*.lock # Ignore lock files (except package-lock.json if you want to keep it) +webpack.config.js # Ignore Webpack config (if not needed) +README.md # You might want to include this for documentation + +# Ignore specific folders and files as needed +app/ # Exclude the app directory \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..c1893f8 --- /dev/null +++ b/README.md @@ -0,0 +1,373 @@ +# ecutils + +**JavaScript Library for Elliptic Curve Cryptography** + +`ecutils` is a JavaScript library designed for implementing Elliptic Curve Cryptography (ECC) algorithms, including key exchanges (Diffie-Hellman, Massey-Omura), ECDSA signatures, and Koblitz encoding. This library is suitable for educational purposes in cryptography and for use in secure systems. + +## Features + +- ECDSA signatures +- Key exchange protocols (Diffie-Hellman and Massey-Omura) +- Koblitz encoding +- Support for elliptic curve operations + +## Table of Contents + +- [Installation](#installation) +- [Usage](#usage) +- [API Documentation](#api-documentation) +- [Examples](#examples) +- [Contributing](#contributing) +- [License](#license) + +## Installation + +To install `ecutils`, you can use npm: + +```bash +npm install ecutils +``` + +## Usage + +After installing, you can import the library into your JavaScript project: + +```javascript +const { core: { Point, EllipticCurve } } = require('ecutils'); + +// Example parameters +let p = 23n; // The prime number defining the finite field's order +let a = 1n; // The 'a' coefficient in the curve equation +let b = 1n; // The 'b' coefficient in the curve equation +let G = new Point(0n, 1n); +let n = 28n; +let h = 1n; + +const curve = new EllipticCurve(p=p, a=a, b=b, G=G, n=n, h=h); + +// Define points on the curve +const point1 = new Point(6n, 19n); +const point2 = new Point(3n, 13n); + +// Add the points +const sum_point = curve.add_points(point1, point2); +console.log(`The sum of the points is (${sum_point.x}, ${sum_point.y}).`); +``` + +## API Documentation + +### Classes and Methods + +#### Class: `DigitalSignature` + +##### Constructor +- **`new DigitalSignature(private_key, curve_name = 'secp192k1')`** + - Creates a new instance of the `DigitalSignature` class for performing ECDSA (Elliptic Curve Digital Signature Algorithm) operations. + - **Parameters**: + - `private_key`: The private key used for generating a signature. + - `curve_name`: (Optional) The name of the elliptic curve to use. Defaults to `'secp192k1'`. + +##### Methods + +- **`generate_signature(message_hash)`** + - Generates an ECDSA signature for a given message hash using the private key. + - **Parameters**: + - `message_hash`: The hash of the message to be signed. + - **Returns**: An array with two integers `[r, s]` representing the signature. + +- **`verify_signature(public_key, message_hash, r, s)`** + - Verifies the authenticity of an ECDSA signature. + - **Parameters**: + - `public_key`: The public key corresponding to the private key of the signer. + - `message_hash`: The hash of the message that was signed. + - `r`: The first component (r) of the signature. + - `s`: The second component (s) of the signature. + - **Returns**: `true` if the signature is valid, `false` otherwise. + +##### Attributes + +- **`curve`**: Lazily retrieves the elliptic curve associated with the signature scheme based on the `curve_name`. + +- **`public_key`**: Computes and returns the public key from the private key. + +--- + +#### Class: `Koblitz` + +##### Constructor + +- **`new Koblitz(curve_name = 'secp521r1')`** + - Creates a new instance of the `Koblitz` encoding/decoding class. + - **Parameters**: + - `curve_name`: (Optional) The name of the elliptic curve. Defaults to `'secp521r1'`. + +##### Methods + +- **`encode(message, alphabet_size = 256n)`** + - Encodes a textual message into a point on the elliptic curve using the Koblitz method. + - **Parameters**: + - `message`: The message to encode. + - `alphabet_size`: (Optional) The size of the alphabet. Defaults to `256n`. + - **Returns**: A tuple `[Point, j]` where `Point` is the encoded curve point and `j` is an auxiliary value. + +- **`decode(point, j, alphabet_size = 256n)`** + - Decodes a point on the elliptic curve back into a textual message. + - **Parameters**: + - `point`: The `Point` on the elliptic curve that represents the encoded message. + - `j`: The auxiliary value `j` used in encoding. + - `alphabet_size`: (Optional) The size of the alphabet. Defaults to `256n`. + - **Returns**: The decoded message as a string. + +- **`serialize(points)`** + - Serializes points and the corresponding `j` values into a JSON-friendly format. + - **Parameters**: + - `points`: An array of tuples `[Point, j]` where `Point` is the encoded curve point. + - **Returns**: An array of objects in the format `{x, y, j}` representing the serialized points. + +- **`deserialize(serializedPoints)`** + - Deserializes the JSON format back to an array of tuples `[Point, j]`. + - **Parameters**: + - `serializedPoints`: An array of objects `{x, y, j}`. + - **Returns**: An array of tuples `[Point, j]`. + +##### Attributes + +- **`curve`**: Lazily retrieves the elliptic curve for message encoding/decoding. + +--- + +#### Class: `DiffieHellman` + +##### Constructor + +- **`new DiffieHellman(private_key, curve_name = 'secp192k1')`** + - Creates an instance of the `DiffieHellman` class for performing Diffie-Hellman key exchange using elliptic curves. + - **Parameters**: + - `private_key`: The private key to use during the key exchange. + - `curve_name`: (Optional) The name of the elliptic curve. Defaults to `'secp192k1'`. + +##### Methods + +- **`compute_shared_secret(other_public_key)`** + - Computes the shared secret using the private key and the other party's public key. + - **Parameters**: + - `other_public_key`: The other party's public key (as a `Point`). + - **Returns**: A point representing the shared secret on the elliptic curve. + +##### Attributes + +- **`curve`**: Retrieves the elliptic curve associated with the Diffie-Hellman exchange. + +- **`public_key`**: Computes the Diffie-Hellman public key from the private key. + +--- + +#### Class: `MasseyOmura` + +##### Constructor + +- **`new MasseyOmura(private_key, curve_name = 'secp192k1')`** + - Creates an instance of the `MasseyOmura` class for performing Massey-Omura key exchange using elliptic curves. + - **Parameters**: + - `private_key`: The private key to use during the key exchange. + - `curve_name`: (Optional) The name of the elliptic curve. Defaults to `'secp192k1'`. + +##### Methods + +- **`first_encryption_step(message)`** + - Encrypts a message with the sender's private key. + - **Parameters**: + - `message`: The message (as a point) to encrypt. + - **Returns**: The encrypted message (as a `Point`). + +- **`second_encryption_step(encrypted_message)`** + - Applies the receiver's private key to complete encryption steps. Used in the key exchange process. + - **Parameters**: + - `encrypted_message`: The encrypted message (as a `Point`). + - **Returns**: The resulting encrypted message. + +- **`partial_decryption_step(encrypted_message)`** + - Partially decrypts a message using the inverse of the sender's private key. + - **Parameters**: + - `encrypted_message`: The encrypted message (as a `Point`). + - **Returns**: The decrypted message (as a `Point`). + +##### Attributes + +- **`curve`**: Retrieves the elliptic curve associated with the Massey-Omura exchange. + +- **`public_key`**: Computes and returns the Massey-Omura public key from the private key. + +--- + +#### Class: `EllipticCurve` + +- **This is an internal class representing an elliptic curve and offering operations on points and scalar multiplications.** + +##### Constructor + +- **`new EllipticCurve(p, a, b, G, n, h)`** + - Initializes an elliptic curve instance. + - **Parameters**: + - `p`: The prime modulus of the field. + - `a`: The `'a'` coefficient of the curve equation. + - `b`: The `'b'` coefficient of the curve equation. + - `G`: The base point (generator) on the curve. + - `n`: The order of the base point. + - `h`: The cofactor of the curve. + +##### Methods + +- **`add_points(P, Q)`** + - Adds two points `P` and `Q` on the elliptic curve. + - **Parameters**: + - `P`: The first point. + - `Q`: The second point. + - **Returns**: The resulting point `R = P + Q`. + +- **`multiply_point(k, P)`** + - Multiplies a point `P` with a scalar `k`. + - **Parameters**: + - `k`: Scalar (integer) to multiply. + - `P`: The point to be multiplied. + - **Returns**: Point `kP`. + +- **`is_point_on_curve(p)`** + - Verifies if a point is on the elliptic curve. + - **Parameters**: + - `p`: The point to evaluate. + - **Returns**: `true` if the point is on the curve, otherwise `false`. + +--- + +## Examples + +Here are some examples of using the key exchange protocols and other features of `ecutils`. + +### Encoding and Decoding Messages with Koblitz + +```js +const { algorithms: { Koblitz } } = require('ecutils'); + +// Initialize Koblitz with a specific curve +const koblitz = new Koblitz('secp521r1'); + +// Encode a message to a curve point +const [point, j] = koblitz.encode('Hello, EC!', 2n ** 8n); + +// Decode the curve point back to a message +const decoded_message = koblitz.decode(point, j, 2n ** 8n); + +console.log(decoded_message); +``` + +### Digital Signatures with ECDSA + +```js +const { algorithms: { DigitalSignature } } = require('ecutils'); + +// Create a DigitalSignature instance with your private key +const privateKey = BigInt(123456); +const ds = new DigitalSignature(privateKey); + +// Hash of your message +const messageHash = BigInt(545454445644654n); + +// Generate signature +const [r, s] = ds.generate_signature(messageHash); + +// Verify signature (typically on the receiver's side) +const isValid = ds.verify_signature(ds.public_key, messageHash, r, s); + +console.log(`Is the signature valid? ${isValid}`); +``` + +### Diffie-Hellman Key Exchange + +```js +const { protocols: { DiffieHellman } } = require('ecutils'); + +// Alice's side +const alice = new DiffieHellman(12345n); + +// Bob's side +const bob = new DiffieHellman(67890n); + +// Alice computes her shared secret with Bob's public key +const aliceSharedSecret = alice.compute_shared_secret(bob.public_key); + +// Bob computes his shared secret with Alice's public key +const bobSharedSecret = bob.compute_shared_secret(alice.public_key); + +// Check if aliceSharedSecret is equal to bobSharedSecret +const isSharedSecretEqual = aliceSharedSecret.x === bobSharedSecret.x && aliceSharedSecret.y === bobSharedSecret.y; + +console.log(`Are the shared secrets equal? ${isSharedSecretEqual}`); +``` + +### Massey-Omura Key Exchange + +```js +const { algorithms: { Koblitz }, protocols: { MasseyOmura } } = require('ecutils'); + +// Initialize the Koblitz instance for the elliptic curve 'secp192k1' +const koblitz = new Koblitz('secp192k1'); + +// Sender's side +// ------------- +const privateKeySender = BigInt("70604135"); +// Initialize Massey-Omura protocol with the sender's private key +const moSender = new MasseyOmura(privateKeySender); + +// Encode the message using the Koblitz method +// `j` is used to handle the ambiguity in the decoding process +const [message, j] = koblitz.encode("Hello, world!"); + +// Perform the first encryption step with Massey-Omura protocol +const encryptedMsgSender = moSender.first_encryption_step(message); + +// The encoded message is now sent to the receiver... +// (transmission of encryptedMsgSender) + +// Receiver's side +// --------------- +const privateKeyReceiver = BigInt("48239108668"); +// Initialize Massey-Omura protocol with the receiver's private key +const moReceiver = new MasseyOmura(privateKeyReceiver); + +// Perform the second encryption step with Massey-Omura protocol +const encryptedMsgReceiver = moReceiver.second_encryption_step(encryptedMsgSender); + +// The double-encrypted message is sent back to the sender... +// (transmission of encryptedMsgReceiver) + +// Sender's side again +// ------------------- +const partialDecryptedMsg = moSender.partial_decryption_step(encryptedMsgReceiver); + +// The partially decrypted message is sent back to the receiver... +// (transmission of partialDecryptedMsg) + +// Receiver's final decryption +// --------------------------- +const originalMessage = moReceiver.partial_decryption_step(partialDecryptedMsg); + +// Decode the message using the Koblitz method +// `j` is used to resolve the mapping from the elliptic curve point back to the message +const decodedMessage = koblitz.decode(originalMessage, j); + +console.log(decodedMessage); +``` + +## Contributing + +Contributions are welcome! If you’d like to contribute to `ecutils`, please follow these steps: + +1. Fork the repository. +2. Create a new branch for your feature or bug fix. +3. Make your changes and commit them. +4. Push your branch and open a pull request. + +## License + +This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index a76117b..41120ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2919,30 +2919,10 @@ "@babel/types": "^7.20.7" } }, - "node_modules/@types/eslint": { - "version": "8.56.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", - "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", - "dev": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint-scope": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", - "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", - "dev": true, - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true }, "node_modules/@types/graceful-fs": { @@ -3247,10 +3227,10 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-assertions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", - "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, "peerDependencies": { "acorn": "^8" @@ -3768,12 +3748,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -4427,9 +4407,9 @@ "dev": true }, "node_modules/enhanced-resolve": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz", - "integrity": "sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dev": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -4804,21 +4784,6 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, - "node_modules/fast-url-parser": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/fast-url-parser/-/fast-url-parser-1.1.3.tgz", - "integrity": "sha512-5jOCVXADYNuRkKFzNJ0dCCewsZiYo0dz8QNYljkOpFC6r2U4OBmKtvm/Tsuh4w1YYdDqDb31a8TVhBJ2OJKdqQ==", - "dev": true, - "dependencies": { - "punycode": "^1.3.2" - } - }, - "node_modules/fast-url-parser/node_modules/punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", - "dev": true - }, "node_modules/fastest-levenshtein": { "version": "1.0.16", "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", @@ -4859,9 +4824,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -7292,12 +7257,12 @@ "dev": true }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -7574,9 +7539,9 @@ "dev": true }, "node_modules/path-to-regexp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-2.2.1.tgz", - "integrity": "sha512-gu9bD6Ta5bwGrrU8muHzVOBFFREpp2iRkVfhBJahwJ6p6Xw20SjT0MxLnwkjOibQmGSYhiUnf2FLe7k+jcFmGQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.3.0.tgz", + "integrity": "sha512-qyCH421YQPS2WFDxDjftfc1ZR5WKQzVzqsp4n9M2kQhVOo/ByahFoUNJfl58kOcEGfQ//7weFTDhm+ss8Ecxgw==", "dev": true }, "node_modules/picocolors": { @@ -8103,9 +8068,9 @@ } }, "node_modules/serve": { - "version": "14.2.3", - "resolved": "https://registry.npmjs.org/serve/-/serve-14.2.3.tgz", - "integrity": "sha512-VqUFMC7K3LDGeGnJM9h56D3XGKb6KGgOw0cVNtA26yYXHCcpxf3xwCTUaQoWlVS7i8Jdh3GjQkOB23qsXyjoyQ==", + "version": "14.2.4", + "resolved": "https://registry.npmjs.org/serve/-/serve-14.2.4.tgz", + "integrity": "sha512-qy1S34PJ/fcY8gjVGszDB3EXiPSk5FKhUa7tQe0UPRddxRidc2V6cNHPNewbE1D7MAkgLuWEt3Vw56vYy73tzQ==", "dev": true, "dependencies": { "@zeit/schemas": "2.36.0", @@ -8117,7 +8082,7 @@ "clipboardy": "3.0.0", "compression": "1.7.4", "is-port-reachable": "4.0.0", - "serve-handler": "6.1.5", + "serve-handler": "6.1.6", "update-check": "1.5.4" }, "bin": { @@ -8128,18 +8093,17 @@ } }, "node_modules/serve-handler": { - "version": "6.1.5", - "resolved": "https://registry.npmjs.org/serve-handler/-/serve-handler-6.1.5.tgz", - "integrity": "sha512-ijPFle6Hwe8zfmBxJdE+5fta53fdIY0lHISJvuikXB3VYFafRjMRpOffSPvCYsbKyBA7pvy9oYr/BT1O3EArlg==", + "version": "6.1.6", + "resolved": "https://registry.npmjs.org/serve-handler/-/serve-handler-6.1.6.tgz", + "integrity": "sha512-x5RL9Y2p5+Sh3D38Fh9i/iQ5ZK+e4xuXRd/pGbM4D13tgo/MGwbttUk8emytcr1YYzBYs+apnUngBDFYfpjPuQ==", "dev": true, "dependencies": { "bytes": "3.0.0", "content-disposition": "0.5.2", - "fast-url-parser": "1.1.3", "mime-types": "2.1.18", "minimatch": "3.1.2", "path-is-inside": "1.0.2", - "path-to-regexp": "2.2.1", + "path-to-regexp": "3.3.0", "range-parser": "1.2.0" } }, @@ -8727,21 +8691,20 @@ } }, "node_modules/webpack": { - "version": "5.91.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.91.0.tgz", - "integrity": "sha512-rzVwlLeBWHJbmgTC/8TvAcu5vpJNII+MelQpylD4jNERPwpBJOE2lEcko1zJX3QJeLjTTAnQxn/OJ8bjDzVQaw==", + "version": "5.95.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.95.0.tgz", + "integrity": "sha512-2t3XstrKULz41MNMBF+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5/aO2tuDxdeTPdU7xu9Q==", "dev": true, "dependencies": { - "@types/eslint-scope": "^3.7.3", "@types/estree": "^1.0.5", "@webassemblyjs/ast": "^1.12.1", "@webassemblyjs/wasm-edit": "^1.12.1", "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.9.0", + "acorn-import-attributes": "^1.9.5", "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.16.0", + "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", diff --git a/package.json b/package.json index 2610e0c..f0516d0 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,30 @@ { + "name": "ecutils", + "version": "0.0.1-alpha.1", + "description": "JavaScript library for Elliptic Curve Cryptography: key exchanges (Diffie-Hellman, Massey-Omura), ECDSA signatures, and Koblitz encoding. Suitable for crypto education and secure systems.", + "keywords": [ + "ecdsa", + "secure-communication", + "public-key-cryptography", + "cryptographic-algorithms", + "digital-signatures", + "python-cryptography", + "elliptic-curve-cryptography", + "diffie-hellman-key-exchange", + "ecc-based-protocols", + "message-encoding-and-decoding", + "koblitz-encoding", + "massey-omura-protocol", + "elliptic-curve-operation" + ], + "author": "Isak Ruas", + "license": "MIT", + "main": "dist/index.js", + "files": [ + "dist/", + "LICENSE", + "README.md" + ], "scripts": { "clean": "rm -rf dist/* && rm -rf .babel_cache && rm -rf .jest_cache", "build": "npm run clean && babel src -d dist;", @@ -28,4 +54,4 @@ "webpack": "^5.91.0", "webpack-cli": "^5.1.4" } -} +} \ No newline at end of file