{"_id":"tsscmp","_rev":"12-accd41d48d6e579a317f57b7a71ecd36","name":"tsscmp","description":"Timing safe string compare using double HMAC","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.0":{"name":"tsscmp","version":"1.0.0","description":"timing safe string compare, using double hmac","main":"lib/index.js","dependencies":{},"devDependencies":{},"scripts":{"test":"node test/index-test.js"},"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"},"engineStrict":true,"licenses":[{"type":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}],"gitHead":"9c3028fe4bb48b0c6991d7c98553b803998d89b7","bugs":{"url":"https://github.com/suryagh/tsscmp/issues"},"homepage":"https://github.com/suryagh/tsscmp#readme","_id":"tsscmp@1.0.0","_shasum":"0b97586d4c99367040665bd1dae43374616e2350","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"suryagh","email":"surya.com@gmail.com"},"dist":{"shasum":"0b97586d4c99367040665bd1dae43374616e2350","tarball":"https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.0.tgz","integrity":"sha512-u5FO4pFd7bW7XeW8Ci64oBYr9J1MNhIg69cYc8IkbmUTaOr2/2t/2Jy38SfxXOJE9DjN5N1vEjrQiPZ4ZDD6cg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCo5E7kMv5ce56+xP3zwXclNO3vInDS2xmnpvKTAkINsgIhAMDHX/J8btOQG7AWo7ksL54sRHhdisVa8TIuZe0IJYkB"}]},"maintainers":[{"name":"suryagh","email":"surya.com@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/tsscmp-1.0.0.tgz_1463004012988_0.45107064745388925"},"directories":{}},"1.0.1":{"name":"tsscmp","version":"1.0.1","description":"Timing safe string compare using double HMAC","main":"lib/index.js","dependencies":{},"devDependencies":{},"scripts":{"test":"node test/index-test.js"},"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"},"engineStrict":true,"licenses":[{"type":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}],"gitHead":"638c1fb38770f46170c84f98d82791ee00b252f1","bugs":{"url":"https://github.com/suryagh/tsscmp/issues"},"homepage":"https://github.com/suryagh/tsscmp#readme","_id":"tsscmp@1.0.1","_shasum":"15a3dff6600dc4647c5a5ebdc6881ba62f37fc42","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"suryagh","email":"surya.com@gmail.com"},"dist":{"shasum":"15a3dff6600dc4647c5a5ebdc6881ba62f37fc42","tarball":"https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.1.tgz","integrity":"sha512-0AQmVNfwpOYPSE1ZwklrD0tArCke6MYw9uU1A3gWD8qWwZZJ3k82EnXvyK092iRQ3vG4Yl3hLNAFBaF27uwP4g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLt5BNLxjV3F6l1sqGE/oM4m2fjknNpNTJhnghf2hmkAIgcwHpL25HgTzKS+2DCuGzupqVVR4ZkTDJ7688c9W8jj0="}]},"maintainers":[{"name":"suryagh","email":"surya.com@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/tsscmp-1.0.1.tgz_1463053945726_0.8911230766680092"},"directories":{}},"1.0.2":{"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":"https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.2.tgz","integrity":"sha512-9T73/3kAy0lZ2WInDce4UDpehJ4A5m0hKC3cCE67tRIwmSbfxGdyP+wx2w+OqcPCzu+kGKHXVvPRHCHUdZp1NQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFU1qouxy1/Eu9apB8kdXelltl7hotqYc9PYf/GdULwsAiEAoMoPtQr1e6Ku5b4dVo5HGlealoCK4IWT0VmBxjJnrvw="}]},"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":{}},"1.0.4":{"name":"tsscmp","version":"1.0.4","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","hmac"],"author":{"name":"suryagh"},"publishConfig":{"registry":"https://registry.npmjs.org"},"engines":{"node":">=0.6.x"},"license":"MIT","gitHead":"207a67f7da60ca90b79aed3da7417317ab05fa96","bugs":{"url":"https://github.com/suryagh/tsscmp/issues"},"homepage":"https://github.com/suryagh/tsscmp#readme","_id":"tsscmp@1.0.4","_shasum":"16638d8f414605bf4daa9be8fdeabda4c3923b6a","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"suryagh","email":"surya.com@gmail.com"},"dist":{"shasum":"16638d8f414605bf4daa9be8fdeabda4c3923b6a","tarball":"https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.4.tgz","integrity":"sha512-vpd+h9f9nWyOj0o1mE79OBlAoRmalVvkOVvGqFzm/ze10aDfVqyYb6W6NfGBvT0JvjBYWcsa8ZiiqwrKu2lpMg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB0h7cjLtWjdwsh/26KmB9+pKML8+qjO18PJ71oBZeGeAiEA8FCbSpcpV5Hmmwp08V0h+1hR7XH1AvQFE4HMA+z5vjg="}]},"maintainers":[{"name":"suryagh","email":"surya.com@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/tsscmp-1.0.4.tgz_1464054442663_0.9036741754971445"},"directories":{}},"1.0.5":{"name":"tsscmp","version":"1.0.5","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","hmac"],"author":{"name":"suryagh"},"publishConfig":{"registry":"https://registry.npmjs.org"},"engines":{"node":">=0.6.x"},"license":"MIT","gitHead":"095fb02b3e6102cbd1d2bdc9613e3da54e782f59","bugs":{"url":"https://github.com/suryagh/tsscmp/issues"},"homepage":"https://github.com/suryagh/tsscmp#readme","_id":"tsscmp@1.0.5","_shasum":"7dc4a33af71581ab4337da91d85ca5427ebd9a97","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"suryagh","email":"surya.com@gmail.com"},"dist":{"shasum":"7dc4a33af71581ab4337da91d85ca5427ebd9a97","tarball":"https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.5.tgz","integrity":"sha512-aP/vy9xYiYGvtpW4xBkxdoeqbT+nNeo/37cdQk3iSiGz0xKb20XwOgBSqYo1DzEqt1ycPubEfPU3oHgzsRRL3g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE+G9TnjxJXoZ1WbYHh3wAoWBycm/K7i5xiixTSPDmDpAiBRsJyQGaxs/J5JvKgjTgVsUrUzcMjd/NRKXFmTzyJAHg=="}]},"maintainers":[{"name":"suryagh","email":"surya.com@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/tsscmp-1.0.5.tgz_1464226502956_0.48576042777858675"},"directories":{}},"1.0.6":{"name":"tsscmp","version":"1.0.6","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","hmac"],"author":{"name":"suryagh"},"publishConfig":{"registry":"https://registry.npmjs.org"},"engines":{"node":">=0.6.x"},"license":"MIT","gitHead":"53430f98f8dc4cea2cb649a7a8a2867e93f08cf8","bugs":{"url":"https://github.com/suryagh/tsscmp/issues"},"homepage":"https://github.com/suryagh/tsscmp#readme","_id":"tsscmp@1.0.6","_npmVersion":"6.1.0","_nodeVersion":"10.3.0","_npmUser":{"name":"suryagh","email":"surya.com@gmail.com"},"dist":{"integrity":"sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==","shasum":"85b99583ac3589ec4bfef825b5000aa911d605eb","tarball":"https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz","fileCount":8,"unpackedSize":8355,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbX8VpCRA9TVsSAnZWagAAIWwP/3X4dck2ffo/T7VHHbSU\nGCDv3eTjTxvn+TFo5mT7USfOLr85Pzv48evNm+Vf6dklFnRcohWskFepYfLU\nxf1aEubV3MTuGQFz7mZ0CD/gcoW0S1cVlk800xmCsVE88ktntOSeb2oqTuMX\n7nuXTCbo0Y/RYQ7dMHlR8HgNftzam6MWdLrcYRsycgzwHiQ9ubX9QqenX7zV\nU7DYapeuRRmyf1uoE3QWpSfsFZbQcams77LwjUNiQiclLiVu1f5O9+dcMJ4Z\nmYN/4+i7ou6cGqvjH8ANulSkNg1Lp0k32vagyGQ5qjI8LtOstimp+0DX6dDR\nK3YctoJcZ5itCg0SKJd0TodPZiUl/jHbmlNY6OFcwKUs3m2Qvvoq2Ucye7X0\nnnSNwWFTkEXevHOdHs7ETjJgvMmoTW6VaGGyPGg0ePHR+wUgPYBLcC+XCxcA\na6dvdlZ5YaM8tbZ+NmX2j3vr6tvHY8C/N3ijuzvFUOvyywguJII1au+m1ugs\nmhU0hcDL88Zgr3y12o3dhQiER6tNdIQ2QdT4gcKuNpVKqwD8Nq1ETTAs5FxL\n/fHm68ZTXBgyoYeXy6SAAT63ZCdg9T4F/aQd2rVzVeG/PteXYVVCnK3YNSwt\n58bIITySX+ZO1zZCU2GmKEh00ZAMwY5MRpmEAxanuZPRTyYHtpZZ1AisqQWK\nKyvV\r\n=72Mc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDCTqXkGJ2yOagoQNTIWgwNCmu/CunKr9I/S4z3+VaMSAiA9Hz1pmw+CO2Gs1LRAJfUKY70iQXSy2M5CHljoHB0FTw=="}]},"maintainers":[{"name":"suryagh","email":"surya.com@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tsscmp_1.0.6_1533003113694_0.39800480899280677"},"_hasShrinkwrap":false}},"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 ","maintainers":[{"name":"suryagh","email":"surya.com@gmail.com"}],"time":{"modified":"2022-06-27T22:49:25.912Z","created":"2016-05-11T22:00:15.530Z","1.0.0":"2016-05-11T22:00:15.530Z","1.0.1":"2016-05-12T11:52:27.351Z","1.0.2":"2016-05-22T22:40:59.164Z","1.0.4":"2016-05-24T01:47:24.883Z","1.0.5":"2016-05-26T01:35:04.425Z","1.0.6":"2018-07-31T02:11:53.802Z"},"homepage":"https://github.com/suryagh/tsscmp#readme","keywords":["timing safe string compare","double hmac string compare","safe string compare","hmac"],"repository":{"type":"git","url":"git+https://github.com/suryagh/tsscmp.git"},"author":{"name":"suryagh"},"bugs":{"url":"https://github.com/suryagh/tsscmp/issues"},"readmeFilename":"README.md","users":{"suryagh":true,"ahmed-dinar":true,"rping":true},"license":"MIT"}