{"_id":"aes-cbc-mac","_rev":"2-b918e724efc67b7c18203412e0e91896","name":"aes-cbc-mac","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"aes-cbc-mac","version":"1.0.0","description":"Node implementation for aes cbc mac","main":"lib/index.js","scripts":{"pretest":"semistandard --fix","coverage":"nyc npm test","coveragehtml":"nyc report -r html","precoveragehtml":"npm run coverage","coveralls":"nyc report --reporter=text-lcov | coveralls","test":"ava test/aes-cbc-mac.js"},"repository":{"type":"git","url":"git+https://github.com/erdtman/aes-cbc-mac.git"},"keywords":["hash","cbc","aes","mac","crypto"],"author":{"name":"Samuel Erdtman"},"license":"MIT","bugs":{"url":"https://github.com/erdtman/aes-cbc-mac/issues"},"homepage":"https://github.com/erdtman/aes-cbc-mac#readme","devDependencies":{"ava":"*","npm-run-all":"*","nyc":"*","semistandard":"*"},"gitHead":"06332ec1e00bc8c881574920f31e251c66d4c8e9","_id":"aes-cbc-mac@1.0.0","_nodeVersion":"11.12.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-TDnzKrqx2+UuLCo5sigyfQCF/vR4T/zdH6cuNVrzruwRMvBZo1EayJgPEX3N9Te0/ep1hrndDZ0Fr+i1znSooQ==","shasum":"b77a23fbbde0f6be5eb96cccda8410de4fbe0ba1","tarball":"https://registry.npmjs.org/aes-cbc-mac/-/aes-cbc-mac-1.0.0.tgz","fileCount":11,"unpackedSize":49539,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc/DGrCRA9TVsSAnZWagAApgwP/RzosdCKxxhKtrAyXHV/\nZE7er5CIjQJ4yeAfE7iNw6bKCQrlozevpyWWu2pucEFM+s8yGfoSYMzQbn55\nHWxyQplleVIwzxw8edcL4xzXDxazlIvATfMEQHrRA3OCHAkMMC3aMtatAQ0T\nyR3tM+IXB0igqAzfnUUzzq0NDwTjHeP4MufupB8voITxVbGmJ8YRYc9+pUP/\n4jyqZ0nlimUkK/W9MKE/2uDdiLeIf4gxy1RjmpHV12dX1xKI8vw4CnSp6B+1\nKO+wK+VnUEmYak15SKBFyGY+DFI+om7JQtFLHwbS/95eRkelOwnoLfZgvVVo\nBOeDcUZ90H564BTcZSl4C4IDVrKbhu47exNMcBGUrworoGAG0N4YF/WGwZ9f\nb8NFVv9smnVqsmS7u6DrK4pDBT2kbZtIn4ZxUSsTTPUETiyXUjj7yBEO3zNW\nMIrzkY6inOL9Y1QnBXJIL8lhn41pepONyvgOy9kSRKQhUb5ApLW7UnWPOY7F\nCqM2GNWe30HF9EXVasggrErDPQ6YX1860H3lYP9JmuDgmYrArKV3vkH5UR7q\ngIyziOekX/9BVTI20y3JS+qXemE4t+nwLHYry8KZpl8UHMDzsLAYxs6V0+CE\nMz098ETysbtYR8mcanTiYNTMxElNQXPyuU/dZr5j6mcnSt28LR215/enOYAD\nUhdR\r\n=3jbN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDhQpH6WiRFezWwqMtjbeTo+9duAEgdJ5VFz37HmER4iAiBm2TMtIX/Vd8WIfqXhDWREf/46xIDgomRtN8sFuqoHVA=="}]},"maintainers":[{"name":"samuelerdtman","email":"samuel@erdtman.se"}],"_npmUser":{"name":"samuelerdtman","email":"samuel@erdtman.se"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aes-cbc-mac_1.0.0_1560031658446_0.8890638905662214"},"_hasShrinkwrap":false},"1.0.1":{"name":"aes-cbc-mac","version":"1.0.1","description":"Node implementation for aes cbc mac","main":"lib/index.js","scripts":{"pretest":"semistandard --fix","coverage":"nyc npm test","coveragehtml":"nyc report -r html","precoveragehtml":"npm run coverage","coveralls":"nyc report --reporter=text-lcov | coveralls","test":"ava test/aes-cbc-mac.js"},"repository":{"type":"git","url":"git+https://github.com/erdtman/aes-cbc-mac.git"},"keywords":["hash","cbc","aes","mac","crypto"],"author":{"name":"Samuel Erdtman"},"license":"MIT","bugs":{"url":"https://github.com/erdtman/aes-cbc-mac/issues"},"homepage":"https://github.com/erdtman/aes-cbc-mac#readme","devDependencies":{"ava":"*","npm-run-all":"*","nyc":"*","semistandard":"*"},"gitHead":"f13958637d5739144dda3b7682dea3de64d77a11","_id":"aes-cbc-mac@1.0.1","_nodeVersion":"12.16.2","_npmVersion":"6.14.4","dist":{"integrity":"sha512-F1U0qNBNyrW82LRdQvYWKOpljZFnJ9LBUGWNCzCBTC3/+Fki77KgDrfJ+rBVlCpcmMT3jDEGhG61RMVeyHAKog==","shasum":"a31e52f77bba69163718d0bd291f1527eeea5854","tarball":"https://registry.npmjs.org/aes-cbc-mac/-/aes-cbc-mac-1.0.1.tgz","fileCount":7,"unpackedSize":7725,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfKxu0CRA9TVsSAnZWagAAMQwP/i/RBVDk8MQaTogXbkv/\nJQVht9gX7eZCo2WJOXvAJ6oZlzHjlU+QagB1Cp3Y26MVgxdHRfHVqN00gtpN\nHTnYmhKP4908LPTj2c7VcTP0XoGqSifgHhICBUAvJ5QX1d76JJyP2DoGpvuc\ns/FumXyl6ur8e/sT0WZpd76eIsQDueqp+LnCG26czV1n2kudDw0QH9tDazU/\nlot9Mbn1epmPeI5hf5CYww8LDGfdvZ/bRmf+neHzSNEC0DiwNiENCiJwKKeR\nT7vNHXLyisWKCvcCNHKI6z08MeKFRbGByKkCgSpkksLzgKq+GSSkL7/3bi5M\nVMpWP9D36EPo2Gh6quqsrq/5L1RfJOLHzaSvBeZU6E8bnjRSmf7+KfPvvXzV\nwhbZI0jEHFr7thLj38vCsT+sq2Nd1QI0FyRAZmjhsNHKdl+gSx72V92S8EWY\nuhW5Spy1iJIVKAs2iUziDvcGWnnJRj7E9mzSKxS1ijlEBw7zd7HrDXVy2/H5\nHdCUTUknuZawmhqclcuGQHOzGWgcoeW1ffy0ZAeTQXxrNjfFcMbFd/3l1etl\nr/hQDRaWkmqYWeCxFHQzpK5WRgIq3/w374qcsf0jGMoCzUcpu7qo3OEETdpK\nLqNrCURU1PHhi/eFR2hFtRJQDW9/MYcmBhnSCb2e/xW2SMM+jpWgFUsmPgae\n+qvz\r\n=vt1X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIADBvx4+LWrFh2lvDHKKO02ZUzE8trXe/Uut94Xp6FWNAiEArcrJVU3+6/Jetu1oLdCPf1jknAag8jqrPXaqO/e/xh8="}]},"maintainers":[{"name":"samuelerdtman","email":"samuel@erdtman.se"}],"_npmUser":{"name":"samuelerdtman","email":"samuel@erdtman.se"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aes-cbc-mac_1.0.1_1596660660543_0.19476627095141708"},"_hasShrinkwrap":false}},"time":{"created":"2019-06-08T22:07:38.446Z","1.0.0":"2019-06-08T22:07:38.608Z","modified":"2022-04-11T12:50:00.961Z","1.0.1":"2020-08-05T20:51:00.639Z"},"maintainers":[{"name":"samuelerdtman","email":"samuel@erdtman.se"}],"description":"Node implementation for aes cbc mac","homepage":"https://github.com/erdtman/aes-cbc-mac#readme","keywords":["hash","cbc","aes","mac","crypto"],"repository":{"type":"git","url":"git+https://github.com/erdtman/aes-cbc-mac.git"},"author":{"name":"Samuel Erdtman"},"bugs":{"url":"https://github.com/erdtman/aes-cbc-mac/issues"},"license":"MIT","readme":"[![Build Status](https://travis-ci.com/erdtman/aes-cbc-mac.svg?branch=master)](https://travis-ci.com/erdtman/aes-cbc-mac)\n[![Coverage Status](https://coveralls.io/repos/github/erdtman/aes-cbc-mac/badge.svg?branch=master)](https://coveralls.io/github/erdtman/aes-cbc-mac?branch=master)\n# aes-cbc-mac\nNode implementation for aes cbc mac.\n\n## Security Considerations\n\nA number of attacks exist against Cipher Block Chaining Message Authentication Code (CBC-MAC) that need to be considered.\n\n* A single key must only be used for messages of a fixed and known length.  If this is not the case, an attacker will be able to generate a message with a valid tag given two message and tag pairs.  This can be addressed by using different keys for messages of different lengths.  The current structure mitigates this problem, as a specific encoding structure that includes lengths is built and signed.  (CMAC also addresses this issue.)\n* Cipher Block Chaining (CBC) mode, if the same key is used for both encryption and authentication operations, an attacker can produce messages with a valid authentication code.\n* If the IV can be modified, then messages can be forged.  This is addressed by fixing the IV to all zeros.\n\n## Installation\n```\nnpm install aes-cbc-mac --save\n```\n## Testing\n```\nnpm run test\n```\n## Usage\n```javascript\n\nconst aesCbcMac = require('aes-cbc-mac');\n\nconst message = 'Important message';\nconst key = Buffer.from('849B57219DAE48DE646D07DBB533566E', 'hex');\nconst hashLen = 8; // bytes, 64 bits\nconst hash = aesCbcMac.create(message, key, hashLen);\n\nconsole.log(hash);\n\n```\n","readmeFilename":"README.md"}