{"_id":"@dashlane/pqc-sign-dilithium3-node","_rev":"7-710a0b06be7c24c29561dfdffb84ecf2","name":"@dashlane/pqc-sign-dilithium3-node","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@dashlane/pqc-sign-dilithium3-node","version":"1.0.0","keywords":["cryptography","post-quantum","asm.js","webassembly"],"author":{"name":"Jérôme Boillot","email":"jerome.boillot@dashlane.com, me@jerome-boillot.com"},"license":"Apache-2.0","_id":"@dashlane/pqc-sign-dilithium3-node@1.0.0","maintainers":[{"name":"guillaumemarondashlane","email":"guillaume.maron@dashlane.com"},{"name":"bradcush","email":"bradleycushing@gmail.com"},{"name":"mlou","email":"maryamlouati@outlook.com"},{"name":"dashlaneqbarbe","email":"quentin@dashlane.com"}],"homepage":"https://github.com/Dashlane/pqc.js#readme","bugs":{"url":"https://github.com/Dashlane/pqc.js/issues"},"dist":{"shasum":"0e33cdcafc32b284f72793489a06e8fd0ec1dd15","tarball":"https://registry.npmjs.org/@dashlane/pqc-sign-dilithium3-node/-/pqc-sign-dilithium3-node-1.0.0.tgz","fileCount":9,"integrity":"sha512-klQMogToLutyyiwkiHCFOQp+9b4RIMMB7v2E0wt0YIgwpJ6RySTrWn9uX3Xyuc1uLWE0hewJsN6bXmZW/TmMAA==","signatures":[{"sig":"MEUCIQD9zpuaFEk6jN6YMKQkGpef/30nYaCtebYlz+SDhAZMfQIgJVNzYwSW8W5oKTgmG+8QJ8mhv1RYsORkd9OV8Nc2Sl8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":332267,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1nP6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpJdxAAmh3KNCtpaHOFB6V1EDcp58sF/KzZ4RihXSUBSs6juqSzKPdz\r\nc3qihTGsB3Gc+9/SVxZ1i25LBp7w+ptvtSxDAs+ZbyQKHG7kpaPhu3Npm71F\r\nGGoL8qE3/KAPhdSXe3+vmiPPEvkVeK7CvMI1yc/2D7fjdOoL5g2wys6nWJ0E\r\npJOCnnzXB7UqCez1Cuba5y7us0l1fX1a8I7mOjpYKT3jIw+ALMDuUED7bgW6\r\nPhU1ZtWRQKGUYQWVeqqMPKZla8YgSmxv8EtmoMEa5fBdrUGKquFX/P0yOlhI\r\nBvh3enPC2Ybjl2LHuPAaluuhEkvTDGIWLyCU6B8ZQMWVmTIbIvxnQVHVxdzP\r\nQuX+qJx5Eu8tkd4FxwPoqqoFimKoh7kXnDqbXZ8Oh34YCF3qTLLjRJBQUUNB\r\n3750KfO3yX51/B8LVKjZY4a4PZafnQ807DMJFYmTKPA/2i3LnqwDBn9hKtI3\r\n4excARKjJfZkJPcE7IoUQLQgxUc23f0i+/2ksEzJvoaAnC7ZnlcLP4Lbum1m\r\n0OVZZ/0AqmrFIKXEGAH4rQgbMmZDeqc2RYcortyZuTTAvoCEfg/NQ8ffHB/y\r\n5hPvqJ4oC/x8eqOF4dOYxQwnmmgNN9sWPuvWh6YQnBkmNx/2r3KHXGRZDVpr\r\nYGc9HxOgIbM50WtgRyp+bAG4pNwPuqfR5tI=\r\n=OOu1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/sign.js","type":"module","_from":"file:docs/bin/pqc-sign-dilithium3/pqc-sign-dilithium3-node.tgz","types":"dist/sign.d.ts","engines":{"node":">=16.0.0"},"scripts":{"lint":"eslint src","test":"mocha","build":"tsc && npm run copy-files","format":"prettier --write src && eslint --fix src","test:kem":"mocha -g KEM","test:sign":"mocha -g SIGN","copy-files":"cp ./src/*.wasm ./dist/","__webpack__":"The second part of the following commands is related to https://github.com/vercel/next.js/issues/30646","webpack:kem":"npm run clean-bundles && webpack --config bundle/webpack.config.kem.babel.js --env outputFileName=$OUTPUT_FILE_NAME && sed -i 's/document.baseURI/undefined/' bundle/$OUTPUT_FILE_NAME.js","webpack:sign":"npm run clean-bundles && webpack --config bundle/webpack.config.sign.babel.js --env outputFileName=$OUTPUT_FILE_NAME && sed -i 's/document.baseURI/undefined/' bundle/$OUTPUT_FILE_NAME.js","clean-bundles":"rm -f bundle/pqc-*","test:primitives":"mocha -g PRIMITIVES"},"_npmUser":{"name":"dashlaneqbarbe","email":"quentin@dashlane.com"},"_resolved":"/builds/server/misc/pqc.js/docs/bin/pqc-sign-dilithium3/pqc-sign-dilithium3-node.tgz","_integrity":"sha512-klQMogToLutyyiwkiHCFOQp+9b4RIMMB7v2E0wt0YIgwpJ6RySTrWn9uX3Xyuc1uLWE0hewJsN6bXmZW/TmMAA==","repository":{"url":"git+ssh://git@github.com/Dashlane/pqc.js.git","type":"git"},"_npmVersion":"8.11.0","description":"JavaScript wrapper generator of WebAssembly builds of each round-3 finalists of NIST Post-Quantum Cryptography Competition","directories":{},"_nodeVersion":"16.15.1","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.6","path":"^0.12.7","mocha":"^10.0.0","eslint":"^8.16.0","process":"^0.11.10","ts-node":"^10.8.0","webpack":"^5.72.1","prettier":"^2.6.2","typescript":"^4.6.4","@types/chai":"^4.3.1","@types/node":"^17.0.35","file-loader":"^6.2.0","webpack-cli":"^4.9.2","@types/mocha":"^9.1.1","babel-loader":"^8.2.5","@types/webpack":"^5.28.0","babel-register":"^6.26.0","webpack-strip-block":"^0.3.0","string-replace-loader":"^3.1.0","eslint-config-prettier":"^8.5.0","@typescript-eslint/parser":"^5.25.0","@typescript-eslint/eslint-plugin":"^5.25.0"},"_npmOperationalInternal":{"tmp":"tmp/pqc-sign-dilithium3-node_1.0.0_1658221562666_0.9954217848871607","host":"s3://npm-registry-packages"}}},"time":{"created":"2022-07-19T09:06:02.617Z","modified":"2026-07-24T07:45:16.355Z","1.0.0":"2022-07-19T09:06:02.843Z"},"bugs":{"url":"https://github.com/Dashlane/pqc.js/issues"},"author":{"name":"Jérôme Boillot","email":"jerome.boillot@dashlane.com, me@jerome-boillot.com"},"license":"Apache-2.0","homepage":"https://github.com/Dashlane/pqc.js#readme","keywords":["cryptography","post-quantum","asm.js","webassembly"],"repository":{"url":"git+ssh://git@github.com/Dashlane/pqc.js.git","type":"git"},"description":"JavaScript wrapper generator of WebAssembly builds of each round-3 finalists of NIST Post-Quantum Cryptography Competition","maintainers":[{"email":"guillaume.maron@dashlane.com","name":"guillaumemarondashlane"},{"email":"quentin@dashlane.com","name":"dashlaneqbarbe"},{"email":"grangerbastien@gmail.com","name":"bastien.granger"}],"readme":"# pqc.js\n\n## Overview\n\nThis project provides JS bindings and playground of post-quantum asymmetric cipher compiled to WebAssembly using\n[emscripten](https://emscripten.org/) with a fallback in plain JS.\n\nThe available methods are the finalists (and alternate candidates) of\n[NIST Post-Quantum Cryptography Competition](https://csrc.nist.gov/Projects/post-quantum-cryptography):\n- **Key Encapsulation Methods (KEM):** [NTRU](https://ntru.org/), [Kyber](https://pq-crystals.org/kyber/), [SABER](https://www.esat.kuleuven.be/cosic/pqcrypto/saber/), [McEliece-Classic](https://classic.mceliece.org/), ([NTRU Prime](https://ntruprime.cr.yp.to/), [FrodoKEM](https://frodokem.org/), [HQC-RMRS](https://pqc-hqc.org/)).\n- **Signature methods:** [Dilithium](https://pq-crystals.org/dilithium/), [FALCON](https://falcon-sign.info/), [RAINBOW](https://www.pqcrainbow.org/), ([SPHINCS+](https://sphincs.org/)).\n\nThe C implementations used to create the bindings are the `clean` versions provided by [PQClean](https://github.com/PQClean/PQClean).\n\nThis project has been inspired by [ntru.js](https://github.com/cyph/ntru.js) that used to provide an NTRU JS binding.\n\n## Playground\n\nIt is possible to test the bindings, to compare them in real-world conditions on [this playground](https://dashlane.github.io/pqc.js/).\n\n## How to download pre-built bindings and NPM packages\n\nPre-built bindings are available on [the playground](https://dashlane.github.io/pqc.js/).\n\n## How to build\n\n- `sudo apt install emscripten`\n- `npm ci`\n- `make clean`\n- `make kem-<the KEM algorithm you want to build>` or `make sign-<the signature algorithm you want to build>`\n- All bindings can be built using `make all`\n\nThe output directory is `docs/bin/` and each output binding is made of a JS module and its associated WebAssembly file,\na browser package, and a node package.\n\n## How to use\n\n### Key Encapsulation\n```typescript\nimport kemBuilder from 'pqc-kem-<algoName>.js'\n\nasync function run() {\n    const kem = await kemBuilder();\n    \n    const { publicKey, privateKey } = await kem.keypair();\n    const { ciphertext, sharedSecret: sharedSecretA } = await kem.encapsulate(publicKey);\n    const { sharedSecret: sharedSecretB } = await kem.decapsulate(ciphertext, privateKey);\n    // sharedSecretA === sharedSecretB\n}\n\nrun();\n```\n\n### Signature\n```typescript\nimport signBuilder from 'pqc-sign-<algoName>.js'\n\nasync function run() {\n    const sign = await signBuilder();\n    \n    const message = new Uint8Array([0x44, 0x61, 0x73, 0x68, 0x6c, 0x61, 0x6e, 0x65]);\n    \n    const { publicKey, privateKey } = await sign.keypair();\n    const { signature } = await sign.sign(message, privateKey);\n    const validSignature = await sign.verify(signature, message, publicKey);\n    // validSignature === true\n}\n\nrun();\n```\n\n### Disable WebAssembly execution\n\nThe first optional parameter of the builders is set to `true` is you want to disable WebAssembly execution.\n\nIf it is set to false, the fallback JavaScript may still be used if the WebAssembly fails.\n\n### Change the path of the WebAssembly\n\nThe second optional parameter of the builders is the path to the WebAssembly file.\n\n## Implementation notes\n\n- Random generation is provided by [libsodium](https://github.com/jedisct1/libsodium) that is using `crypto.randomBytes`.\n- `SHA-2` and `AES` implementations are provided by SubtleCrypto that is an implementation of Web Crypto API. This may\nslow down the execution of the bindings because of the asynchronous calls to SubtleCrypto, even more when AES-ECB is\nused because in this case AES-CTR is called for each block.\n- `SHA-2` PQClean implementation is still used by `sphincs-sha256-*` bindings because they are using incremental version\nof `sha256` that do not exist in Web Crypto API.\n- `SHA-3` PQClean implementation is still used by NTRU, Kyber, SABER, FrodoKEM and McEliece-Classic because there are no\nimplementations in Web Crypto API.\n","readmeFilename":"README.md"}