{"_id":"@miracl/crypto-js","_rev":"4-0d9bc522aede0ffbe3b83072bd341220","time":{"3.7.0":"2021-12-01T13:29:33.122Z","created":"2021-12-01T13:41:58.049Z","4.0.0":"2021-12-01T13:41:58.398Z","modified":"2022-04-06T05:47:02.370Z"},"name":"@miracl/crypto-js","dist-tags":{"latest":"4.0.0"},"versions":{"4.0.0":{"name":"@miracl/crypto-js","version":"4.0.0","description":"Crypto Library in JavaScript","main":"./src/ctx.js","type":"module","directories":{"doc":"doc","example":"examples","test":"test"},"scripts":{"test":"mocha","coverage":"nyc mocha","report":"nyc report --reporter=text-lcov | coveralls","lint":"eslint .","dist":"rm -rf dist/ && mkdir dist && cp src/* dist/"},"repository":{"type":"git","url":"git+https://gitlab.corp.miracl.com/mfa/pkg/crypto-js.git"},"keywords":["pairing","elliptic","curve","cryptography"],"author":{"name":"Michael Scott, Alessandro Budroni, Kealan McCusker"},"license":"Apache-2.0","devDependencies":{"chai":"^3.5.0","coveralls":"^3.0.2","eslint":"^8.3.0","mocha":"^8.0.1","mocha-text-cov":"^0.1.1","nyc":"^15.1.0"},"nyc":{"include":["src/**/*.js"],"reporter":["lcov","text-summary","html"],"sourceMap":true,"instrument":true},"gitHead":"3087fd9c71c6ba02d78c834bf9b7409d5f112345","_id":"@miracl/crypto-js@4.0.0","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-HANn5UH/2bzY9Zf0mb6CQlFchclRPbLLZuoMHvNbS+eXrFkk5BxTdcCNlvTkQDvE0/vcpmr3/JVgGl2cY1Ddwg==","shasum":"1cb955744d5ae4dc510bbfeeba283c1042af101e","tarball":"https://registry.npmjs.org/@miracl/crypto-js/-/crypto-js-4.0.0.tgz","fileCount":195,"unpackedSize":7958167,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhp3umCRA9TVsSAnZWagAA1vcP/REUC4vtxDiI4e+zGty3\nxjBy7vmiYDDpd19+IxT4f5r9bH0mBtX4gwuN5FRty4tSbaKG8cPqlNISzc7A\nkM3cXNtAp4T8Bd6GrqK8yOhvsTlpbiIkpaQEaMr5jUtZLYakvQlYsPy21Q05\nYxHS0XEIsK5kLDiXQ/Bp9PweqxFEFX7ESar3bUyIsxzdSYN2kTG2NL8/xyTe\nIRhdYWQIbBPsutKh4nIH7bKFsBPVWH8D/2A/aV29tgZWzw6kPq6fxx+AiIiy\nmClO5MM0vegJOX3z6LCEaTYRv3+6fULJWnoug81TnC4rfnsZ48CV6TLaToIo\nqfcXlnrCYZGRkLC9Wp60oXWLEscO/ihcTiofv/CRZdYQEQ/qx6rq819Ni8qc\n20ZCX4KMoVUx6/JMZ6wNAuZFkh9e0w+xPNM5OxIp9j2KvMVf1cdO+XfR+E7/\nHgDKu8QoTBZsYPXdsEtDEf+NzwII0Yd3QvQHfzpUKd9aMPBSx4956kC5+kCm\n2rTXuw+Gp4xZaum0qTI4LGVrsvlMl6eKDrckzgNmztaMtAcya9HT8MLvg4g2\n3LqIeJyJaFYVmJtNkAxnNeUCbHvGJkq1bi0bbSpzSIfuUAzN0Du2egm3sRy6\nbnJ2eR0YnBr6SQyfTVZ6hzayAmbtGJ5M53YjYEnSiZOqiJtDuO7WcHELiVh7\n5SB3\r\n=mTFt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSFA6XKhoo12AgCY7rLqytxmQTlCuuc0ntFI651uvekwIgc0K4P+x91fU6P5GeqHHQznK60ZJGXcKFtb3iCncuJvA="}]},"_npmUser":{"name":"todinov","email":"ivan.todinov@gmail.com"},"maintainers":[{"name":"todinov","email":"ivan.todinov@gmail.com"},{"name":"vmitov","email":"vladislav.mitov@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/crypto-js_4.0.0_1638366118123_0.6829100722932364"},"_hasShrinkwrap":false}},"maintainers":[{"name":"todinov","email":"ivan.todinov@gmail.com"},{"name":"vmitov","email":"vladislav.mitov@gmail.com"}],"description":"Crypto Library in JavaScript","keywords":["pairing","elliptic","curve","cryptography"],"repository":{"type":"git","url":"git+https://gitlab.corp.miracl.com/mfa/pkg/crypto-js.git"},"author":{"name":"Michael Scott, Alessandro Budroni, Kealan McCusker"},"license":"Apache-2.0","readme":"# MIRACL Crypto JS Library\n\n## Description\n\n*MCJS - MIRACL Crypto JavaScript*\n\n* MCJS is a standards compliant JavaScript cryptographic library with no external dependencies except for the random seed source.\n\n* MCJS supports the standards for RSA, ECDH, ECIES, ECDSA and M-PIN, AES-GCM encryption/decryption, SHA256, SHA384, SHA512 and SHA3 hash functions and a cryptographically secure random number generator. Furthermore we recently added New Hope, a post-quantum key exchange.\n\n* MCJS is [Node.js](https://nodejs.org/en/) compatible and browser compatible (see some examples below).\n\n## Install and run  tests\n\n[Node.js](https://nodejs.org/en/) (minimum v6.9.5) and [npm](https://www.npmjs.com/) are required in order to build the library and run the tests. Install also the node.js modules required with the command\n\n```\nnpm install\n```\n\nRun all the tests with the following command\n\n```\nnpm test\n```\n\n## Quick Start\n\n#### Elliptic Curves\nSuppose you want to implement ECDH with NIST256 elliptic curve. First you need to initialize the context:\n\n```\nimport CTX from \"@miracl/crypto-js\";\n\nvar ctx = new CTX(\"NIST256\");\n```\nthen you can call the functions as follows:\n```\nctx.ECDH.KEY_PAIR_GENERATE(...);\nctx.ECDH.ECPSVDP_DH(...);\n```\nIf you need to use more than one elliptic curve in the same script you only need to initialize two different contexts, for example\n```\nvar ctx1 = new CTX(\"NIST256\");\nvar ctx2 = new CTX(\"C25519\");\n```\nThe following is the list of all elliptic curves supported by MCJS\n```\n[\n    \"ED25519\",\n    \"C25519\",\n    \"SECP256K1\",\n    \"NIST256\",\n    \"NIST384\",\n    \"BRAINPOOL\",\n    \"ANSSI\",\n    \"HIFIVE\",\n    \"GOLDILOCKS\",\n    \"C41417\",\n    \"NIST521\",\n    \"NUMS256W\",\n    \"NUMS256E\",\n    \"NUMS384W\",\n    \"NUMS384E\",\n    \"NUMS512W\",\n    \"NUMS512E\",\n    \"FP256BN\",\n    \"FP512BN\",\n    \"BN254\",\n    \"BN254CX\",\n    \"BLS383\",\n    \"BLS24\",\n    \"BLS48\",\n    \"BLS381\",\n    \"BLS461\"\n];\n```\n\n#### RSA\n\nThis library supports also RSA encryption/decryption and RSA signature. The following is a quick example on how to use RSA. First initialize the context\n```\nimport CTX from \"@miracl/crypto-js\";\n\nvar ctx = new CTX(\"RSA2048\");\n```\nthen you can call the RSA functions as follows:\n```\nctx.RSA.ENCRYPT(...);\nctx.RSA.DECRYPT(...);\n```\nThe following is the list of all the RSA security level supported by *MCJS*\n```\n['RSA2048','RSA3072','RSA4096'];\n```\n\n#### Other functions\n\nMCJS supports SHA256, SHA384, SHA512, AES-GCM encryption and Marsaglia & Zaman random number generator. Those functions are contained in every context initialized with RSA or with an elliptic curve. If you want to create a context supporting only those general functions then initialize it with no parameter as follows:\n```\nimport CTX from \"@miracl/crypto-js\";\n\nvar ctx = new CTX();\n```\n\n## Run examples\n\n[Node.js](https://nodejs.org/en/) examples are provided - please see `./examples/node`. Use the following command to run an example\n\n```\nnode ./examples/node/example_ECC_NIST256.js\n```\n\n#### Browsers\n\nThe library source code is browser compatible. The browser examples are locates in `./examples/browser`.\n","readmeFilename":"README.md"}