{"_id":"@0xkey-io/crypto","_rev":"5-6560d9bd07cae974be43596d858f1d5c","name":"@0xkey-io/crypto","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@0xkey-io/crypto","version":"0.1.0","author":{"url":"https://0xkey.com/","name":"0xkey"},"license":"Apache-2.0","_id":"@0xkey-io/crypto@0.1.0","maintainers":[{"name":"0xkey-developer","email":"developer@0xkey.io"}],"homepage":"https://github.com/0xkey-io/sdk-js/tree/main/packages/crypto","bugs":{"url":"https://github.com/0xkey-io/sdk-js/issues"},"dist":{"shasum":"7aa04683c7348a266df8c9a658f54ba2287c32ef","tarball":"https://registry.npmjs.org/@0xkey-io/crypto/-/crypto-0.1.0.tgz","fileCount":20,"integrity":"sha512-/41CE219wJCjqPMWdv8OtiAnN/bqbn9ei2n4b8CaSEpZ9IV08mV1kmz+YxS0+Cdkg20Ayyk1h2extReczbSgAQ==","signatures":[{"sig":"MEUCICgCllmGYuYD/f4uSjFliBtBd3K4maUDt//GhzMvSFWsAiEAnklUCwF4N4C15Tw5pt9kgRVepguck47Dk5ihrPBP2K4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":408833},"main":"./dist/index.js","_from":"file:0xkey-io-crypto-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","default":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"test":"jest","build":"rollup -c","clean":"rimraf ./dist ./.cache","typecheck":"tsc -p tsconfig.typecheck.json"},"_npmUser":{"name":"0xkey-developer","email":"developer@0xkey.io"},"_resolved":"/private/var/folders/lf/b69416ms3zvccf0ght6bq02r0000gn/T/7fcc69b9fcfe6babae9d0cce8106f43f/0xkey-io-crypto-0.1.0.tgz","_integrity":"sha512-/41CE219wJCjqPMWdv8OtiAnN/bqbn9ei2n4b8CaSEpZ9IV08mV1kmz+YxS0+Cdkg20Ayyk1h2extReczbSgAQ==","deprecated":"Broken: depends on unpublished internal packages. Please use >=0.1.1","repository":{"url":"git+https://github.com/0xkey-io/sdk-js.git","type":"git","directory":"packages/crypto"},"_npmVersion":"11.4.2","description":"Encryption, decryption, and key related utility functions","directories":{},"_nodeVersion":"24.3.0","dependencies":{"borsh":"2.0.0","cbor-js":"0.1.0","@noble/curves":"1.9.0","@noble/hashes":"1.8.0","@noble/ciphers":"1.3.0","@peculiar/x509":"1.12.3","@0xkey-io/encoding":"0.1.0","@0xkey-io/sdk-types":"0.1.0","@0xkey-io/internal-crypto-core":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"29.7.0","@types/jest":"^29.5.3","@types/cbor-js":"^0.1.1"},"_npmOperationalInternal":{"tmp":"tmp/crypto_0.1.0_1779443515908_0.23009220955066612","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@0xkey-io/crypto","version":"0.1.1","author":{"url":"https://0xkey.com/","name":"0xkey"},"license":"Apache-2.0","_id":"@0xkey-io/crypto@0.1.1","maintainers":[{"name":"0xkey-developer","email":"developer@0xkey.io"}],"homepage":"https://github.com/0xkey-io/sdk-js/tree/main/packages/crypto","bugs":{"url":"https://github.com/0xkey-io/sdk-js/issues"},"dist":{"shasum":"6e9b93fa099cfd7cc398e90eb07996958828c96d","tarball":"https://registry.npmjs.org/@0xkey-io/crypto/-/crypto-0.1.1.tgz","fileCount":20,"integrity":"sha512-mhOlzoS1XXd0xoxdh8TPXuITGYkzz99d07oGVIu5qwh7LgcuzdBgaAoq+tv0LON/Sb5hXPqJuno0qFUVEYn38A==","signatures":[{"sig":"MEQCIHZpspmFoEVuXZBiPViLxaCgMpnNqYbklq2OZD3Hn/1kAiBm6RphgXpSMvppW+1dU1i5pn7bA7oHvdu+EAY1EQZBzQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":409378},"main":"./dist/index.js","_from":"file:0xkey-io-crypto-0.1.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","default":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"test":"jest","build":"rollup -c","clean":"rimraf ./dist ./.cache","typecheck":"tsc -p tsconfig.typecheck.json"},"_npmUser":{"name":"0xkey-developer","email":"developer@0xkey.io"},"_resolved":"/private/var/folders/lf/b69416ms3zvccf0ght6bq02r0000gn/T/a5a4e5cb56aa8e0e86d1ac477f7e7b11/0xkey-io-crypto-0.1.1.tgz","_integrity":"sha512-mhOlzoS1XXd0xoxdh8TPXuITGYkzz99d07oGVIu5qwh7LgcuzdBgaAoq+tv0LON/Sb5hXPqJuno0qFUVEYn38A==","repository":{"url":"git+https://github.com/0xkey-io/sdk-js.git","type":"git","directory":"packages/crypto"},"_npmVersion":"11.4.2","description":"Encryption, decryption, and key related utility functions","directories":{},"_nodeVersion":"24.3.0","dependencies":{"borsh":"2.0.0","cbor-js":"0.1.0","@noble/curves":"1.9.0","@noble/hashes":"1.8.0","@noble/ciphers":"1.3.0","@peculiar/x509":"1.12.3","@0xkey-io/encoding":"0.1.1","@0xkey-io/sdk-types":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"29.7.0","@types/jest":"^29.5.3","@types/cbor-js":"^0.1.1","@0xkey-io/internal-crypto-core":"0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/crypto_0.1.1_1779451981237_0.47076425152205803","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@0xkey-io/crypto","version":"0.2.0","author":{"url":"https://0xkey.com/","name":"0xkey"},"license":"Apache-2.0","_id":"@0xkey-io/crypto@0.2.0","maintainers":[{"name":"0xkey-developer","email":"developer@0xkey.io"}],"homepage":"https://github.com/0xkey-io/sdk-js/tree/main/packages/crypto","bugs":{"url":"https://github.com/0xkey-io/sdk-js/issues"},"dist":{"shasum":"4c0eeadf004a5d0231f0c478df9c0ec11004347c","tarball":"https://registry.npmjs.org/@0xkey-io/crypto/-/crypto-0.2.0.tgz","fileCount":22,"integrity":"sha512-j461F1VXYUlrmenA3Hp8EOC+QaEnqYzOFaaUOra7Yj2SEHHUB2KPgqaz1XqwRVdsOG6adAZWKGOCvUYUt1wxdA==","signatures":[{"sig":"MEYCIQCD1U/Y+Dp21tmJ8kMWEqB+HDnf3UkrlP1hDkf7y5bjNAIhANi08RAx+9raYZp2kFho2kySwpm3KsulTbvMU1qaTNGz","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":456418},"main":"./dist/index.js","_from":"file:0xkey-io-crypto-0.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","default":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"test":"jest","build":"rollup -c","clean":"rimraf ./dist ./.cache","typecheck":"tsc -p tsconfig.typecheck.json"},"_npmUser":{"name":"0xkey-developer","email":"developer@0xkey.io"},"_resolved":"/tmp/8d3061c6f521a353e11e4769bd4d102a/0xkey-io-crypto-0.2.0.tgz","_integrity":"sha512-j461F1VXYUlrmenA3Hp8EOC+QaEnqYzOFaaUOra7Yj2SEHHUB2KPgqaz1XqwRVdsOG6adAZWKGOCvUYUt1wxdA==","repository":{"url":"git+https://github.com/0xkey-io/sdk-js.git","type":"git","directory":"packages/crypto"},"_npmVersion":"11.5.1","description":"Encryption, decryption, and key related utility functions","directories":{},"_nodeVersion":"20.17.0","dependencies":{"borsh":"2.0.0","cbor-js":"0.1.0","@noble/curves":"1.9.0","@noble/hashes":"1.8.0","@noble/ciphers":"1.3.0","@peculiar/x509":"1.12.3","@0xkey-io/encoding":"0.1.1","@0xkey-io/sdk-types":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"29.7.0","@types/jest":"^29.5.3","@types/cbor-js":"^0.1.1","@0xkey-io/internal-crypto-core":"0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/crypto_0.2.0_1782244089275_0.8663597145536275","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@0xkey-io/crypto","version":"0.3.0","main":"./dist/index.js","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js","default":"./dist/index.mjs"}},"types":"./dist/index.d.ts","license":"Apache-2.0","description":"Encryption, decryption, and key related utility functions","author":{"name":"0xkey","url":"https://0xkey.com/"},"homepage":"https://github.com/0xkey-io/sdk-js/tree/main/packages/crypto","bugs":{"url":"https://github.com/0xkey-io/sdk-js/issues"},"repository":{"type":"git","url":"git+https://github.com/0xkey-io/sdk-js.git","directory":"packages/crypto"},"publishConfig":{"access":"public"},"engines":{"node":">=18.0.0"},"dependencies":{"@noble/ciphers":"1.3.0","@noble/curves":"1.9.0","@noble/hashes":"1.8.0","@peculiar/x509":"1.12.3","borsh":"2.0.0","cbor-js":"0.1.0","@0xkey-io/encoding":"0.1.1","@0xkey-io/sdk-types":"0.1.1"},"devDependencies":{"@types/cbor-js":"^0.1.1","@types/jest":"^29.5.3","jest":"29.7.0","@0xkey-io/internal-crypto-core":"0.1.0"},"scripts":{"build":"rollup -c","clean":"rimraf ./dist ./.cache","test":"jest","typecheck":"tsc -p tsconfig.typecheck.json"},"_id":"@0xkey-io/crypto@0.3.0","_integrity":"sha512-qEVC6ESlqtnWGzWhoNlIze8JW/TRVrSmOdgHfYGNIGae87sP8aAWxNYJmXVVo2pcJ+MrW+mp+bptbR6ctNfy+Q==","_resolved":"/tmp/8a353f36e491c1cf8d37e606f99c9c71/0xkey-io-crypto-0.3.0.tgz","_from":"file:0xkey-io-crypto-0.3.0.tgz","_nodeVersion":"20.17.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-qEVC6ESlqtnWGzWhoNlIze8JW/TRVrSmOdgHfYGNIGae87sP8aAWxNYJmXVVo2pcJ+MrW+mp+bptbR6ctNfy+Q==","shasum":"a9845b43b4126aad79d2ebb780d165a3b6b040c9","tarball":"https://registry.npmjs.org/@0xkey-io/crypto/-/crypto-0.3.0.tgz","fileCount":24,"unpackedSize":550524,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIC3hlzi8eMwqpnkIM+k3UOnTsEWdsyV/NtnAGlnopOTZAiEA8UmHTzcobLDfDgdNQFthoniAqydu7jYAR6jaVXHm+7I="}]},"_npmUser":{"name":"0xkey-developer","email":"developer@0xkey.io"},"directories":{},"maintainers":[{"name":"0xkey-developer","email":"developer@0xkey.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/crypto_0.3.0_1783079755618_0.640918539064735"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-22T09:51:55.725Z","modified":"2026-07-03T11:55:55.926Z","0.1.0":"2026-05-22T09:51:56.051Z","0.1.1":"2026-05-22T12:13:01.394Z","0.2.0":"2026-06-23T19:48:09.426Z","0.3.0":"2026-07-03T11:55:55.780Z"},"bugs":{"url":"https://github.com/0xkey-io/sdk-js/issues"},"author":{"name":"0xkey","url":"https://0xkey.com/"},"license":"Apache-2.0","homepage":"https://github.com/0xkey-io/sdk-js/tree/main/packages/crypto","repository":{"type":"git","url":"git+https://github.com/0xkey-io/sdk-js.git","directory":"packages/crypto"},"description":"Encryption, decryption, and key related utility functions","maintainers":[{"name":"0xkey-developer","email":"developer@0xkey.io"}],"readme":"# @0xkey-io/crypto\n\nThis package consolidates some common cryptographic utilities used across our applications, particularly primitives related to keys, encryption, and decryption in a pure JS implementation. For react-native you will need to polyfill our random byte generation by importing [react-native-get-random-values](https://www.npmjs.com/package/react-native-get-random-values)\n\nExample usage (Hpke E2E):\n\n```\nconst senderKeyPair = generateP256KeyPair();\nconst receiverKeyPair = generateP256KeyPair();\n\nconst receiverPublicKeyUncompressed = uncompressRawPublicKey(\n  uint8ArrayFromHexString(receiverKeyPair.publicKey),\n);\n\nconst plainText = \"Hello, this is a secure message!\";\nconst plainTextBuf = textEncoder.encode(plainText);\nconst encryptedData = hpkeEncrypt({\n  plainTextBuf: plainTextBuf,\n  encappedKeyBuf: receiverPublicKeyUncompressed,\n  senderPriv: senderKeyPair.privateKey,\n});\n\n// Extract the encapsulated key buffer and the ciphertext\nconst encappedKeyBuf = encryptedData.slice(0, 33);\nconst ciphertextBuf = encryptedData.slice(33);\n\nconst decryptedData = hpkeDecrypt({\n  ciphertextBuf,\n  encappedKeyBuf: uncompressRawPublicKey(encappedKeyBuf),\n  receiverPriv: receiverKeyPair.privateKey,\n});\n\n// Convert decrypted data back to string\nconst decryptedText = new TextDecoder().decode(decryptedData);\n```\n","readmeFilename":"README.md"}