{"name":"tsscmp","version":"1.0.2","description":"Timing safe string compare using double HMAC","main":"lib/index.js","dependencies":{},"devDependencies":{},"scripts":{"test":"node test/unit && node test/benchmark"},"repository":{"type":"git","url":"git+https://github.com/suryagh/tsscmp.git"},"keywords":["timing safe string compare","double hmac string compare","safe string compare","compare","double","hmac"],"author":{"name":"suryagh"},"publishConfig":{"registry":"https://registry.npmjs.org"},"engines":{"node":">=0.6.x"},"license":"MIT","gitHead":"9a26dc5c8cef3f61a6829f7e009c396439664614","bugs":{"url":"https://github.com/suryagh/tsscmp/issues"},"homepage":"https://github.com/suryagh/tsscmp#readme","_id":"tsscmp@1.0.2","_shasum":"e440e05256e41f57ae3dc50b413201ae2caa739e","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"suryagh","email":"surya.com@gmail.com"},"dist":{"shasum":"e440e05256e41f57ae3dc50b413201ae2caa739e","tarball":"http://registry-npm.ywwl.com/tsscmp/download/tsscmp-1.0.2.tgz","integrity":"sha512-9T73/3kAy0lZ2WInDce4UDpehJ4A5m0hKC3cCE67tRIwmSbfxGdyP+wx2w+OqcPCzu+kGKHXVvPRHCHUdZp1NQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFU1qouxy1/Eu9apB8kdXelltl7hotqYc9PYf/GdULwsAiEAoMoPtQr1e6Ku5b4dVo5HGlealoCK4IWT0VmBxjJnrvw="}],"size":3703,"noattachment":false,"key":"/tsscmp/-/tsscmp-1.0.2.tgz"},"maintainers":[{"name":"suryagh","email":"surya.com@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/tsscmp-1.0.2.tgz_1463956858067_0.9973081948701292"},"directories":{},"readme":"# Timing safe string compare using double HMAC\r\n\r\n[![Node.js Version](https://img.shields.io/node/v/tsscmp.svg?style=flat-square)](https://nodejs.org/en/download)\r\n[![npm](https://img.shields.io/npm/v/tsscmp.svg?style=flat-square)](https://npmjs.org/package/tsscmp)\r\n[![NPM Downloads](https://img.shields.io/npm/dm/tsscmp.svg?style=flat-square)](https://npmjs.org/package/tsscmp)\r\n[![Build Status](https://img.shields.io/travis/suryagh/tsscmp/master.svg?style=flat-square)](https://travis-ci.org/suryagh/tsscmp)\r\n[![Build Status](https://img.shields.io/appveyor/ci/suryagh/tsscmp/master.svg?style=flat-square&label=windows)](https://ci.appveyor.com/project/suryagh/tsscmp)\r\n[![Dependency Status](http://img.shields.io/david/suryagh/tsscmp.svg?style=flat-square)](https://david-dm.org/suryagh/tsscmp)\r\n[![npm-license](http://img.shields.io/npm/l/tsscmp.svg?style=flat-square)](LICENSE)\r\n\r\n\r\nPrevents [timing attacks](http://codahale.com/a-lesson-in-timing-attacks/) using Brad Hill's\r\n[Double HMAC pattern](https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2011/february/double-hmac-verification/)\r\nto perform secure string comparison. Double HMAC avoids the timing atacks by blinding the\r\ntiming channel using random time per attempt comparison against iterative brute force attacks.\r\n\r\n\r\n## Install\r\n\r\n```\r\nnpm install tsscmp\r\n```\r\n## Why\r\nTo compare secret values like **authentication tokens**, **passwords** or\r\n**capability urls** so that timing information is not\r\nleaked to the attacker.\r\n\r\n## Example\r\n\r\n```js\r\nvar timingSafeCompare = require('tsscmp');\r\n\r\nvar sessionToken = '127e6fbfe24a750e72930c';\r\nvar givenToken = '127e6fbfe24a750e72930c';\r\n\r\nif (timingSafeCompare(sessionToken, givenToken)) {\r\n  console.log('good token');\r\n} else {\r\n  console.log('bad token');\r\n}\r\n```\r\n##License: \r\n[MIT](LICENSE)\r\n\r\n**Credits to:**  [@jsha](https://github.com/jsha) |\r\n[@bnoordhuis](https://github.com/bnoordhuis) |\r\n[@suryagh](https://github.com/suryagh) |\r\n ","publish_time":1463956859164,"_cnpm_publish_time":1463956859164,"dist-tags":{"latest":"1.0.6"}}