{"_id":"n-crypto","_rev":"11-db3e400c1a2071a4aaf8595e38e69392","name":"n-crypto","description":"加密解密模块","dist-tags":{"latest":"0.2.2"},"versions":{"0.0.1":{"name":"n-crypto","version":"0.0.1","keywords":["MD5","RSA","加密","解密"],"dependencies":{"utf8":"^2.1.0"},"devDependencies":{"mocha":"^2.2.5","should":"^7.0.2"},"description":"加密解密模块","main":"index.js","repository":{"type":"git","url":"git+https://github.com/navyxie/n-crypto.git"},"author":{"name":"navyxie"},"license":"ISC","homepage":"https://github.com/navyxie/n-crypto","maintainers":[{"name":"navyxie","email":"navyxie2010@gmail.com"}],"gitHead":"b15fdeb2b019130f43187e00bf545190d1114566","bugs":{"url":"https://github.com/navyxie/n-crypto/issues"},"_id":"n-crypto@0.0.1","scripts":{},"_shasum":"049b7297b8f75d58a7b2de4c4489125107bf35cd","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"navyxie","email":"navyxie2010@gmail.com"},"dist":{"shasum":"049b7297b8f75d58a7b2de4c4489125107bf35cd","tarball":"https://registry.npmjs.org/n-crypto/-/n-crypto-0.0.1.tgz","integrity":"sha512-6apafffelhY1a0sW7ayYFo4KmPg1dj+DF9lIs5lp7YeddkBc5WN/chQJp6PFY9Gv/mibfGkzKFnSPrQBpwkTJQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8IFr+8FQMOIbtvTY+yH9KC0YCBMkVuL3GOoXr01XqmAIgRfJ+aEhEp5gCssu93LaxJCRr9Pa7mj5vsuEoT0b1cZU="}]}},"0.0.4":{"name":"n-crypto","version":"0.0.4","keywords":["MD5","RSA","DES","AES","加密","解密"],"dependencies":{"utf8":"^2.1.0"},"devDependencies":{"mocha":"^2.2.5","coveralls":"^2.11.3","istanbul":"^0.3.17","should":"^7.0.2","utf8":"^2.1.0"},"description":"加密解密模块","main":"index.js","repository":{"type":"git","url":"https://github.com/navyxie/n-crypto.git"},"author":{"name":"navyxie"},"license":"ISC","homepage":"https://github.com/navyxie/n-crypto","maintainers":[{"name":"navyxie","email":"navyxie2010@gmail.com"}],"gitHead":"65427a86dcbfe12dcb4eca47c77798c0e4caf5db","bugs":{"url":"https://github.com/navyxie/n-crypto/issues"},"_id":"n-crypto@0.0.4","scripts":{},"_shasum":"f8f845d306f0e76645cb0fcbdd739247bc8c5dca","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"navyxie","email":"navyxie2010@gmail.com"},"dist":{"shasum":"f8f845d306f0e76645cb0fcbdd739247bc8c5dca","tarball":"https://registry.npmjs.org/n-crypto/-/n-crypto-0.0.4.tgz","integrity":"sha512-X1dZExePNDYn1BM/KmEd8rAdebMbLNBRgO07G63vWF62Z4ejS8qpog9y6y4TcxoIg6PxohLp32AL3tnEvxsiXg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAcLgoaPeWvpQofo7n/xLWugBIeAixyfWzRfxTOASsmXAiEAx5JKbGqZgpW7qCeLtp9W7UceOTmTyStRCOS2DgbGgok="}]}},"0.1.0":{"name":"n-crypto","version":"0.1.0","keywords":["MD5","RSA","DES","AES","加密","解密"],"dependencies":{"utf8":"^2.1.0"},"devDependencies":{"mocha":"^2.2.5","coveralls":"^2.11.3","istanbul":"^0.3.17","should":"^7.0.2","utf8":"^2.1.0"},"description":"加密解密模块","main":"index.js","repository":{"type":"git","url":"https://github.com/navyxie/n-crypto.git"},"author":{"name":"navyxie"},"license":"ISC","homepage":"https://github.com/navyxie/n-crypto","maintainers":[{"name":"navyxie","email":"navyxie2010@gmail.com"}],"gitHead":"1aadbac20086c9a46afff1d8606befa4ada4e46f","bugs":{"url":"https://github.com/navyxie/n-crypto/issues"},"_id":"n-crypto@0.1.0","scripts":{},"_shasum":"fdb690b28d267014a2929437d968cddba1368c67","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"navyxie","email":"navyxie2010@gmail.com"},"dist":{"shasum":"fdb690b28d267014a2929437d968cddba1368c67","tarball":"https://registry.npmjs.org/n-crypto/-/n-crypto-0.1.0.tgz","integrity":"sha512-nwzALGkwg42gluUJwGfPb9QhdpHkyJotpDD7FhK7Yn3io3gMLxMoJf81HX1u+77YLjsEbg2kbQccSnvR2WX5mw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSNk+/XpoJOZePdgmeBe2WWeodJMuuAy3Ad8RCoATpAwIgKiK0Lr0wcKArMmcl9QlvKFSls01P2dYUFwJaUwH/1pU="}]}},"0.1.2":{"name":"n-crypto","version":"0.1.2","keywords":["MD5","RSA","DES","AES","加密","解密"],"dependencies":{"utf8":"^2.1.0"},"devDependencies":{"mocha":"^2.2.5","coveralls":"^2.11.3","istanbul":"^0.3.17","should":"^7.0.2","utf8":"^2.1.0"},"description":"加密解密模块","main":"index.js","repository":{"type":"git","url":"https://github.com/navyxie/n-crypto.git"},"author":{"name":"navyxie"},"license":"ISC","homepage":"https://github.com/navyxie/n-crypto","maintainers":[{"name":"navyxie","email":"navyxie2010@gmail.com"}],"gitHead":"5d8fc468459d94a177d3bcd2825eb562c131d1ee","bugs":{"url":"https://github.com/navyxie/n-crypto/issues"},"_id":"n-crypto@0.1.2","scripts":{},"_shasum":"f2fda220d81195f78d877ac45a603a1451e9cbdd","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"navyxie","email":"navyxie2010@gmail.com"},"dist":{"shasum":"f2fda220d81195f78d877ac45a603a1451e9cbdd","tarball":"https://registry.npmjs.org/n-crypto/-/n-crypto-0.1.2.tgz","integrity":"sha512-Ue7CQsK/cj5IrBL1Ocy7SprbneQhXIpNoZO1rMPSsWWyuRmeLGx7ced8cDaGr9c1iO2eXT9z93e/w5ArWQ5sLA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDBsKOlHajApagLh6J2Zemmy7GUQEB9ERZWGEV7vvAxvAiEArMMIWzBCbRJOirgYxoFHTDHnZKb4qfkmcoy3YuuWzhs="}]}},"0.1.3":{"name":"n-crypto","version":"0.1.3","keywords":["MD5","RSA","DES","AES","加密","解密"],"dependencies":{"utf8":"^2.1.0"},"devDependencies":{"mocha":"^2.2.5","coveralls":"^2.11.3","istanbul":"^0.3.17","should":"^7.0.2","utf8":"^2.1.0"},"description":"加密解密模块","main":"index.js","repository":{"type":"git","url":"https://github.com/navyxie/n-crypto.git"},"author":{"name":"navyxie"},"license":"ISC","homepage":"https://github.com/navyxie/n-crypto","maintainers":[{"name":"navyxie","email":"navyxie2010@gmail.com"}],"gitHead":"2e909e602231cc1709d1f0d037e6edcb9245a02f","bugs":{"url":"https://github.com/navyxie/n-crypto/issues"},"_id":"n-crypto@0.1.3","scripts":{},"_shasum":"4b7500ce671a0f0f0a319189edb725451f1cdae1","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"navyxie","email":"navyxie2010@gmail.com"},"dist":{"shasum":"4b7500ce671a0f0f0a319189edb725451f1cdae1","tarball":"https://registry.npmjs.org/n-crypto/-/n-crypto-0.1.3.tgz","integrity":"sha512-6dIYtLmecTvPPwFS8uAEsyN8/OmrPOPycxiRMgaeV4tJHwb1iJXxQFeOZIE7KogjMUMINr4vKKCgY1G0l2amxQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEBD8V4rKwJn92IkfCi6++9gs8fUzlTPtDharrrlydJ5AiEA7LTpAKe701LCiMpUhdbij7a6d7FB9vZmMweK1iJ3QpM="}]}},"0.1.4":{"name":"n-crypto","version":"0.1.4","keywords":["MD5","RSA","DES","AES","加密","解密"],"dependencies":{"utf8":"^2.1.0"},"devDependencies":{"mocha":"^2.2.5","coveralls":"^2.11.3","istanbul":"^0.3.17","should":"^7.0.2","utf8":"^2.1.0"},"description":"加密解密模块","main":"index.js","repository":{"type":"git","url":"https://github.com/navyxie/n-crypto.git"},"author":{"name":"navyxie"},"license":"ISC","homepage":"https://github.com/navyxie/n-crypto","maintainers":[{"name":"navyxie","email":"navyxie2010@gmail.com"}],"gitHead":"76679ff479e5ccf4efb7b6a31b62e2c7022f2365","bugs":{"url":"https://github.com/navyxie/n-crypto/issues"},"_id":"n-crypto@0.1.4","scripts":{},"_shasum":"094646bbddb0e7838e33e12f91873f1798b5e582","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"navyxie","email":"navyxie2010@gmail.com"},"dist":{"shasum":"094646bbddb0e7838e33e12f91873f1798b5e582","tarball":"https://registry.npmjs.org/n-crypto/-/n-crypto-0.1.4.tgz","integrity":"sha512-4pISvxBq5jElMZsZPOSdX1V0N13Lvtnrzm7/Cvs8jiTg/4I4XJ1DpY1/lQwFqUuo0vM3vCl7sQYSza/LBMGWZg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBP57cmiDM/85fCsDbey3HjRDHNx8htvxo+fUWN7NkdGAiAkYvtRZgXi+lMweRCBWwIiJKTm0FZW1aAWo0AjC5NySg=="}]}},"0.2.0":{"name":"n-crypto","version":"0.2.0","keywords":["MD5","RSA","DES","AES","加密","解密"],"dependencies":{"utf8":"^2.1.0"},"devDependencies":{"mocha":"^2.2.5","coveralls":"^2.11.3","istanbul":"^0.3.17","should":"^7.0.2","utf8":"^2.1.0"},"description":"加密解密模块","main":"index.js","repository":{"type":"git","url":"https://github.com/navyxie/n-crypto.git"},"author":{"name":"navyxie"},"license":"ISC","homepage":"https://github.com/navyxie/n-crypto","maintainers":[{"name":"navyxie","email":"navyxie2010@gmail.com"}],"gitHead":"5292f1fac822a3487f4ab86569fd941f3a2c8340","bugs":{"url":"https://github.com/navyxie/n-crypto/issues"},"_id":"n-crypto@0.2.0","scripts":{},"_shasum":"1c44351871c21906245d68ded8a96abbf892eb9d","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"navyxie","email":"navyxie2010@gmail.com"},"dist":{"shasum":"1c44351871c21906245d68ded8a96abbf892eb9d","tarball":"https://registry.npmjs.org/n-crypto/-/n-crypto-0.2.0.tgz","integrity":"sha512-m8uHuphSXKr2/0X5bj8e/Rd7GtM7LGAAp/Zkugv3QCddFdXPERrBkryLSEXgkFEpjcnIlKE4kvR+gBIS/onwww==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD47n2TygArvcZU75snOsKHytuT2HDxOH6S91eF7lK3owIhAJlxCUS8MThyyZyJjZvd1eWRjXDnalVuUdKTqs4mqrku"}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/n-crypto-0.2.0.tgz_1459860679064_0.3326083749998361"}},"0.2.1":{"name":"n-crypto","version":"0.2.1","scripts":{"test":"npm install && ./node_modules/mocha/bin/_mocha --recursive test","cov":"npm install && ./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"},"keywords":["MD5","RSA","DES","AES","加密","解密"],"dependencies":{"utf8":"^2.1.1"},"devDependencies":{"mocha":"^2.2.5","coveralls":"2.11.9","istanbul":"^0.4.3","should":"^7.0.2","utf8":"^2.1.1"},"description":"加密解密模块","main":"index.js","repository":{"type":"git","url":"https://github.com/navyxie/n-crypto.git"},"author":{"name":"navyxie"},"license":"ISC","homepage":"https://github.com/navyxie/n-crypto","maintainers":[{"name":"navyxie","email":"navyxie2010@gmail.com"}],"gitHead":"941991a0b95da8c571b371686a21a7de42869fdb","bugs":{"url":"https://github.com/navyxie/n-crypto/issues"},"_id":"n-crypto@0.2.1","_shasum":"7d1aeece89f9fc85445d906c9594abb1a4e2cfb4","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"navyxie","email":"navyxie2010@gmail.com"},"dist":{"shasum":"7d1aeece89f9fc85445d906c9594abb1a4e2cfb4","tarball":"https://registry.npmjs.org/n-crypto/-/n-crypto-0.2.1.tgz","integrity":"sha512-CcJDmHIquDiRYrvzDsvz+mmzWOm+0Dgmi8llj701uTjv97tP9sbF/P5KiWxDMyDksvtss6Pe0VwAKuVx55/kiQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIATs+fP9/AtQChHHqqq+EXn1+V8EoFYuuCmZH9R6xGfvAiBpTE1DdptaiZsw6zaoNKnf/DhAHwUgto7jhf6+kUaxiw=="}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/n-crypto-0.2.1.tgz_1464614335119_0.5489788646809757"}},"0.2.2":{"name":"n-crypto","version":"0.2.2","scripts":{"test":"npm install && ./node_modules/mocha/bin/_mocha --recursive test","cov":"npm install && ./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"},"keywords":["MD5","RSA","DES","AES","加密","解密"],"dependencies":{"utf8":"^2.1.1"},"devDependencies":{"mocha":"^2.2.5","coveralls":"2.11.9","istanbul":"^0.4.3","should":"^7.0.2","utf8":"^2.1.1"},"description":"加密解密模块","main":"index.js","repository":{"type":"git","url":"https://github.com/navyxie/n-crypto.git"},"author":{"name":"navyxie"},"license":"ISC","homepage":"https://github.com/navyxie/n-crypto","maintainers":[{"name":"navyxie","email":"navyxie2010@gmail.com"}],"gitHead":"32c28874753de0ce2505fe4d753ecb7afdb64a3a","bugs":{"url":"https://github.com/navyxie/n-crypto/issues"},"_id":"n-crypto@0.2.2","_shasum":"c0e51fd2caee8095a89c49b9044bc603c2778d74","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"navyxie","email":"navyxie2010@gmail.com"},"dist":{"shasum":"c0e51fd2caee8095a89c49b9044bc603c2778d74","tarball":"https://registry.npmjs.org/n-crypto/-/n-crypto-0.2.2.tgz","integrity":"sha512-3a0wi4I+kRJ+p4vnz+fjfB8rfKH4aIp0yUsrZVzS2mpnrrXB7ODmTvzS8NJbIgHordaHehgCpKWw44qyWRYuhA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAH2/mjZuKdNMjBRkbU4TXrOORXUSw3bWRO3Fw2bxfAaAiBNZUzqiQs5eJiloB7JbTUuoJTceDgAscMQdz7gc1KeWw=="}]},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/n-crypto-0.2.2.tgz_1489458391436_0.4077342676464468"}}},"readme":"# 签名与验签&加密与解密\n    算法说明：签名算法MD5和RSA(RSA-SHA1)，数据加密算法RSA(RSA_NO_PADDING,node > 0.10.0 && < 6.0.0),AES(aes-128-ecb),DES(des-ede3)，返回base64格式数据。\n[![Build Status via Travis CI](https://travis-ci.org/navyxie/n-crypto.svg?branch=master)](https://travis-ci.org/navyxie/n-crypto) [![Coverage Status](https://coveralls.io/repos/github/navyxie/n-crypto/badge.svg?branch=master)](https://coveralls.io/github/navyxie/n-crypto?branch=master)\n\n\n****\n\n## 安装\n    npm install n-crypto\n## 初始化\n\n```js\n    var NCRYPTO = require('n-crypto');\n    var nCrypto = new NCRYPTO({\n\t\tmd5_key:'',//md5 key\n\t\tdes_key:des_key:'',//des key,24个字符长度\n\t\taes_key:aes_key:'',//aes key,16个字符长度\n\t\tmerchant_pri_key:'',//rsa pri key\n\t\tnpay_pub_key:'',//rsa pub  key\n\t})\n```\n\n## API\n\n[`sign`](#sign)\n\n[`verify`](#verify)\n\n[`encrypt`](#encrypt)\n\n[`decrypt`](#decrypt)\n\n\n### 生成签名的API:sign\n\n<a name=\"sign\" />\n\n```js\nvar encryptJson = {\n\tname:\"navy\",\n\tversion:\"1.0\",\n\tcountry:\"中国\",\n\tage:201509110233\n}\nvar sign_type = 'MD5'\nvar signVal = nCrypto.sign(encryptJson,sign_type);\nconsole.log(signVal);//加密后返回的加密串\n```\n\n### 验证签名API:verify\n\n<a name=\"verify\" />\n\n```js\nvar encryptJson = {\n\tname:\"navy\",\n\tversion:\"1.0\",\n\tcountry:\"中国\",\n\tage:201509110233\n}\nvar sign_type = 'MD5';\nvar md5Sign = 'a12b2084d8c7297a25fcfe452af8257c';\nvar verifyResult =  nCrypto.verify(encryptJson,md5Sign,sign_type);\nconsole.log(verifyResult);//boolean值，true表示验签成功，false表示验签失败\n```\n\n### 加密数据的API:encrypt\n\n<a name=\"encrypt\" />\n\n```js\nvar encryptJson = {\n\tname:\"navy\",\n\tversion:\"1.0\",\n\tcountry:\"中国\",\n\tage:201509110233\n}\nvar sign_type = 'AES'；//RSA(node>=0.12),AES,DES\nvar encryptData = nCrypto.encrypt(encryptJson,sign_type);//base64\nconsole.log(encryptData);//加密后返回的base64加密串\n```\n\n### 解密数据的API:decrypt\n\n<a name=\"decrypt\" />\n\n```js\nvar encryptJson = {\n\tname:\"navy\",\n\tversion:\"1.0\",\n\tcountry:\"中国\",\n\tage:201509110233\n}\nvar sign_type = 'AES'；//RSA(node>=0.12),AES,DES\nvar decryptData = nCrypto.decrypt(encryptJson,sign_type);//原始字符串\nconsole.log(decryptData);//加密后返回的base64加密串\n```\n\n","maintainers":[{"name":"navyxie","email":"navyxie2010@gmail.com"}],"time":{"modified":"2022-06-20T18:50:25.203Z","created":"2015-09-10T19:30:32.376Z","0.0.1":"2015-09-10T19:30:32.376Z","0.0.4":"2015-09-13T13:42:41.597Z","0.1.0":"2015-09-14T01:37:14.338Z","0.1.2":"2015-09-14T09:17:04.565Z","0.1.3":"2015-09-14T11:35:26.429Z","0.1.4":"2015-09-14T18:13:32.969Z","0.2.0":"2016-04-05T12:51:21.564Z","0.2.1":"2016-05-30T13:18:57.110Z","0.2.2":"2017-03-14T02:26:33.405Z"},"homepage":"https://github.com/navyxie/n-crypto","keywords":["MD5","RSA","DES","AES","加密","解密"],"repository":{"type":"git","url":"https://github.com/navyxie/n-crypto.git"},"author":{"name":"navyxie"},"bugs":{"url":"https://github.com/navyxie/n-crypto/issues"},"license":"ISC","readmeFilename":"README.md"}