{"_id":"@pedrouid/iso-crypto","_rev":"9-e26aee696aa0db0a8c6f13fabd1d6b4d","name":"@pedrouid/iso-crypto","dist-tags":{"latest":"1.1.0","beta":"2.0.0-beta.7"},"versions":{"1.0.0":{"name":"@pedrouid/iso-crypto","description":"Isomorphic Cryptography Library for AES, HMAC and SHA2","version":"1.0.0","author":{"name":"Pedro Gomes","email":"github.com/pedrouid"},"license":"MIT","keywords":["crypto","cryptography","isomorphic","aes","hmac","sha2"],"main":"dist/cjs/index.js","types":"dist/cjs/index.d.ts","unpkg":"dist/umd/index.min.js","homepage":"https://github.com/pedrouid/iso-crypto","repository":{"type":"git","url":"git+https://github.com/pedrouid/iso-crypto.git"},"bugs":{"url":"https://github.com/pedrouid/iso-crypto/issues"},"scripts":{"start":"tsdx watch","clean":"rm -rf dist","build:cjs":"./node_modules/.bin/tsc -p tsconfig.cjs.json","build:umd":"webpack","build":"yarn clean && yarn build:cjs && yarn build:umd","test":"tsdx test ./test","lint":"tsdx lint src test","prepare":"yarn lint && yarn build && yarn test","publish:beta":"yarn publish --tag=beta"},"dependencies":{"aes-js":"^3.1.2","enc-utils":"^3.0.0","hash.js":"^1.1.7","randombytes":"^2.1.0"},"devDependencies":{"@peculiar/webcrypto":"^1.1.3","@types/aes-js":"^3.1.1","@types/jest":"^26.0.15","@types/node":"^14.14.7","@types/randombytes":"^2.0.0","husky":"^4.3.0","tsdx":"^0.14.1","tslib":"^1.10.0","typescript":"^3.7.5","webpack":"^4.41.6","webpack-cli":"^3.3.11"},"husky":{"hooks":{"pre-commit":"yarn lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"licenseText":"MIT License\n\nCopyright (c) 2020 Pedro Gomes\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"@pedrouid/iso-crypto@1.0.0","dist":{"shasum":"cf06b40ef3da3d7ca7363bd7a521ed59fa2fd13d","integrity":"sha512-gSz/81Cz2n9p1RHalxN8STtOHg6Dqa+l2Phz36GptpneAcAwOzPmty7FSg58htF4u9V44vEXsc7L8V9ze9j4Xg==","tarball":"https://registry.npmjs.org/@pedrouid/iso-crypto/-/iso-crypto-1.0.0.tgz","fileCount":96,"unpackedSize":672741,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftrfbCRA9TVsSAnZWagAAC0IQAIamnqPrHq4/XfSm9PA0\nkTx4zZs0U2P/sktbwwyGyZDC/j8iOyT8DpXwp5x0mz8O1fc7QzsrESBPYwEM\nIWIwICXlEEtQ2Mi2jpiqU5kgVsrTqCfpx8nvI/X/6bAKwrpUOmQrI56c/9Qv\nFY9+ea+cc2Nrd+6MYixNoqxXkWy28nZae7iBnhvIXGRwzZqUVfVuMmyxxxga\nxj+cfBjMppyP6FXcEcQbfxhk5ahbVed2qoI6XGK+uk055pW3i4N+gz6culPu\nWDY0Nf11QIrbXtTzUKXnzTFdN4WLla65k3vDNgCX/a2zU8Acs/olNZWbxPep\nWvyGeRmVdibDdKWd1CzDHdWk620GIyy1m1xc16K5FFzmdrF5bWwcP3bRYPeL\n77r/AuROqujh2BeSYZX2cA4XjdaFq919mEE1Ih+ESQVKRgy3BzwJQ2FzNeU2\n1pywAQASRWgl37rPZ1kDoMoECS9Xm5l8s/vkOj4o349yhRG/CiBfBLy/HoB2\nXxcgXWfCkcmVJ/m3bS/V5NhyMKVsPn7OSrXJ17wDIMM2sqeZMLXng65UYIfR\nc+dRKn+hVdrwGF2Lx1dJk1xpat5735gIfbwQR26w8lLQlp1Kneem2Hp/Y88Q\nb1P82L/WUJCik9I3yjJAJyXq0NCvBCSo+yilSC7L4Z/fg8ODywC4VwsJAofH\nZeh+\r\n=Bzxe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAJzTCbVSMCGz7PjtRmSu83xmqrC8rXnZLnpFP1BkmkfAiEAr/kNAWnGlRPqy0GyMbeTT9sEa0/CUtrRjOLmNg5QTQ0="}]},"_npmUser":{"name":"pedrouid","email":"pedrogomes94@gmail.com"},"directories":{},"maintainers":[{"name":"pedrouid","email":"pedrogomes94@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iso-crypto_1.0.0_1605810139143_0.8963298834616433"},"_hasShrinkwrap":false},"1.1.0":{"name":"@pedrouid/iso-crypto","description":"Isomorphic Cryptography Library for AES, HMAC and SHA2","version":"1.1.0","author":{"name":"Pedro Gomes","email":"github.com/pedrouid"},"license":"MIT","keywords":["crypto","cryptography","isomorphic","aes","hmac","sha2"],"main":"dist/cjs/index.js","types":"dist/cjs/index.d.ts","unpkg":"dist/umd/index.min.js","homepage":"https://github.com/pedrouid/iso-crypto","repository":{"type":"git","url":"git+https://github.com/pedrouid/iso-crypto.git"},"bugs":{"url":"https://github.com/pedrouid/iso-crypto/issues"},"scripts":{"start":"tsdx watch","clean":"rm -rf dist","build:cjs":"./node_modules/.bin/tsc -p tsconfig.cjs.json","build:umd":"webpack","build":"yarn clean && yarn build:cjs && yarn build:umd","test":"tsdx test ./test","lint":"tsdx lint src test","prepare":"yarn lint && yarn build && yarn test","publish:beta":"yarn publish --tag=beta"},"dependencies":{"@pedrouid/iso-random":"^1.1.0","aes-js":"^3.1.2","enc-utils":"^3.0.0","hash.js":"^1.1.7"},"devDependencies":{"@peculiar/webcrypto":"^1.1.3","@types/aes-js":"^3.1.1","@types/jest":"^26.0.15","@types/node":"^14.14.7","husky":"^4.3.0","tsdx":"^0.14.1","tslib":"^1.10.0","typescript":"^3.7.5","webpack":"^4.41.6","webpack-cli":"^3.3.11"},"husky":{"hooks":{"pre-commit":"yarn lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"licenseText":"MIT License\n\nCopyright (c) 2020 Pedro Gomes\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"@pedrouid/iso-crypto@1.1.0","dist":{"shasum":"3fb4050ea99f2f8ee41ba8661193c0989c815c95","integrity":"sha512-twi+tW67XT0BSOv4rsegnGo4TQMhfFswS/GY3KhrjFiNw3z9x+cMkfO+itNe1JZghQxsxHuhifvfsnG814g1hQ==","tarball":"https://registry.npmjs.org/@pedrouid/iso-crypto/-/iso-crypto-1.1.0.tgz","fileCount":96,"unpackedSize":671584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPnFOCRA9TVsSAnZWagAAM2cP/3+5M5NV+uHzSeWvIerR\nLyPOQqrof+BWHWhdjAa63ztz7uA0uo8rGKP1Y4fnAC2tf9Mm5kuxZASkBfYS\npRcLvzHaxFGEo/E/A7OvyvsSniK+1ca08hdzI6CdlyhOPD290zC+zOuWH0MD\nc26B66C7nk7iILzwLU5KqzDH8WWssOI4mpvhmvBWHx/e+Vf/dujeWZ9B6GOe\nsqlTu0ZP6Tf1aE3uqeS5US4Leh2EeqcK5Aibgswe/XC26HRCsyVXlvi0Ooqt\n+Chs/jojpDOVArdU4QxE1jEsWjzLpBRCnp5W5D9YyCiF0etSG47LzSB5KzAB\n5lL1q1k87nbPlhCug1XGu0xwNoLiO6agjiil+GB+OGVMwrtrmUWNvchq2fai\nCp6iq+vpqTQjesTxWmiYNZDRM9Vyz57EMelWOF7M6lasGjQHWETKDJe1JqaM\nws6Dl4KlsUZSLChha34ImMrXs/dJA0r8nbJWQnEBAAyBNwY/DPnZY0Gd4K4p\nzW818WZoOD6qJNrsJO6U/1n6rGyE9CaExu8Z6x9SIFmvwLZX/nSXzKFXQJQf\nXuckFo/YwL6aVb5eDLmx7AWqBy0fwNbCxL98dwfm2nVuSlYYAW12lRFOrA2u\n1bShk4swiXiknI9MYQG1I9gmHy7VfqinbbEgbdBLBzty96AP+PXEwHvK/JQN\nW0ul\r\n=XRqw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGFCO9F8F2gCRPiaCOeNSy7pqVJ7c9QxwyMJzwYtZg2LAiEAynxiHKAD5nDrdbHEIHTQTfHdr0hBv8+6vKMb/hfsYJo="}]},"_npmUser":{"name":"pedrouid","email":"pedrogomes94@gmail.com"},"directories":{},"maintainers":[{"name":"pedrouid","email":"pedrogomes94@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iso-crypto_1.1.0_1614704974379_0.9439679986774738"},"_hasShrinkwrap":false},"2.0.0-beta.1":{"name":"@pedrouid/iso-crypto","description":"Isomorphic Cryptography Library for AES, HMAC and SHA2","version":"2.0.0-beta.1","author":{"name":"Pedro Gomes","email":"github.com/pedrouid"},"license":"MIT","keywords":["crypto","cryptography","isomorphic","aes","hmac","sha2"],"main":"dist/cjs/index.js","exports":{".":{"node":"./dist/cjs/node/index.js","browser":"./dist/esm/browser/index.js","default":"./dist/cjs/fallback/index.js"},"./sync":{"node":"./dist/cjs/node/sync.js","browser":"./dist/esm/browser/sync.js","default":"./dist/cjs/fallback/sync.js"}},"types":"dist/cjs/index.d.ts","unpkg":"dist/umd/index.min.js","homepage":"https://github.com/pedrouid/iso-crypto","repository":{"type":"git","url":"git+https://github.com/pedrouid/iso-crypto.git"},"bugs":{"url":"https://github.com/pedrouid/iso-crypto/issues"},"scripts":{"start":"tsdx watch","clean":"rm -rf dist","build:cjs":"yarn tsc -p tsconfig.cjs.json","build:umd":"webpack","build:esm":"yarn tsc -p tsconfig.esm.json","build":"yarn clean && yarn build:cjs && yarn build:umd && yarn build:esm","test":"tsdx test ./test","lint":"tsdx lint src test","prepare":"yarn lint && yarn build && yarn test","publish:beta":"yarn publish --tag=beta"},"dependencies":{"@pedrouid/environment":"^1.0.1","@pedrouid/iso-random":"^1.2.2-beta.1","aes-js":"^3.1.2","enc-utils":"^3.0.0","hash.js":"^1.1.7"},"devDependencies":{"@peculiar/webcrypto":"^1.1.3","@types/aes-js":"^3.1.1","@types/jest":"^26.0.15","@types/node":"^14.14.7","husky":"^4.3.0","tsdx":"^0.14.1","tslib":"^1.10.0","typescript":"^3.7.5","webpack":"^4.41.6","webpack-cli":"^3.3.11"},"husky":{"hooks":{"pre-commit":"yarn lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"readmeFilename":"README.md","readme":"# iso-crypto [![npm version](https://badge.fury.io/js/%40pedrouid%2Fiso-crypto.svg)](https://badge.fury.io/js/%40pedrouid%2Fiso-crypto)\n\nIsomorphic Cryptography Library for AES, HMAC and SHA2\n\n## Description\n\nThis library supports AES, HMAC and SHA2 methods through native NodeJS and Browser APIs when available and fallbacks to vanilla javascript are already provided.\n\n## Usage\n\n### RandomBytes\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\n\nconst length = 32;\nconst key = isoCrypto.randomBytes(length);\n\n// key.length === length\n```\n\n### AES\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\nconst key = isoCrypto.randomBytes(32);\nconst iv = isoCrypto.randomBytes(16);\n\nconst str = 'test message to encrypt';\nconst msg = encUtils.utf8ToArray(str);\n\nconst ciphertext = await isoCrypto.aesCbcEncrypt(iv, key, msg);\n\nconst decrypted = await isoCrypto.aesCbcDecrypt(iv, key, ciphertext);\n\n// decrypted === str\n```\n\n### HMAC\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\nconst key = isoCrypto.randomBytes(32);\nconst iv = isoCrypto.randomBytes(16);\n\nconst macKey = encUtils.concatArrays(iv, key);\nconst dataToMac = encUtils.concatArrays(iv, key, msg);\n\nconst mac = await isoCrypto.hmacSha256Sign(macKey, dataToMac);\n\nconst result = await isoCrypto.hmacSha256Verify(macKey, dataToMac, mac);\n\n// result will return true if match\n```\n\n### SHA2\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\n// SHA256\nconst str = 'test message to hash';\nconst msg = encUtils.utf8ToArray(str);\nconst hash = await isoCrypto.sha256(str);\n\n// SHA512\nconst str = 'test message to hash';\nconst msg = encUtils.utf8ToArray(str);\nconst hash = await isoCrypto.sha512(str);\n```\n\n## React-Native Support\n\nThis library is intended for use in a Browser or NodeJS environment, however it is possible to use in a React-Native environment if NodeJS modules are polyfilled with `react-native-crypto`, read more [here](https://github.com/tradle/react-native-crypto).\n\n## License\n\n[MIT License](LICENSE.md)\n","licenseText":"MIT License\n\nCopyright (c) 2020 Pedro Gomes\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"@pedrouid/iso-crypto@2.0.0-beta.1","dist":{"shasum":"d71ce4c885d10b15cd475a7189b3e4c7f04930e9","integrity":"sha512-C/VBDePrgoqFwOVnm3Pmqibcgm+kp+qDjbcA4iv0o69wD5mm7a0XeY3PkhDFPQJCvUVfafYH1QGZMdj4VW0uhg==","tarball":"https://registry.npmjs.org/@pedrouid/iso-crypto/-/iso-crypto-2.0.0-beta.1.tgz","fileCount":385,"unpackedSize":782793,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgq6HFCRA9TVsSAnZWagAAD+0P/iZxQLt0fyyYn1CikkVx\nWsLq1nisgnp2it1c+Kytpi+Xne8u4xeCZuz72z9JUnvh/Z1glGvawk7uwAJY\n4rhMWSI4lje3jpKjTBc0ux7XrQNEqRUOICuf0CpOR+fMw3lab/PppuJrZ4Dp\nQ6hKsbb5Nc2KMHNVJr9f37WFGWj5fP6ALps5JgyUR3D/XoeYvlo9bO5Qejg+\nMaoYcQfG5mJL8fVCcE45fWcd2aYck3m50It3EBPZ0k5Yw2vEUQTCELMxCEeN\nODYD32vV4DMwdte06GjUOF450VkiMvYH54lOk3A1u+MCVUhzOmDYKdOV2Fbf\nJXpAsrin8kr62xwOb2dLdxoUqu7A03z0T7d4H+iSknArY8Y7hnzzDIyREGo6\nVo5TR7YeR8OG9c3ui2+SzHsIdWI2U1egxvQ1cTBWQwy3P6JPayjrwW868dBc\ndBeNXeOtIYfoZh5r6lbfkicv8ghPiEcI+d0F8uzx8Uugdm3DOxNA/UDDNXkn\nT3ZVygBQbkqiqaMaVp260MWw64E9qDZm37V5jH8YupT44hp3VV+FYfli/Mot\nQFYM7g7RXa5Xd7Md1ZiN7hsFp5l43515HUpzmyxYSsNg13IRHiwwKKX6RRhK\nfCsvm94cUcdbI+UyveMEcSrd9Z9MiqkeGJagXe2pbYjmf7mQc7BAVsNe9Zw4\nX2X9\r\n=w1Av\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9ckjkHxwCHcMK0Hv4V9PmCK1M4yKpQ3mwp4FgOcdknwIhAOlqJ+XgmjhISBX7sy0kFuJ+LmG6JoOhdEsomAde/JQR"}]},"_npmUser":{"name":"pedrouid","email":"pedrogomes94@gmail.com"},"directories":{},"maintainers":[{"name":"pedrouid","email":"pedrogomes94@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iso-crypto_2.0.0-beta.1_1621860805170_0.11751089115386759"},"_hasShrinkwrap":false},"2.0.0-beta.2":{"name":"@pedrouid/iso-crypto","description":"Isomorphic Cryptography Library for AES, HMAC and SHA2","version":"2.0.0-beta.2","author":{"name":"Pedro Gomes","email":"github.com/pedrouid"},"license":"MIT","keywords":["crypto","cryptography","isomorphic","aes","hmac","sha2"],"main":"dist/cjs/node/index.js","exports":{".":{"node":"./dist/cjs/node/index.js","browser":"./dist/esm/browser/index.js","default":"./dist/cjs/fallback/index.js"},"./sync":{"node":"./dist/cjs/node/sync.js","browser":"./dist/esm/browser/sync.js","default":"./dist/cjs/fallback/sync.js"}},"types":"dist/cjs/index.d.ts","unpkg":"dist/umd/index.min.js","homepage":"https://github.com/pedrouid/iso-crypto","repository":{"type":"git","url":"git+https://github.com/pedrouid/iso-crypto.git"},"bugs":{"url":"https://github.com/pedrouid/iso-crypto/issues"},"scripts":{"start":"tsdx watch","clean":"rm -rf dist","build:cjs":"yarn tsc -p tsconfig.cjs.json","build:umd":"webpack","build:esm":"yarn tsc -p tsconfig.esm.json","build":"yarn clean && yarn build:cjs && yarn build:umd && yarn build:esm","test":"tsdx test ./test","lint":"tsdx lint src test","prepare":"yarn lint && yarn build && yarn test","publish:beta":"yarn publish --tag=beta"},"dependencies":{"@pedrouid/environment":"^1.0.1","@pedrouid/iso-random":"^2.0.0-beta.2","aes-js":"^3.1.2","enc-utils":"^3.0.0","hash.js":"^1.1.7"},"devDependencies":{"@peculiar/webcrypto":"^1.1.3","@types/aes-js":"^3.1.1","@types/jest":"^26.0.15","@types/node":"^14.14.7","husky":"^4.3.0","tsdx":"^0.14.1","tslib":"^1.10.0","typescript":"^3.7.5","webpack":"^4.41.6","webpack-cli":"^3.3.11"},"husky":{"hooks":{"pre-commit":"yarn lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"readmeFilename":"README.md","readme":"# iso-crypto [![npm version](https://badge.fury.io/js/%40pedrouid%2Fiso-crypto.svg)](https://badge.fury.io/js/%40pedrouid%2Fiso-crypto)\n\nIsomorphic Cryptography Library for AES, HMAC and SHA2\n\n## Description\n\nThis library supports AES, HMAC and SHA2 methods through native NodeJS and Browser APIs when available and fallbacks to vanilla javascript are already provided.\n\n## Usage\n\n### RandomBytes\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\n\nconst length = 32;\nconst key = isoCrypto.randomBytes(length);\n\n// key.length === length\n```\n\n### AES\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\nconst key = isoCrypto.randomBytes(32);\nconst iv = isoCrypto.randomBytes(16);\n\nconst str = 'test message to encrypt';\nconst msg = encUtils.utf8ToArray(str);\n\nconst ciphertext = await isoCrypto.aesCbcEncrypt(iv, key, msg);\n\nconst decrypted = await isoCrypto.aesCbcDecrypt(iv, key, ciphertext);\n\n// decrypted === str\n```\n\n### HMAC\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\nconst key = isoCrypto.randomBytes(32);\nconst iv = isoCrypto.randomBytes(16);\n\nconst macKey = encUtils.concatArrays(iv, key);\nconst dataToMac = encUtils.concatArrays(iv, key, msg);\n\nconst mac = await isoCrypto.hmacSha256Sign(macKey, dataToMac);\n\nconst result = await isoCrypto.hmacSha256Verify(macKey, dataToMac, mac);\n\n// result will return true if match\n```\n\n### SHA2\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\n// SHA256\nconst str = 'test message to hash';\nconst msg = encUtils.utf8ToArray(str);\nconst hash = await isoCrypto.sha256(str);\n\n// SHA512\nconst str = 'test message to hash';\nconst msg = encUtils.utf8ToArray(str);\nconst hash = await isoCrypto.sha512(str);\n```\n\n## React-Native Support\n\nThis library is intended for use in a Browser or NodeJS environment, however it is possible to use in a React-Native environment if NodeJS modules are polyfilled with `react-native-crypto`, read more [here](https://github.com/tradle/react-native-crypto).\n\n## License\n\n[MIT License](LICENSE.md)\n","licenseText":"MIT License\n\nCopyright (c) 2020 Pedro Gomes\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"@pedrouid/iso-crypto@2.0.0-beta.2","dist":{"shasum":"20075a6fbc6a0364a42c456f510c9bfa7e779896","integrity":"sha512-WT0awwYYenmEuvr4z7vVmjkJcIzEJETx3Vtu2beitEp7ZUvd0WTQF9+sn4ionyebR/GKhJWCPFipGgk9BG+FQw==","tarball":"https://registry.npmjs.org/@pedrouid/iso-crypto/-/iso-crypto-2.0.0-beta.2.tgz","fileCount":385,"unpackedSize":782798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrQicCRA9TVsSAnZWagAAtE8P/0n7CWdYExAdWg0YsKDL\nZbVDP7fBFX8qPMnxC6SPtaUeEJjLAMV79EezBuHQHvImCNkkTNmN6VNxPiFq\nSmq+SESALrYMFft2uF+o5ke4L+ddMDO11FxmjphHsvuVc1GU92eEjIC+NfYh\nAENNRWvUTgxSTrc/apwg71KOWm6gogaNgjiMjoG4DzMJ4owT62vU9l8IuA9T\nixl7ZY0gDkvozfoVXWUZHXFiYs1TlR9CDgKGj3ohk5XoLMAlhKx6nXb9mW5N\nWaZsip07fFP5Y5FQtW5rCyqTk5YewdoQCDFM6ARbcPIsulNCYJks9oLAZ5Xb\nz/FnBrqqzw1QCdpJEuy1bGDX+iaXjsU1Qgh10L66rFy0sHY4FB169iuuhV08\nPdLyGEMo+11zfQB+vFKn7MNxRjN0wdBl6Ubb/2owRj8qFpwP3TGuXguIi1A0\no2t0fqXwHkHwdHGNGrOmSwH7vp3iS8XPjoQGGZuj1aqIGtMhQDhh9cuwWlEE\nPsif+FBLTRRgV5kGzuWQwYR60UxlyUzNVn77apR5OHu31ztIp1hTcLRGaLCi\n8xKQlR7QfW7e9bQycxLaiHyRPjg7yaRPD9/iFiYvejEl+byuuK0hToV0qEus\nv7Wqgr3dZ/nkSa+79r/mGQHOrcBPSoJ5akGSdl/QkXed7JfFPI1IJ5ftw7DI\ninCS\r\n=yywC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFiafellQKMA5GstlFdC2SpXuUuW0kUXep6VLO4l3cW7AiEA0X3oRWL7mSNlM9eArtRPYzrf9TUO0FCOIO21Llq8F80="}]},"_npmUser":{"name":"pedrouid","email":"pedrogomes94@gmail.com"},"directories":{},"maintainers":[{"name":"pedrouid","email":"pedrogomes94@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iso-crypto_2.0.0-beta.2_1621952667644_0.34947172522695213"},"_hasShrinkwrap":false},"2.0.0-beta.3":{"name":"@pedrouid/iso-crypto","description":"Isomorphic Cryptography Library for AES, HMAC and SHA2","version":"2.0.0-beta.3","author":{"name":"Pedro Gomes","email":"github.com/pedrouid"},"license":"MIT","keywords":["crypto","cryptography","isomorphic","aes","hmac","sha2"],"main":"dist/cjs/node/index.js","exports":{".":{"node":"./dist/cjs/node/index.js","browser":"./dist/esm/browser/index.js","default":"./dist/cjs/fallback/index.js"},"./sync":{"node":"./dist/cjs/node/sync.js","browser":"./dist/esm/browser/sync.js","default":"./dist/cjs/fallback/sync.js"}},"types":"dist/cjs/index.d.ts","unpkg":"dist/umd/index.min.js","homepage":"https://github.com/pedrouid/iso-crypto","repository":{"type":"git","url":"git+https://github.com/pedrouid/iso-crypto.git"},"bugs":{"url":"https://github.com/pedrouid/iso-crypto/issues"},"scripts":{"start":"tsdx watch","clean":"rm -rf dist","build:cjs":"yarn tsc -p tsconfig.cjs.json","build:umd":"webpack","build:esm":"yarn tsc -p tsconfig.esm.json","build":"yarn clean && yarn build:cjs && yarn build:umd && yarn build:esm","test":"tsdx test ./test","lint":"tsdx lint src test","prepare":"yarn lint && yarn build && yarn test","publish:beta":"yarn publish --tag=beta"},"dependencies":{"@pedrouid/environment":"^1.0.1","@pedrouid/iso-random":"^2.0.0-beta.3","aes-js":"^3.1.2","enc-utils":"^3.0.0","hash.js":"^1.1.7"},"devDependencies":{"@peculiar/webcrypto":"^1.1.3","@types/aes-js":"^3.1.1","@types/jest":"^26.0.15","@types/node":"^14.14.7","husky":"^4.3.0","tsdx":"^0.14.1","tslib":"^1.10.0","typescript":"^3.7.5","webpack":"^4.41.6","webpack-cli":"^3.3.11"},"husky":{"hooks":{"pre-commit":"yarn lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"readmeFilename":"README.md","readme":"# iso-crypto [![npm version](https://badge.fury.io/js/%40pedrouid%2Fiso-crypto.svg)](https://badge.fury.io/js/%40pedrouid%2Fiso-crypto)\n\nIsomorphic Cryptography Library for AES, HMAC and SHA2\n\n## Description\n\nThis library supports AES, HMAC and SHA2 methods through native NodeJS and Browser APIs when available and fallbacks to vanilla javascript are already provided.\n\n## Usage\n\n### RandomBytes\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\n\nconst length = 32;\nconst key = isoCrypto.randomBytes(length);\n\n// key.length === length\n```\n\n### AES\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\nconst key = isoCrypto.randomBytes(32);\nconst iv = isoCrypto.randomBytes(16);\n\nconst str = 'test message to encrypt';\nconst msg = encUtils.utf8ToArray(str);\n\nconst ciphertext = await isoCrypto.aesCbcEncrypt(iv, key, msg);\n\nconst decrypted = await isoCrypto.aesCbcDecrypt(iv, key, ciphertext);\n\n// decrypted === str\n```\n\n### HMAC\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\nconst key = isoCrypto.randomBytes(32);\nconst iv = isoCrypto.randomBytes(16);\n\nconst macKey = encUtils.concatArrays(iv, key);\nconst dataToMac = encUtils.concatArrays(iv, key, msg);\n\nconst mac = await isoCrypto.hmacSha256Sign(macKey, dataToMac);\n\nconst result = await isoCrypto.hmacSha256Verify(macKey, dataToMac, mac);\n\n// result will return true if match\n```\n\n### SHA2\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\n// SHA256\nconst str = 'test message to hash';\nconst msg = encUtils.utf8ToArray(str);\nconst hash = await isoCrypto.sha256(str);\n\n// SHA512\nconst str = 'test message to hash';\nconst msg = encUtils.utf8ToArray(str);\nconst hash = await isoCrypto.sha512(str);\n```\n\n## React-Native Support\n\nThis library is intended for use in a Browser or NodeJS environment, however it is possible to use in a React-Native environment if NodeJS modules are polyfilled with `react-native-crypto`, read more [here](https://github.com/tradle/react-native-crypto).\n\n## License\n\n[MIT License](LICENSE.md)\n","licenseText":"MIT License\n\nCopyright (c) 2020 Pedro Gomes\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"@pedrouid/iso-crypto@2.0.0-beta.3","dist":{"shasum":"43b31ca95042fb0b2a9a63165b4b7525a8610b67","integrity":"sha512-UxlNeXoH5641ZwCeMHSqkELJIYWlWyMaVPhwwSTLZjVNIpxWA78bgEXYwQP1Ef70rTveV1LudV2JDsStq8+igQ==","tarball":"https://registry.npmjs.org/@pedrouid/iso-crypto/-/iso-crypto-2.0.0-beta.3.tgz","fileCount":385,"unpackedSize":782798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrRRhCRA9TVsSAnZWagAAxw0P/RyWJ4zFIihm9kks5DtO\nQa7PuDB3s97EVMS2N/Fqb5dlvG/Bcm4DipI3WBR4yj3i2lsZUwLxVMK9exK7\n53PY2rvpwbxFxHfUh2YXDxeuaMKljwx2MtmhkJcm7LRVgVZsdMHq/A315Apr\nJRRKwTZlPPum3KxyMX6ve1GXaO2y4CSvSehUP+h5LjlyCFud2n3b3PZnjWIY\n/dFPYGrKWooaGQAKYm0QTWuS1iPQB4yjAbWIoLTKlrq+tTOLT4Yc1DzboGuN\n5ZRqcpGnZz8fbJe55lxga6s9IoTGd4JzxBjX9bnk4xwR5BV/610rDUrqzkxE\nQNAgyIDv6vVPHGIAfF2U+1YSxKpDp20icB9aDtnD2KMrRbrJcxIoVHlHGZi9\nb5SStCTSdKxPCoT9GukbhqUCdR/EZDloUf1sNPp1EvKijfNDD5s6bTZ4hab8\nMMETIG6hw11gSajU1d5q08YFH0DAiE+eMaBuXUQNuZPBD9ArlYCkXqdpkZDr\nBqtMll4fiXb4n6b5tdIrjuevT5qBzh4Avj/mN6chGDq4+3fKHSctGmX2oC3E\nkE6kXQYmO1jrj8FIm3BDO1i/XAnuR3vwyPmpTGV78R/lC0w+jxMauRPNwKoA\nFuEqXKQilPSriUpjOmQwQhxtegl8fPUhp0q1gGXiKQc5GfyqbjF9qh5pxs5y\nQGa8\r\n=2fUg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC/aWO7ui5OeE2+CbPi9MI+0fcblSDvcoFZVpu4rSJ0uAiEAu3RYGWNsHUt7/woXZA/iczenTVrrsRYduZH15PlreHI="}]},"_npmUser":{"name":"pedrouid","email":"pedrogomes94@gmail.com"},"directories":{},"maintainers":[{"name":"pedrouid","email":"pedrogomes94@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iso-crypto_2.0.0-beta.3_1621955680911_0.8952013582227916"},"_hasShrinkwrap":false},"2.0.0-beta.4":{"name":"@pedrouid/iso-crypto","description":"Isomorphic Cryptography Library for AES, HMAC and SHA2","version":"2.0.0-beta.4","author":{"name":"Pedro Gomes","email":"github.com/pedrouid"},"license":"MIT","keywords":["crypto","cryptography","isomorphic","aes","hmac","sha2"],"main":"dist/cjs/node/index.js","module":"dist/esm/node/index.js","browser":"dist/esm/browser/index.js","types":"./dist/cjs/node/index.d.ts","unpkg":"dist/umd/index.min.js","exports":{".":{"types":"./dist/cjs/node/index.d.ts","node":"./dist/cjs/node/index.js","browser":"./dist/esm/browser/index.js","default":"./dist/cjs/fallback/index.js"},"./sync":{"types":"./dist/cjs/node/sync.d.ts","node":"./dist/cjs/node/sync.js","browser":"./dist/esm/browser/sync.js","default":"./dist/cjs/fallback/sync.js"}},"homepage":"https://github.com/pedrouid/iso-crypto","repository":{"type":"git","url":"git+https://github.com/pedrouid/iso-crypto.git"},"bugs":{"url":"https://github.com/pedrouid/iso-crypto/issues"},"scripts":{"start":"tsdx watch","clean":"rm -rf dist","build:cjs":"yarn tsc -p tsconfig.cjs.json","build:umd":"webpack","build:esm":"yarn tsc -p tsconfig.esm.json","build":"yarn clean && yarn build:cjs && yarn build:umd && yarn build:esm","test":"tsdx test ./test","lint":"tsdx lint src test","prepare":"yarn lint && yarn build && yarn test","publish:beta":"yarn publish --tag=beta"},"dependencies":{"@pedrouid/environment":"^1.0.1","@pedrouid/iso-random":"^2.0.0-beta.5","aes-js":"^3.1.2","enc-utils":"^3.0.0","hash.js":"^1.1.7"},"devDependencies":{"@peculiar/webcrypto":"^1.1.3","@types/aes-js":"^3.1.1","@types/jest":"^26.0.15","@types/node":"^14.14.7","husky":"^4.3.0","tsdx":"^0.14.1","tslib":"^1.10.0","typescript":"^3.7.5","webpack":"^4.41.6","webpack-cli":"^3.3.11"},"husky":{"hooks":{"pre-commit":"yarn lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"readmeFilename":"README.md","readme":"# iso-crypto [![npm version](https://badge.fury.io/js/%40pedrouid%2Fiso-crypto.svg)](https://badge.fury.io/js/%40pedrouid%2Fiso-crypto)\n\nIsomorphic Cryptography Library for AES, HMAC and SHA2\n\n## Description\n\nThis library supports AES, HMAC and SHA2 methods through native NodeJS and Browser APIs when available and fallbacks to vanilla javascript are already provided.\n\n## Usage\n\n### RandomBytes\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\n\nconst length = 32;\nconst key = isoCrypto.randomBytes(length);\n\n// key.length === length\n```\n\n### AES\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\nconst key = isoCrypto.randomBytes(32);\nconst iv = isoCrypto.randomBytes(16);\n\nconst str = 'test message to encrypt';\nconst msg = encUtils.utf8ToArray(str);\n\nconst ciphertext = await isoCrypto.aesCbcEncrypt(iv, key, msg);\n\nconst decrypted = await isoCrypto.aesCbcDecrypt(iv, key, ciphertext);\n\n// decrypted === str\n```\n\n### HMAC\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\nconst key = isoCrypto.randomBytes(32);\nconst iv = isoCrypto.randomBytes(16);\n\nconst macKey = encUtils.concatArrays(iv, key);\nconst dataToMac = encUtils.concatArrays(iv, key, msg);\n\nconst mac = await isoCrypto.hmacSha256Sign(macKey, dataToMac);\n\nconst result = await isoCrypto.hmacSha256Verify(macKey, dataToMac, mac);\n\n// result will return true if match\n```\n\n### SHA2\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\n// SHA256\nconst str = 'test message to hash';\nconst msg = encUtils.utf8ToArray(str);\nconst hash = await isoCrypto.sha256(str);\n\n// SHA512\nconst str = 'test message to hash';\nconst msg = encUtils.utf8ToArray(str);\nconst hash = await isoCrypto.sha512(str);\n```\n\n## React-Native Support\n\nThis library is intended for use in a Browser or NodeJS environment, however it is possible to use in a React-Native environment if NodeJS modules are polyfilled with `react-native-crypto`, read more [here](https://github.com/tradle/react-native-crypto).\n\n## License\n\n[MIT License](LICENSE.md)\n","licenseText":"MIT License\n\nCopyright (c) 2020 Pedro Gomes\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"@pedrouid/iso-crypto@2.0.0-beta.4","dist":{"shasum":"7a4efd5e489a36ab1ae6603dae92142b2a00463e","integrity":"sha512-zkaSSKdmkzVZHwd1pgCqNpDmLRVSv4QbKWwYocW3CYCzKal/u1sU5giXouxy42Zwc/8+hEkX4t1W9KhHCKbiwQ==","tarball":"https://registry.npmjs.org/@pedrouid/iso-crypto/-/iso-crypto-2.0.0-beta.4.tgz","fileCount":374,"unpackedSize":355450,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguS6ACRA9TVsSAnZWagAAoEMP/j8JRVn6lMwbhk11HtpM\nDorgTzaX36q513vfZu2E7mY51oE9Fyp6D8ETMSMtolQvuKHJfBFgr+cv3fJ4\n0VOHOp+Xb2njZ3gnuNSIRYE+TZFvpeOkk9MsjTudu4RtdVCgjgz3bg6DGkpz\nenkpQ7xLpdWHzpRRHeeCII2EBP0UuRoBaop5Xlvnmy04CajOYiiFJa0QjHbz\nb/ahzuzxsREUIxJOSLk3NeWQ1EOgHxeDmYFUhk07cw13Sj+CE7q1F4DMQx6x\nExdADRVC+EBYBYbEoje3dKRO0RUbPyyMktn5LSy1dxY6yBB44stdcDxOvOOh\nioAqa6TjCMIgFdwArhY0TkN4ljGAG7TuvLnurzdrYkUarLyIZ+6RYlT1sQvo\nN3Xi7mjwtHHYwBd5atKgHnlbHKPru8SzroeqeEJ+Db5oZMuZp766wUzqdlsm\nGbYtbXGIFM9/PmYZ87xwTr3o+OUPcjneEOtBqaMx28jAGhTU4Lyg71d3Qge1\nuSb42xIVEslkzXOlauhv5ai7PbMR3uEeqEz/yI9qLmMfyUHscfzRfulPpYTN\nf+GQkz+OzH9nn03u/Gn81lEhZ+VoNmeGf6rHlJ3+Q7+oJtGPcK4rH/W0EZRy\nbkinSEa7yd1z3ruShkEMjb/a9gaeOnVSrwkHDhNSgPUQdd8YMYbwjFJj2P1N\nTxPr\r\n=rfFo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMjsJ8ZCajp+eHsyFTHA6Q56YJ+MQfbXjeGN+2sjJTQwIhAP6YW/D62HoyBgIXgNHYpU/3AX23TtXnUKl6SYyHGES4"}]},"_npmUser":{"name":"pedrouid","email":"pedrogomes94@gmail.com"},"directories":{},"maintainers":[{"name":"pedrouid","email":"pedrogomes94@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iso-crypto_2.0.0-beta.4_1622748799779_0.4835135799259982"},"_hasShrinkwrap":false},"2.0.0-beta.5":{"name":"@pedrouid/iso-crypto","description":"Isomorphic Cryptography Library for AES, HMAC and SHA2","version":"2.0.0-beta.5","author":{"name":"Pedro Gomes","email":"github.com/pedrouid"},"license":"MIT","keywords":["crypto","cryptography","isomorphic","aes","hmac","sha2"],"main":"dist/cjs/node/index.js","module":"dist/esm/node/index.js","browser":"dist/esm/browser/index.js","types":"./dist/cjs/node/index.d.ts","unpkg":"dist/umd/index.min.js","exports":{".":{"types":"./dist/cjs/node/index.d.ts","node":"./dist/cjs/node/index.js","browser":"./dist/esm/browser/index.js","default":"./dist/cjs/fallback/index.js"},"./sync":{"types":"./dist/cjs/node/sync.d.ts","node":"./dist/cjs/node/sync.js","browser":"./dist/esm/browser/sync.js","default":"./dist/cjs/fallback/sync.js"}},"homepage":"https://github.com/pedrouid/iso-crypto","repository":{"type":"git","url":"git+https://github.com/pedrouid/iso-crypto.git"},"bugs":{"url":"https://github.com/pedrouid/iso-crypto/issues"},"scripts":{"start":"tsdx watch","clean":"rm -rf dist","build:cjs":"yarn tsc -p tsconfig.cjs.json","build:umd":"webpack","build:esm":"yarn tsc -p tsconfig.esm.json","build":"yarn clean && yarn build:cjs && yarn build:umd && yarn build:esm","test":"tsdx test ./test","lint":"tsdx lint src test","prepare":"yarn lint && yarn build && yarn test","publish:beta":"yarn publish --tag=beta"},"dependencies":{"@pedrouid/environment":"^1.0.1","@pedrouid/iso-random":"^2.0.0-beta.5","aes-js":"^3.1.2","enc-utils":"^3.0.0","hash.js":"^1.1.7"},"devDependencies":{"@peculiar/webcrypto":"^1.1.3","@types/aes-js":"^3.1.1","@types/jest":"^26.0.15","@types/node":"^14.14.7","husky":"^4.3.0","tsdx":"^0.14.1","tslib":"^1.10.0","typescript":"^3.7.5","webpack":"^4.41.6","webpack-cli":"^3.3.11"},"husky":{"hooks":{"pre-commit":"yarn lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"readmeFilename":"README.md","readme":"# iso-crypto [![npm version](https://badge.fury.io/js/%40pedrouid%2Fiso-crypto.svg)](https://badge.fury.io/js/%40pedrouid%2Fiso-crypto)\n\nIsomorphic Cryptography Library for AES, HMAC and SHA2\n\n## Description\n\nThis library supports AES, HMAC and SHA2 methods through native NodeJS and Browser APIs when available and fallbacks to vanilla javascript are already provided.\n\n## Usage\n\n### RandomBytes\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\n\nconst length = 32;\nconst key = isoCrypto.randomBytes(length);\n\n// key.length === length\n```\n\n### AES\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\nconst key = isoCrypto.randomBytes(32);\nconst iv = isoCrypto.randomBytes(16);\n\nconst str = 'test message to encrypt';\nconst msg = encUtils.utf8ToArray(str);\n\nconst ciphertext = await isoCrypto.aesCbcEncrypt(iv, key, msg);\n\nconst decrypted = await isoCrypto.aesCbcDecrypt(iv, key, ciphertext);\n\n// decrypted === str\n```\n\n### HMAC\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\nconst key = isoCrypto.randomBytes(32);\nconst iv = isoCrypto.randomBytes(16);\n\nconst macKey = encUtils.concatArrays(iv, key);\nconst dataToMac = encUtils.concatArrays(iv, key, msg);\n\nconst mac = await isoCrypto.hmacSha256Sign(macKey, dataToMac);\n\nconst result = await isoCrypto.hmacSha256Verify(macKey, dataToMac, mac);\n\n// result will return true if match\n```\n\n### SHA2\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\n// SHA256\nconst str = 'test message to hash';\nconst msg = encUtils.utf8ToArray(str);\nconst hash = await isoCrypto.sha256(str);\n\n// SHA512\nconst str = 'test message to hash';\nconst msg = encUtils.utf8ToArray(str);\nconst hash = await isoCrypto.sha512(str);\n```\n\n## React-Native Support\n\nThis library is intended for use in a Browser or NodeJS environment, however it is possible to use in a React-Native environment if NodeJS modules are polyfilled with `react-native-crypto`, read more [here](https://github.com/tradle/react-native-crypto).\n\n## License\n\n[MIT License](LICENSE.md)\n","licenseText":"MIT License\n\nCopyright (c) 2020 Pedro Gomes\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"@pedrouid/iso-crypto@2.0.0-beta.5","dist":{"shasum":"67dfa89b68456ff0a360ccb7a0b1f7613e3fafea","integrity":"sha512-fAoQunzXXyI1zwSe1bpFdyLPizvn5jAGwzgdAnkM9QF6lCHHwczF72+jMb5NWHliPLgYXydRah46vcfI6VtQuw==","tarball":"https://registry.npmjs.org/@pedrouid/iso-crypto/-/iso-crypto-2.0.0-beta.5.tgz","fileCount":377,"unpackedSize":355733,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguTC9CRA9TVsSAnZWagAA+goQAKO2S1HtTfoN0rrkyvAB\nwL4u9O/AQWFGoDTolqFRBqrTlQZcJvb5RkNPM4ghnXcVkXgWDjsecZuWu93q\nQCauvocpGskQBtnca9SiJjfU7Vesk7IaEuWspiaWpecux1O01Yx/OCEhO9hc\nx504jsq3CbhSXxlwqZDKiYHnjoGC+X/RM2t/Bkdou3ACbjbYbtdzwVsv7QpI\nrxXawhWhobn/ss8nV5htSlJpEdhzJuEJ2uaXU3QQSokbInHaNipyHbKM+/V8\nT2kIiUCjfyBXv1fk5S6qTJ0iBSYrWnbYOvxBQAc9ruKKhTV4wtKE3jzvYcd6\niAy7xCisLLZ5C9mJSEEWdvJ0o6MkkG5eO7YSlKNy0pXRgdooPgKbN0XhTVV+\naCN/2T36NQ5A6yqHNTC9nq2dEuyoZ0eMi0HsJz6jqmYKqO7YeF58TeAbDQru\na1Z2S1VxQgD+256HnxzQv+Y1N1QOfE5tC6UXb+llizaDjo4qsYoplp9C4cJ8\ncTBBCqGiur1cPtoNeA803m7itBPAo7TQGJcwb7IbCjZKd2SnNy2iab/JGlbE\npNMD7DwjAsQYu75+PC+jv8w6xCGN681CMIzk3nzfcwiswOrcZ6NXPM2J4rKk\n9MiM8Wv7flmma4biNh9bZB3a8sKhiF7R4PJtFCH6EbrTyJrqyt6nxfrNfeBy\ndg72\r\n=TNqW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICmIHgM6N7zZFdq4fNVtKr1IyNNG1oUFgjw33r8zm8J0AiBskLlXBN20vIVRlNLJAKA+BcJ2JWQGE0ZJo88tHV1FqQ=="}]},"_npmUser":{"name":"pedrouid","email":"pedrogomes94@gmail.com"},"directories":{},"maintainers":[{"name":"pedrouid","email":"pedrogomes94@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iso-crypto_2.0.0-beta.5_1622749373125_0.8402685399666505"},"_hasShrinkwrap":false},"2.0.0-beta.6":{"name":"@pedrouid/iso-crypto","description":"Isomorphic Cryptography Library for AES, HMAC and SHA2","version":"2.0.0-beta.6","author":{"name":"Pedro Gomes","email":"github.com/pedrouid"},"license":"MIT","keywords":["crypto","cryptography","isomorphic","aes","hmac","sha2"],"main":"dist/cjs/node/index.js","react-native":"dist/cjs/node/index.js","module":"dist/esm/node/index.js","browser":"dist/esm/browser/index.js","types":"./dist/cjs/node/index.d.ts","unpkg":"dist/umd/index.min.js","exports":{".":{"types":"./dist/cjs/node/index.d.ts","node":"./dist/cjs/node/index.js","react-native":"./dist/cjs/node/index.js","browser":"./dist/esm/browser/index.js","default":"./dist/cjs/fallback/index.js"},"./sync":{"types":"./dist/cjs/node/sync.d.ts","node":"./dist/cjs/node/sync.js","react-native":"./dist/cjs/node/sync.js","browser":"./dist/esm/browser/sync.js","default":"./dist/cjs/fallback/sync.js"}},"homepage":"https://github.com/pedrouid/iso-crypto","repository":{"type":"git","url":"git+https://github.com/pedrouid/iso-crypto.git"},"bugs":{"url":"https://github.com/pedrouid/iso-crypto/issues"},"scripts":{"start":"tsdx watch","clean":"rm -rf dist","build:cjs":"yarn tsc -p tsconfig.cjs.json","build:umd":"webpack","build:esm":"yarn tsc -p tsconfig.esm.json","build":"yarn clean && yarn build:cjs && yarn build:umd && yarn build:esm","test":"tsdx test ./test","lint":"tsdx lint src test","prepare":"yarn lint && yarn build && yarn test","publish:beta":"yarn publish --tag=beta"},"dependencies":{"@pedrouid/environment":"^1.0.1","@pedrouid/iso-random":"^2.0.0-beta.6","aes-js":"^3.1.2","enc-utils":"^3.0.0","hash.js":"^1.1.7"},"devDependencies":{"@peculiar/webcrypto":"^1.1.3","@types/aes-js":"^3.1.1","@types/jest":"^26.0.15","@types/node":"^14.14.7","husky":"^4.3.0","tsdx":"^0.14.1","tslib":"^1.10.0","typescript":"^3.7.5","webpack":"^4.41.6","webpack-cli":"^3.3.11"},"husky":{"hooks":{"pre-commit":"yarn lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"readmeFilename":"README.md","readme":"# iso-crypto [![npm version](https://badge.fury.io/js/%40pedrouid%2Fiso-crypto.svg)](https://badge.fury.io/js/%40pedrouid%2Fiso-crypto)\n\nIsomorphic Cryptography Library for AES, HMAC and SHA2\n\n## Description\n\nThis library supports AES, HMAC and SHA2 methods through native NodeJS and Browser APIs when available and fallbacks to vanilla javascript are already provided.\n\n## Usage\n\n### RandomBytes\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\n\nconst length = 32;\nconst key = isoCrypto.randomBytes(length);\n\n// key.length === length\n```\n\n### AES\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\nconst key = isoCrypto.randomBytes(32);\nconst iv = isoCrypto.randomBytes(16);\n\nconst str = 'test message to encrypt';\nconst msg = encUtils.utf8ToArray(str);\n\nconst ciphertext = await isoCrypto.aesCbcEncrypt(iv, key, msg);\n\nconst decrypted = await isoCrypto.aesCbcDecrypt(iv, key, ciphertext);\n\n// decrypted === str\n```\n\n### HMAC\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\nconst key = isoCrypto.randomBytes(32);\nconst iv = isoCrypto.randomBytes(16);\n\nconst macKey = encUtils.concatArrays(iv, key);\nconst dataToMac = encUtils.concatArrays(iv, key, msg);\n\nconst mac = await isoCrypto.hmacSha256Sign(macKey, dataToMac);\n\nconst result = await isoCrypto.hmacSha256Verify(macKey, dataToMac, mac);\n\n// result will return true if match\n```\n\n### SHA2\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\n// SHA256\nconst str = 'test message to hash';\nconst msg = encUtils.utf8ToArray(str);\nconst hash = await isoCrypto.sha256(str);\n\n// SHA512\nconst str = 'test message to hash';\nconst msg = encUtils.utf8ToArray(str);\nconst hash = await isoCrypto.sha512(str);\n```\n\n## React-Native Support\n\nThis library is intended for use in a Browser or NodeJS environment, however it is possible to use in a React-Native environment if NodeJS modules are polyfilled with `react-native-crypto`, read more [here](https://github.com/tradle/react-native-crypto).\n\n## License\n\n[MIT License](LICENSE.md)\n","licenseText":"MIT License\n\nCopyright (c) 2020 Pedro Gomes\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"@pedrouid/iso-crypto@2.0.0-beta.6","dist":{"shasum":"4d13b53bac8332915f65126261b54c2c53a66682","integrity":"sha512-Hw/MXaCklBV+MQmE7DRHoqMY4M8dMMc4iT1KIicHLB9XWbLRWSPHtQocapGoLQhM/JIz8TAvVqsZx6qyHevvpg==","tarball":"https://registry.npmjs.org/@pedrouid/iso-crypto/-/iso-crypto-2.0.0-beta.6.tgz","fileCount":377,"unpackedSize":355876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyjlbCRA9TVsSAnZWagAAiMMP/RPQNguYa/d57ojKjSSY\nByAFsPM86L4YBnw+RIuImSP3WNulkDaX4f6RAvn5ESYrmxZ2iqrKdHEhDjpp\nA1Qnpex3WHAEjOY3RCqkbO5alnnAr58vMD972gcj/M+/RQPaIVhmZWjcQ4MA\n81izxj5RLcPOEgS9XGj4/dOaHgFAnKSRF8Zfcbx+FXXTJFRFt3Gdc3J1FaYn\nv0n32Ok515mjMN66D+JgB8fmT471dSP5f5fwTDUtCqXqmBWJJbeF8WoabsYP\naFoGIJ+uxnTSaPfK9RlXRJZu/NQcDBjkhAo5fE9/qxpHMLcAh+RYu66xp0ew\nLj8NkbNaB9jakDKNfRZujtykqYtqa/JDPZR5LP2MBk73qeDJFf3msoDCAXuk\nlLvxuBgsm9tYA26pLptR+tZ1s/Z+NoYQV0iphs6I7/XKCIOTeLJH5cMO/vDX\no+E9b/h/BnyaA1f0kxd7DQwgqCnoxrXYanE5XMVICJuxQBxsqYNfzHkK/yZd\nJm04dgNb88YAnAB9BKqucvrEm1c9KKG55+6jKwZbuTPjA5xrPSQmebbHuDK6\ngtICPfKmPIdQnRoWRPjVMP/yQVTu3wBV+IUFKm5DK0H0MdPUiQeYyjiKMAYG\n16ZFL4ojZcschpVQ/nJHmtquDVuKi784jYKFeO2vJOfloNSrKrjxtcOWGoXa\nAiX1\r\n=ldnH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxorPvyxuGxmTS21Oysx62TL0vwAMgaUzHniWKbZ0MwgIhAIxYP/s7OR+vmmocGcM2Bl3daqwGiMN6HICg4md5Scon"}]},"_npmUser":{"name":"pedrouid","email":"pedrogomes94@gmail.com"},"directories":{},"maintainers":[{"name":"pedrouid","email":"pedrogomes94@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iso-crypto_2.0.0-beta.6_1623865690868_0.6982889843086351"},"_hasShrinkwrap":false},"2.0.0-beta.7":{"name":"@pedrouid/iso-crypto","description":"Isomorphic Cryptography Library for AES, HMAC and SHA2","version":"2.0.0-beta.7","author":{"name":"Pedro Gomes","email":"github.com/pedrouid"},"license":"MIT","keywords":["crypto","cryptography","isomorphic","aes","hmac","sha2"],"main":"dist/cjs/node/index.js","react-native":"dist/cjs/node/index.js","module":"dist/esm/node/index.js","browser":"dist/esm/browser/index.js","types":"./dist/cjs/node/index.d.ts","unpkg":"dist/umd/index.min.js","exports":{".":{"types":"./dist/cjs/node/index.d.ts","node":"./dist/cjs/node/index.js","react-native":"./dist/cjs/node/index.js","browser":"./dist/esm/browser/index.js","default":"./dist/cjs/fallback/index.js"},"./sync":{"types":"./dist/cjs/node/sync.d.ts","node":"./dist/cjs/node/sync.js","react-native":"./dist/cjs/node/sync.js","browser":"./dist/esm/browser/sync.js","default":"./dist/cjs/fallback/sync.js"}},"homepage":"https://github.com/pedrouid/iso-crypto","repository":{"type":"git","url":"git+https://github.com/pedrouid/iso-crypto.git"},"bugs":{"url":"https://github.com/pedrouid/iso-crypto/issues"},"scripts":{"start":"tsdx watch","clean":"rm -rf dist","build:cjs":"yarn tsc -p tsconfig.cjs.json","build:umd":"webpack","build:esm":"yarn tsc -p tsconfig.esm.json","build":"yarn clean && yarn build:cjs && yarn build:umd && yarn build:esm","test":"tsdx test ./test","lint":"tsdx lint src test","prepare":"yarn lint && yarn build && yarn test","publish:beta":"yarn publish --tag=beta"},"dependencies":{"@pedrouid/environment":"^1.0.1","@pedrouid/iso-random":"^2.0.0-beta.6","aes-js":"^3.1.2","enc-utils":"^3.0.0","hash.js":"^1.1.7"},"devDependencies":{"@peculiar/webcrypto":"^1.1.3","@types/aes-js":"^3.1.1","@types/jest":"^26.0.15","@types/node":"^14.14.7","husky":"^4.3.0","tsdx":"^0.14.1","tslib":"^1.10.0","typescript":"^3.7.5","webpack":"^4.41.6","webpack-cli":"^3.3.11"},"husky":{"hooks":{"pre-commit":"yarn lint"}},"prettier":{"printWidth":80,"semi":true,"singleQuote":true,"trailingComma":"es5"},"readmeFilename":"README.md","readme":"# iso-crypto [![npm version](https://badge.fury.io/js/%40pedrouid%2Fiso-crypto.svg)](https://badge.fury.io/js/%40pedrouid%2Fiso-crypto)\n\nIsomorphic Cryptography Library for AES, HMAC and SHA2\n\n## Description\n\nThis library supports AES, HMAC and SHA2 methods through native NodeJS and Browser APIs when available and fallbacks to vanilla javascript are already provided.\n\n## Usage\n\n### RandomBytes\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\n\nconst length = 32;\nconst key = isoCrypto.randomBytes(length);\n\n// key.length === length\n```\n\n### AES\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\nconst key = isoCrypto.randomBytes(32);\nconst iv = isoCrypto.randomBytes(16);\n\nconst str = 'test message to encrypt';\nconst msg = encUtils.utf8ToArray(str);\n\nconst ciphertext = await isoCrypto.aesCbcEncrypt(iv, key, msg);\n\nconst decrypted = await isoCrypto.aesCbcDecrypt(iv, key, ciphertext);\n\n// decrypted === str\n```\n\n### HMAC\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\nconst key = isoCrypto.randomBytes(32);\nconst iv = isoCrypto.randomBytes(16);\n\nconst macKey = encUtils.concatArrays(iv, key);\nconst dataToMac = encUtils.concatArrays(iv, key, msg);\n\nconst mac = await isoCrypto.hmacSha256Sign(macKey, dataToMac);\n\nconst result = await isoCrypto.hmacSha256Verify(macKey, dataToMac, mac);\n\n// result will return true if match\n```\n\n### SHA2\n\n```typescript\nimport * as isoCrypto from 'iso-crypto';\nimport * as encUtils from 'enc-utils';\n\n// SHA256\nconst str = 'test message to hash';\nconst msg = encUtils.utf8ToArray(str);\nconst hash = await isoCrypto.sha256(str);\n\n// SHA512\nconst str = 'test message to hash';\nconst msg = encUtils.utf8ToArray(str);\nconst hash = await isoCrypto.sha512(str);\n```\n\n## React-Native Support\n\nThis library is intended for use in a Browser or NodeJS environment, however it is possible to use in a React-Native environment if NodeJS modules are polyfilled with `react-native-crypto`, read more [here](https://github.com/tradle/react-native-crypto).\n\n## License\n\n[MIT License](LICENSE.md)\n","licenseText":"MIT License\n\nCopyright (c) 2020 Pedro Gomes\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"@pedrouid/iso-crypto@2.0.0-beta.7","dist":{"shasum":"dc100f002eb4d1635e3399d03843439e497f648e","integrity":"sha512-5FxV0kH1gWeI+ejAh3yub/niB/ecxdtUUw8BvKFsPNjNHYF4Zz7zMa1EcSSjOri5D/mw6PLW/Vp+3I2wfeICcw==","tarball":"https://registry.npmjs.org/@pedrouid/iso-crypto/-/iso-crypto-2.0.0-beta.7.tgz","fileCount":377,"unpackedSize":356742,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8DudCRA9TVsSAnZWagAAqEwP/0ho+JpaAplwAxPUuSDA\nJ0iI+hMTzl1c18tiiMJKuO+lSqs09lWSLQlD1JOSPERMu70gZXX70XO+PfQY\n+3D7OJQg5Y3ifT9QkxxWkaxBRlDeKawJ0nNXm4GFqXFgo+JtR5UHvcbkCI5s\niHSHyfYmSgODQYxwJuyw5ieIfri8m0c9zl21tAMvtFRQLMi7mEn/gLVif/Q/\nO0XicGmsW/EeXQuB/9pQqaw++fbTLlRpjuQoMuzoLx4XhVEJDbPnlNY843GO\n01FeibTwVbKz3ikPwOEh2OZd0iU1V8yzZ01JVXO37fwSWu1SDOM7y/Z6ccTF\nrcf1gWG6PFP4ZTw9o9VGhgD1ndLUiT1ZC8SMmT1iomPiB4RcYL/e4Ni/DK8Z\nlHIBDJ3jkJc71Jtffzpyym+BkyjR/GpiXKP+HW94cPDBuogg0VPSxe0HzIPT\n+n46fkjJfk25U/yXT2eKqy4VejGwuez3c8Mj9hPfBqk5AUAEhTFtRmSKjGWt\ngWejCcghTf5+2wa/tOBAykR7vTFiiMvJT6FINZNprsHtWNO2NwMXUcTfhzA5\n9v4IX6tWOMNzAp1rLI/8uEphWnYjoiThejcL1ZUCZe/6T7synnsv8mi6Af6e\nj6r7Npea94U6Exx90zc5v6S94qbGOFPGoCK80ClO03JojpASaNCQBJn+UEwN\nPz4l\r\n=1PNU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKh1ogDIPQuosoBAvbDXzJ8eeYbnwSCr6IGV0I/FzeYgIgEkYF5ATHsS/vBIzjT2zicDC1iV0VmRN66nse3qIJABg="}]},"_npmUser":{"name":"pedrouid","email":"pedrogomes94@gmail.com"},"directories":{},"maintainers":[{"name":"pedrouid","email":"pedrogomes94@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/iso-crypto_2.0.0-beta.7_1626356637751_0.4512943890476073"},"_hasShrinkwrap":false}},"time":{"created":"2020-11-19T18:22:18.996Z","1.0.0":"2020-11-19T18:22:19.408Z","modified":"2022-04-06T13:47:24.311Z","1.1.0":"2021-03-02T17:09:34.616Z","2.0.0-beta.1":"2021-05-24T12:53:25.357Z","2.0.0-beta.2":"2021-05-25T14:24:27.848Z","2.0.0-beta.3":"2021-05-25T15:14:41.109Z","2.0.0-beta.4":"2021-06-03T19:33:20.095Z","2.0.0-beta.5":"2021-06-03T19:42:53.272Z","2.0.0-beta.6":"2021-06-16T17:48:11.010Z","2.0.0-beta.7":"2021-07-15T13:43:57.966Z"},"maintainers":[{"name":"pedrouid","email":"pedrogomes94@gmail.com"}],"description":"Isomorphic Cryptography Library for AES, HMAC and SHA2","homepage":"https://github.com/pedrouid/iso-crypto","keywords":["crypto","cryptography","isomorphic","aes","hmac","sha2"],"repository":{"type":"git","url":"git+https://github.com/pedrouid/iso-crypto.git"},"author":{"name":"Pedro Gomes","email":"github.com/pedrouid"},"bugs":{"url":"https://github.com/pedrouid/iso-crypto/issues"},"license":"MIT","readme":"","readmeFilename":""}