{"_id":"aes-js","_rev":"4586493","name":"aes-js","description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","dist-tags":{"beta":"4.0.0-beta.5","latest":"3.1.2"},"maintainers":[{"name":"ricmoo","email":""}],"time":{"modified":"2026-04-10T16:32:56.000Z","created":"2015-03-04T06:57:51.062Z","4.0.0-beta.5":"2023-04-27T11:32:00.834Z","4.0.0-beta.4":"2023-04-25T10:57:49.617Z","4.0.0-beta.3":"2022-09-27T05:57:52.187Z","4.0.0-beta.2":"2022-03-23T05:57:50.983Z","4.0.0-beta.1":"2022-03-23T05:49:26.385Z","3.1.2":"2018-11-09T21:06:30.920Z","3.1.1":"2018-04-14T20:38:13.430Z","3.1.0":"2017-04-15T19:34:01.051Z","3.0.0":"2017-02-08T09:00:04.750Z","2.1.1":"2017-02-08T01:18:15.149Z","2.1.0":"2016-10-04T15:30:11.351Z","2.0.0":"2016-05-16T02:26:45.141Z","1.0.0":"2016-04-02T23:05:36.698Z","0.2.4":"2016-02-27T07:42:25.353Z","0.2.3":"2016-02-24T05:02:53.167Z","0.2.2":"2016-02-02T15:58:46.574Z","0.2.1":"2015-11-16T00:12:37.411Z","0.2.0":"2015-09-15T20:44:14.549Z","0.1.0":"2015-03-06T21:39:49.713Z","0.0.2":"2015-03-06T00:27:12.394Z","0.0.1":"2015-03-04T06:57:51.062Z"},"users":{},"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"versions":{"4.0.0-beta.5":{"name":"aes-js","version":"4.0.0-beta.5","description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"@types/mocha":"^9.1.0","@types/node":"^16.7.10","mocha":"^9.2.2","typescript":"^4.7.4"},"exports":{".":{"import":"./lib.esm/index.js","default":"./lib.commonjs/index.js"}},"scripts":{"auto-build":"npm run build -- -w","build":"tsc --build ./tsconfig.esm.json","build-all":"npm run build && npm run build-commonjs","build-clean":"npm run clean && npm run build-all","build-commonjs":"tsc --build ./tsconfig.commonjs.json && cp ./package-commonjs.json ./lib.commonjs/package.json","clean":"rm -rf lib.commonjs lib.esm && cp -r misc/basedirs/* .","test-commonjs":"mocha ./lib.commonjs/tests.js","test-esm":"mocha ./lib.esm/tests.js","test":"npm run test-commonjs && npm run test-esm"},"main":"./lib.commonjs/index.js","module":"./lib.esm/index.js","publishConfig":{"tag":"beta"},"sideEffects":false,"keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"github@ricmoo.com"},"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","types":"./lib.commonjs/index.d.ts","readmeFilename":"README.md","gitHead":"2dcb8d90c1d38fab36e5be14519099f8651dedc5","homepage":"https://github.com/ricmoo/aes-js#readme","_id":"aes-js@4.0.0-beta.5","_nodeVersion":"18.15.0","_npmVersion":"9.5.0","dist":{"shasum":"8d2452c52adedebc3a3e28465d858c11ca315873","size":397643,"noattachment":false,"key":"/aes-js/-/aes-js-4.0.0-beta.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-4.0.0-beta.5.tgz"},"_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"directories":{},"maintainers":[{"name":"ricmoo","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aes-js_4.0.0-beta.5_1682595120576_0.5070522506543462"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-04-27T11:32:00.834Z","publish_time":1682595120834,"_source_registry_name":"default","_cnpm_publish_time":1682595120834},"4.0.0-beta.4":{"name":"aes-js","version":"4.0.0-beta.4","description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"@types/mocha":"^9.1.0","@types/node":"^16.7.10","mocha":"^9.2.2","typescript":"^4.7.4"},"exports":{".":{"import":"./lib.esm/index.js","require":"./lib.commonjs/index.js","types":"./types/index.d.ts","default":"./lib.commonjs/index.js"}},"scripts":{"auto-build":"npm run build -- -w","build":"tsc --build ./tsconfig.esm.json","build-all":"npm run build && npm run build-commonjs && npm run build-types","build-clean":"npm run clean && npm run build-all","build-commonjs":"tsc --build ./tsconfig.commonjs.json && cp ./package-commonjs.json ./lib.commonjs/package.json","build-types":"tsc --build ./tsconfig.types.json","clean":"rm -rf dist lib.commonjs lib.esm types","test-commonjs":"mocha ./lib.commonjs/tests.js","test-esm":"mocha ./lib.esm/tests.js","test":"npm run test-commonjs && npm run test-esm"},"main":"./lib.commonjs/index.js","module":"./lib.esm/index.js","publishConfig":{"tag":"beta"},"sideEffects":false,"types":"./types/index.d.ts","keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"github@ricmoo.com"},"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","readmeFilename":"README.md","gitHead":"38cc5187696e8eb34ed6bcf102c8abd589b0b7a2","homepage":"https://github.com/ricmoo/aes-js#readme","_id":"aes-js@4.0.0-beta.4","_nodeVersion":"18.15.0","_npmVersion":"9.5.0","dist":{"shasum":"77ce3e3872ccb0a0081339bbd11f5485d604481a","size":84421,"noattachment":false,"key":"/aes-js/-/aes-js-4.0.0-beta.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-4.0.0-beta.4.tgz"},"_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"directories":{},"maintainers":[{"name":"ricmoo","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aes-js_4.0.0-beta.4_1682420269414_0.803055882524083"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-04-25T10:57:49.617Z","publish_time":1682420269617,"_cnpm_publish_time":1682420269617},"4.0.0-beta.3":{"name":"aes-js","version":"4.0.0-beta.3","description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"@types/mocha":"^9.1.0","@types/node":"^16.7.10","mocha":"^9.2.2","typescript":"^4.7.4"},"exports":{".":{"import":"./lib.esm/index.js","require":"./lib.commonjs/index.js","types":"./types/index.d.ts"}},"scripts":{"auto-build":"npm run build -- -w","build":"tsc --build ./tsconfig.esm.json","build-all":"npm run build && npm run build-commonjs && npm run build-types","build-clean":"npm run clean && npm run build-all","build-commonjs":"tsc --build ./tsconfig.commonjs.json && cp ./package-commonjs.json ./lib.commonjs/package.json","build-types":"tsc --build ./tsconfig.types.json","clean":"rm -rf dist lib.commonjs lib.esm types","test-commonjs":"mocha ./lib.commonjs/tests.js","test-esm":"mocha ./lib.esm/tests.js","test":"npm run test-commonjs && npm run test-esm"},"main":"./lib.commonjs/index.js","module":"./lib.esm/index.js","publishConfig":{"tag":"beta"},"sideEffects":false,"type":"module","types":"./types/index.d.ts","keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"github@ricmoo.com"},"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","readmeFilename":"README.md","gitHead":"b952d23ff27afcfab8eabda5cf033d2ea819ba97","homepage":"https://github.com/ricmoo/aes-js#readme","_id":"aes-js@4.0.0-beta.3","_nodeVersion":"18.7.0","_npmVersion":"8.15.0","dist":{"shasum":"da2253f0ff03a0b3a9e445c8cbdf78e7fda7d48c","size":83951,"noattachment":false,"key":"/aes-js/-/aes-js-4.0.0-beta.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-4.0.0-beta.3.tgz"},"_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"directories":{},"maintainers":[{"name":"ricmoo","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aes-js_4.0.0-beta.3_1664258271938_0.28851671232253273"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-09-27T05:59:40.346Z","publish_time":1664258272187,"_cnpm_publish_time":1664258272187},"4.0.0-beta.2":{"name":"aes-js","version":"4.0.0-beta.2","description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"@types/mocha":"^9.1.0","@types/node":"^16.7.10","mocha":"^9.2.2","typescript":"^4.6.2"},"scripts":{"build":"tsc --build ./tsconfig.json","auto-build":"npm run build -- -w","test":"mocha ./lib/tests.js"},"main":"./lib/index.js","publishConfig":{"tag":"beta"},"type":"module","types":"./lib/index.d.ts","keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"github@ricmoo.com"},"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","readmeFilename":"README.md","gitHead":"66b70f511b31bbdba28c1102ba6db8e963c44c70","homepage":"https://github.com/ricmoo/aes-js#readme","_id":"aes-js@4.0.0-beta.2","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"shasum":"aa4be872a515eac7b54878819864539c9e7401a9","size":66740,"noattachment":false,"key":"/aes-js/-/aes-js-4.0.0-beta.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-4.0.0-beta.2.tgz"},"_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"directories":{},"maintainers":[{"name":"ricmoo","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aes-js_4.0.0-beta.2_1648015070864_0.9524116183291118"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-03-23T05:57:56.048Z","publish_time":1648015070983,"_cnpm_publish_time":1648015070983},"4.0.0-beta.1":{"name":"aes-js","version":"4.0.0-beta.1","description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"@types/mocha":"^9.1.0","@types/node":"^16.7.10","mocha":"^9.2.2","typescript":"^4.6.2"},"scripts":{"build":"tsc --build ./tsconfig.json","auto-build":"npm run build -- -w","test":"mocha ./lib/tests.js"},"main":"./lib/index.js","publishConfig":{"tag":"beta"},"type":"module","types":"./lib/types.d.ts","keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"github@ricmoo.com"},"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","readmeFilename":"README.md","gitHead":"bad4bb2d4f957358cf383d5f75af8db2a2b3b9d8","homepage":"https://github.com/ricmoo/aes-js#readme","_id":"aes-js@4.0.0-beta.1","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"shasum":"0e60b3b253d9f90ec326fa37744d3fb9f7baa28e","size":71702,"noattachment":false,"key":"/aes-js/-/aes-js-4.0.0-beta.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-4.0.0-beta.1.tgz"},"_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"directories":{},"maintainers":[{"name":"ricmoo","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aes-js_4.0.0-beta.1_1648014566207_0.5539909044945062"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-03-23T05:49:31.146Z","publish_time":1648014566385,"_cnpm_publish_time":1648014566385},"3.1.2":{"name":"aes-js","version":"3.1.2","bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"github@ricmoo.com"},"description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"nodeunit":"^0.9.1"},"main":"index.js","scripts":{"test":"nodeunit test/index.js"},"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","gitHead":"7c9fad4add4b349dcb89a4e2125f37defaef3bc8","homepage":"https://github.com/ricmoo/aes-js#readme","_id":"aes-js@3.1.2","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"dist":{"shasum":"db9aabde85d5caabbfc0d4f2a4446960f627146a","size":24255,"noattachment":false,"key":"/aes-js/-/aes-js-3.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-3.1.2.tgz"},"maintainers":[{"name":"ricmoo","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aes-js_3.1.2_1541797590785_0.9621898095904673"},"_hasShrinkwrap":false,"publish_time":1541797590920,"_cnpm_publish_time":1541797590920,"_cnpmcore_publish_time":"2021-12-16T12:23:08.239Z"},"3.1.1":{"name":"aes-js","version":"3.1.1","bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"github@ricmoo.com"},"description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"nodeunit":"^0.9.1"},"main":"index.js","scripts":{"test":"nodeunit test/index.js"},"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","gitHead":"64b5e74c0a6f2f8138c352ab3d0ac5aa769bfe7e","homepage":"https://github.com/ricmoo/aes-js#readme","_id":"aes-js@3.1.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.0","_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"dist":{"shasum":"89fd1f94ae51b4c72d62466adc1a7323ff52f072","size":762248,"noattachment":false,"key":"/aes-js/-/aes-js-3.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-3.1.1.tgz"},"maintainers":[{"name":"ricmoo","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aes-js_3.1.1_1523738293268_0.2848385073043558"},"_hasShrinkwrap":false,"publish_time":1523738293430,"_cnpm_publish_time":1523738293430,"_cnpmcore_publish_time":"2021-12-16T12:23:10.326Z"},"3.1.0":{"name":"aes-js","version":"3.1.0","bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"github@ricmoo.com"},"description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"nodeunit":"0.9.1"},"main":"index.js","scripts":{"test":"nodeunit test/index.js"},"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","gitHead":"583860cc04ca84e67b21bdffe9b9494da8fb0162","homepage":"https://github.com/ricmoo/aes-js#readme","_id":"aes-js@3.1.0","_shasum":"f5f7588494526997cc635cc334c8bb8e967a5d82","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"dist":{"shasum":"f5f7588494526997cc635cc334c8bb8e967a5d82","size":762107,"noattachment":false,"key":"/aes-js/-/aes-js-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-3.1.0.tgz"},"maintainers":[{"name":"ricmoo","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/aes-js-3.1.0.tgz_1492284838664_0.6866449587978423"},"directories":{},"publish_time":1492284841051,"_hasShrinkwrap":false,"_cnpm_publish_time":1492284841051,"_cnpmcore_publish_time":"2021-12-16T12:23:11.566Z"},"3.0.0":{"name":"aes-js","version":"3.0.0","bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"github@ricmoo.com"},"description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"nodeunit":"0.9.1"},"main":"index.js","scripts":{"test":"nodeunit test/index.js"},"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","gitHead":"8ac229a01e5e44aa04012c75fa69222b3953456f","homepage":"https://github.com/ricmoo/aes-js#readme","_id":"aes-js@3.0.0","_shasum":"e21df10ad6c2053295bcbb8dab40b09dbea87e4d","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"dist":{"shasum":"e21df10ad6c2053295bcbb8dab40b09dbea87e4d","size":761945,"noattachment":false,"key":"/aes-js/-/aes-js-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-3.0.0.tgz"},"maintainers":[{"name":"ricmoo","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/aes-js-3.0.0.tgz_1486544402452_0.7938876675907522"},"directories":{},"publish_time":1486544404750,"_hasShrinkwrap":false,"_cnpm_publish_time":1486544404750,"_cnpmcore_publish_time":"2021-12-16T12:23:13.158Z"},"2.1.1":{"name":"aes-js","version":"2.1.1","bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"github@ricmoo.com"},"description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"nodeunit":"0.9.1"},"main":"index.js","scripts":{"test":"nodeunit test/index.js"},"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","gitHead":"8d3fc6f350c0270acc5049d6e1b0e0c19d89036e","homepage":"https://github.com/ricmoo/aes-js#readme","_id":"aes-js@2.1.1","_shasum":"68989763bbade2a39172ea48f4953d1272ff38a7","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"dist":{"shasum":"68989763bbade2a39172ea48f4953d1272ff38a7","size":760446,"noattachment":false,"key":"/aes-js/-/aes-js-2.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-2.1.1.tgz"},"maintainers":[{"name":"ricmoo","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/aes-js-2.1.1.tgz_1486516694913_0.34495386155322194"},"directories":{},"publish_time":1486516695149,"_hasShrinkwrap":false,"_cnpm_publish_time":1486516695149,"_cnpmcore_publish_time":"2021-12-16T12:23:14.342Z"},"2.1.0":{"name":"aes-js","version":"2.1.0","bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"github@ricmoo.com"},"description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"nodeunit":"0.9.1"},"main":"index.js","scripts":{"test":"nodeunit test/index.js"},"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","gitHead":"50f8606d83116dbe85303d89df8b820b2570b8b8","homepage":"https://github.com/ricmoo/aes-js#readme","_id":"aes-js@2.1.0","_shasum":"2bf04b06a05fff29d38e9048ff30dc59f1f0cd74","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.3","_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"dist":{"shasum":"2bf04b06a05fff29d38e9048ff30dc59f1f0cd74","size":759845,"noattachment":false,"key":"/aes-js/-/aes-js-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-2.1.0.tgz"},"maintainers":[{"name":"ricmoo","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/aes-js-2.1.0.tgz_1475595009329_0.32095598871819675"},"directories":{},"publish_time":1475595011351,"_hasShrinkwrap":false,"_cnpm_publish_time":1475595011351,"_cnpmcore_publish_time":"2021-12-16T12:23:15.695Z"},"2.0.0":{"name":"aes-js","version":"2.0.0","bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"github@ricmoo.com"},"description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"nodeunit":"0.9.1"},"main":"index.js","scripts":{"test":"node test/test-aes.js && node test/test-counter.js && node test/test-buffer.js && node test/test-errors.js"},"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","gitHead":"f387521168b36e123019901a0dfc3a3949825a22","homepage":"https://github.com/ricmoo/aes-js#readme","_id":"aes-js@2.0.0","_shasum":"1240cdaca1814605b653278c675cd76940629787","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.3","_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"dist":{"shasum":"1240cdaca1814605b653278c675cd76940629787","size":745046,"noattachment":false,"key":"/aes-js/-/aes-js-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-2.0.0.tgz"},"maintainers":[{"name":"ricmoo","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/aes-js-2.0.0.tgz_1463365603257_0.8474472321104258"},"directories":{},"publish_time":1463365605141,"_hasShrinkwrap":false,"_cnpm_publish_time":1463365605141,"_cnpmcore_publish_time":"2021-12-16T12:23:17.812Z"},"1.0.0":{"name":"aes-js","version":"1.0.0","bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"github@ricmoo.com"},"description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"nodeunit":"0.9.1"},"main":"index.js","scripts":{"test":"node test/test-aes.js && node test/test-counter.js && node test/test-buffer.js"},"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","gitHead":"f4e9eba001b556179fba978288cd1d7714fc9dfa","homepage":"https://github.com/ricmoo/aes-js#readme","_id":"aes-js@1.0.0","_shasum":"41300dfc4efe4fc6c85ccce48906d54e05fe2a41","_from":".","_npmVersion":"2.14.20","_nodeVersion":"4.4.0","_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"maintainers":[{"name":"ricmoo","email":""}],"dist":{"shasum":"41300dfc4efe4fc6c85ccce48906d54e05fe2a41","size":744080,"noattachment":false,"key":"/aes-js/-/aes-js-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-1.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/aes-js-1.0.0.tgz_1459638333821_0.1607301903422922"},"directories":{},"publish_time":1459638336698,"_hasShrinkwrap":false,"_cnpm_publish_time":1459638336698,"_cnpmcore_publish_time":"2021-12-16T12:23:19.305Z"},"0.2.4":{"name":"aes-js","version":"0.2.4","bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"github@ricmoo.com"},"description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"nodeunit":"0.9.1"},"main":"index.js","scripts":{"test":"node test/test-aes.js && node test/test-counter.js && node test/test-buffer.js"},"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","gitHead":"79f330d770d536d1fbb7c0845b41b60f05e5e385","homepage":"https://github.com/ricmoo/aes-js","_id":"aes-js@0.2.4","_shasum":"94b881ab717286d015fa219e08fb66709dda5a3d","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"maintainers":[{"name":"ricmoo","email":""}],"dist":{"shasum":"94b881ab717286d015fa219e08fb66709dda5a3d","size":825151,"noattachment":false,"key":"/aes-js/-/aes-js-0.2.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-0.2.4.tgz"},"_npmOperationalInternal":{"host":"packages-5-east.internal.npmjs.com","tmp":"tmp/aes-js-0.2.4.tgz_1456558944058_0.594102936796844"},"directories":{},"publish_time":1456558945353,"_hasShrinkwrap":false,"_cnpm_publish_time":1456558945353,"_cnpmcore_publish_time":"2021-12-16T12:23:21.175Z"},"0.2.3":{"name":"aes-js","version":"0.2.3","bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"github@ricmoo.com"},"description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"nodeunit":"0.9.1"},"main":"index.js","scripts":{"test":"node test/test-aes.js && node test/test-counter.js && node test/test-buffer.js"},"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","gitHead":"785c00df822c06e2076b71f6e23665e79061494f","homepage":"https://github.com/ricmoo/aes-js","_id":"aes-js@0.2.3","_shasum":"1592f2f265104a4cc1248d0d6406e32ac380e083","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"maintainers":[{"name":"ricmoo","email":""}],"dist":{"shasum":"1592f2f265104a4cc1248d0d6406e32ac380e083","size":825110,"noattachment":false,"key":"/aes-js/-/aes-js-0.2.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-0.2.3.tgz"},"_npmOperationalInternal":{"host":"packages-5-east.internal.npmjs.com","tmp":"tmp/aes-js-0.2.3.tgz_1456290172167_0.11849974258802831"},"directories":{},"publish_time":1456290173167,"_hasShrinkwrap":false,"_cnpm_publish_time":1456290173167,"_cnpmcore_publish_time":"2021-12-16T12:23:23.232Z"},"0.2.2":{"name":"aes-js","version":"0.2.2","bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"aes-js@ricmoo.com"},"description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"nodeunit":"0.9.1"},"main":"index.js","scripts":{"test":"node test/test-aes.js && node test/test-counter.js"},"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","gitHead":"11b4ad4a7df344e5111483112c66875803e03351","homepage":"https://github.com/ricmoo/aes-js","_id":"aes-js@0.2.2","_shasum":"e57c5b0a29323b2c3f18e4bdb6f20c4ab6e2ec6a","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"maintainers":[{"name":"ricmoo","email":""}],"dist":{"shasum":"e57c5b0a29323b2c3f18e4bdb6f20c4ab6e2ec6a","size":743012,"noattachment":false,"key":"/aes-js/-/aes-js-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-0.2.2.tgz"},"_npmOperationalInternal":{"host":"packages-6-west.internal.npmjs.com","tmp":"tmp/aes-js-0.2.2.tgz_1454428723587_0.8871503286063671"},"directories":{},"publish_time":1454428726574,"_hasShrinkwrap":false,"_cnpm_publish_time":1454428726574,"_cnpmcore_publish_time":"2021-12-16T12:23:25.210Z"},"0.2.1":{"name":"aes-js","version":"0.2.1","bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"aes-js@ricmoo.com"},"description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"nodeunit":"0.9.1"},"main":"index.js","scripts":{"test":"node test/test-aes.js && node test/test-counter.js"},"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","gitHead":"19926bfa3391dbab119c6de0fd7c529055aab01b","homepage":"https://github.com/ricmoo/aes-js","_id":"aes-js@0.2.1","_shasum":"21e69a443df79c3aa727aff0d63f169003142ba0","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"maintainers":[{"name":"ricmoo","email":""}],"dist":{"shasum":"21e69a443df79c3aa727aff0d63f169003142ba0","size":742758,"noattachment":false,"key":"/aes-js/-/aes-js-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-0.2.1.tgz"},"directories":{},"publish_time":1447632757411,"_hasShrinkwrap":false,"_cnpm_publish_time":1447632757411,"_cnpmcore_publish_time":"2021-12-16T12:23:27.069Z"},"0.2.0":{"name":"aes-js","version":"0.2.0","bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"aes-js@ricmoo.com"},"description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"nodeunit":"0.9.1"},"main":"index.js","scripts":{"test":"node test/test-aes.js && node test/test-counter.js"},"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","gitHead":"d1290cf7b13011366b7b0913cacb5010b8b5bce4","homepage":"https://github.com/ricmoo/aes-js","_id":"aes-js@0.2.0","_shasum":"ee88f81fa55efd3fd48112179c453b7aab64e5a3","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"maintainers":[{"name":"ricmoo","email":""}],"dist":{"shasum":"ee88f81fa55efd3fd48112179c453b7aab64e5a3","size":825798,"noattachment":false,"key":"/aes-js/-/aes-js-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-0.2.0.tgz"},"directories":{},"publish_time":1442349854549,"_hasShrinkwrap":false,"_cnpm_publish_time":1442349854549,"_cnpmcore_publish_time":"2021-12-16T12:23:29.730Z"},"0.1.0":{"name":"aes-js","version":"0.1.0","bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"aes-js@ricmoo.com"},"description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"nodeunit":"0.9.1"},"main":"index.js","scripts":{"test":"node test/test-aes.js"},"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","gitHead":"84bbd40f694ce08518439e76d06f5a7b67b68702","homepage":"https://github.com/ricmoo/aes-js","_id":"aes-js@0.1.0","_shasum":"3b124885ce607a9974963b519636951ceb3b203f","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"maintainers":[{"name":"ricmoo","email":""}],"dist":{"shasum":"3b124885ce607a9974963b519636951ceb3b203f","size":825334,"noattachment":false,"key":"/aes-js/-/aes-js-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-0.1.0.tgz"},"directories":{},"publish_time":1425677989713,"_hasShrinkwrap":false,"_cnpm_publish_time":1425677989713,"_cnpmcore_publish_time":"2021-12-16T12:23:31.386Z"},"0.0.2":{"name":"aes-js","version":"0.0.2","bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"aes-js@ricmoo.com"},"description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"nodeunit":"0.9.1"},"main":"index.js","scripts":{"test":"node test/test-aes.js"},"repository":{"type":"git","url":"git://github.com/ricmoo/aes-js.git"},"keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","gitHead":"53f4f3ac8f63be318de0f439b9ba2a0b5264de43","homepage":"https://github.com/ricmoo/aes-js","_id":"aes-js@0.0.2","_shasum":"be0580b80be82452208bf9a2d2fd3b735b2d3ea8","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"maintainers":[{"name":"ricmoo","email":""}],"dist":{"shasum":"be0580b80be82452208bf9a2d2fd3b735b2d3ea8","size":823259,"noattachment":false,"key":"/aes-js/-/aes-js-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-0.0.2.tgz"},"directories":{},"publish_time":1425601632394,"_hasShrinkwrap":false,"_cnpm_publish_time":1425601632394,"_cnpmcore_publish_time":"2021-12-16T12:23:33.058Z"},"0.0.1":{"name":"aes-js","version":"0.0.1","description":"A pure JavaScript implementation of the AES block cipher and all common modes of operation.","devDependencies":{"nodeunit":"0.9.1"},"main":"index.js","scripts":{"test":"node test/test-aes.js"},"keywords":["aes","aes-ctr","aes-ofb","aes-ecb","aes-cbc","aes-cfb","encrypt","decrypt","block","cipher"],"author":{"name":"Richard Moore","email":"me@ricmoo.com"},"license":"MIT","gitHead":"7c3a66abf3781d132ce2da42561a94a4f8658d04","_id":"aes-js@0.0.1","_shasum":"024009523e4495ddbf7fc2ecaf47680faf5fc3d4","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"ricmoo","email":"me@ricmoo.com"},"maintainers":[{"name":"ricmoo","email":""}],"dist":{"shasum":"024009523e4495ddbf7fc2ecaf47680faf5fc3d4","size":818695,"noattachment":false,"key":"/aes-js/-/aes-js-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/aes-js/download/aes-js-0.0.1.tgz"},"directories":{},"publish_time":1425452271062,"_hasShrinkwrap":false,"_cnpm_publish_time":1425452271062,"_cnpmcore_publish_time":"2021-12-16T12:23:34.840Z"}},"readme":"AES-JS\n======\n\n[![npm version](https://badge.fury.io/js/aes-js.svg)](https://badge.fury.io/js/aes-js)\n\nA pure JavaScript implementation of the AES block cipher algorithm and all common modes of operation (CBC, CFB, CTR, ECB and OFB).\n\nFeatures\n--------\n\n- Pure JavaScript (with no dependencies)\n- Supports all key sizes (128-bit, 192-bit and 256-bit)\n- Supports all common modes of operation (CBC, CFB, CTR, ECB and OFB)\n- Works in either node.js or web browsers\n\nMigrating from 2.x to 3.x\n-------------------------\n\nThe utility functions have been renamed in the 3.x branch, since they were causing a great deal of confusion converting between bytes and string.\n\nThe examples have also been updated to encode binary data as printable hex strings.\n\n**Strings and Bytes**\n\nStrings should **NOT** be used as keys. UTF-8 allows variable length, multi-byte characters, so a string that is 16 *characters* long may not be 16 *bytes* long.\n\nAlso, UTF8 should **NOT** be used to store arbitrary binary data as it is a *string* encoding format, not a *binary* encoding format.\n\n```javascript\n// aesjs.util.convertStringToBytes(aString)\n// Becomes:\naesjs.utils.utf8.toBytes(aString)\n\n\n// aesjs.util.convertBytesToString(aString)\n// Becomes:\naesjs.utils.utf8.fromBytes(aString)\n```\n\n**Bytes and Hex strings**\n\nBinary data, such as encrypted bytes, can safely be stored and printed as hexidecimal strings.\n\n```javascript\n// aesjs.util.convertStringToBytes(aString, 'hex')\n// Becomes:\naesjs.utils.hex.toBytes(aString)\n\n\n// aesjs.util.convertBytesToString(aString, 'hex')\n// Becomes:\naesjs.utils.hex.fromBytes(aString)\n```\n\n**Typed Arrays**\n\nThe 3.x and above versions of aes-js use [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instead of Array, which reduces code size when used with Browserify (it no longer pulls in Buffer) and is also about **twice** the speed.\n\nHowever, if you need to support browsers older than IE 10, you should continue using version 2.x.\n\n\nAPI\n===\n\n#### Node.js\n\nTo install `aes-js` in your node.js project:\n\n```\nnpm install aes-js\n```\n\nAnd to access it from within node, simply add:\n\n```javascript\nvar aesjs = require('aes-js');\n```\n\n#### Web Browser\n\nTo use `aes-js` in a web page, add the following:\n\n```html\n<script type=\"text/javascript\" src=\"https://cdn.rawgit.com/ricmoo/aes-js/e27b99df/index.js\"></script>\n```\n\nKeys\n----\n\nAll keys must be 128 bits (16 bytes), 192 bits (24 bytes) or 256 bits (32 bytes) long.\n\nThe library work with `Array`, `Uint8Array` and `Buffer` objects as well as any *array-like* object (i.e. must have a `length` property, and have a valid byte value for each entry).\n\n```javascript\n// 128-bit, 192-bit and 256-bit keys\nvar key_128 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];\nvar key_192 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n               16, 17, 18, 19, 20, 21, 22, 23];\nvar key_256 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n               16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,\n               29, 30, 31];\n\n// or, you may use Uint8Array:\nvar key_128_array = new Uint8Array(key_128);\nvar key_192_array = new Uint8Array(key_192);\nvar key_256_array = new Uint8Array(key_256);\n\n// or, you may use Buffer in node.js:\nvar key_128_buffer = Buffer.from(key_128);\nvar key_192_buffer = Buffer.from(key_192);\nvar key_256_buffer = Buffer.from(key_256);\n```\n\n\nTo generate keys from simple-to-remember passwords, consider using a password-based key-derivation function such as [scrypt](https://www.npmjs.com/package/scrypt-js) or [bcrypt](https://www.npmjs.com/search?q=bcrypt).\n\n\nCommon Modes of Operation\n-------------------------\n\nThere are several modes of operations, each with various pros and cons. In general though, the **CBC** and **CTR** modes are recommended. The **ECB is NOT recommended.**, and is included primarily for completeness.\n\n### CTR - Counter (recommended)\n\n```javascript\n// An example 128-bit key (16 bytes * 8 bits/byte = 128 bits)\nvar key = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ];\n\n// Convert text to bytes\nvar text = 'Text may be any length you wish, no padding is required.';\nvar textBytes = aesjs.utils.utf8.toBytes(text);\n\n// The counter is optional, and if omitted will begin at 1\nvar aesCtr = new aesjs.ModeOfOperation.ctr(key, new aesjs.Counter(5));\nvar encryptedBytes = aesCtr.encrypt(textBytes);\n\n// To print or store the binary data, you may convert it to hex\nvar encryptedHex = aesjs.utils.hex.fromBytes(encryptedBytes);\nconsole.log(encryptedHex);\n// \"a338eda3874ed884b6199150d36f49988c90f5c47fe7792b0cf8c7f77eeffd87\n//  ea145b73e82aefcf2076f881c88879e4e25b1d7b24ba2788\"\n\n// When ready to decrypt the hex string, convert it back to bytes\nvar encryptedBytes = aesjs.utils.hex.toBytes(encryptedHex);\n\n// The counter mode of operation maintains internal state, so to\n// decrypt a new instance must be instantiated.\nvar aesCtr = new aesjs.ModeOfOperation.ctr(key, new aesjs.Counter(5));\nvar decryptedBytes = aesCtr.decrypt(encryptedBytes);\n\n// Convert our bytes back into text\nvar decryptedText = aesjs.utils.utf8.fromBytes(decryptedBytes);\nconsole.log(decryptedText);\n// \"Text may be any length you wish, no padding is required.\"\n```\n\n\n### CBC - Cipher-Block Chaining (recommended)\n\n```javascript\n// An example 128-bit key\nvar key = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ];\n\n// The initialization vector (must be 16 bytes)\nvar iv = [ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,35, 36 ];\n\n// Convert text to bytes (text must be a multiple of 16 bytes)\nvar text = 'TextMustBe16Byte';\nvar textBytes = aesjs.utils.utf8.toBytes(text);\n\nvar aesCbc = new aesjs.ModeOfOperation.cbc(key, iv);\nvar encryptedBytes = aesCbc.encrypt(textBytes);\n\n// To print or store the binary data, you may convert it to hex\nvar encryptedHex = aesjs.utils.hex.fromBytes(encryptedBytes);\nconsole.log(encryptedHex);\n// \"104fb073f9a131f2cab49184bb864ca2\"\n\n// When ready to decrypt the hex string, convert it back to bytes\nvar encryptedBytes = aesjs.utils.hex.toBytes(encryptedHex);\n\n// The cipher-block chaining mode of operation maintains internal\n// state, so to decrypt a new instance must be instantiated.\nvar aesCbc = new aesjs.ModeOfOperation.cbc(key, iv);\nvar decryptedBytes = aesCbc.decrypt(encryptedBytes);\n\n// Convert our bytes back into text\nvar decryptedText = aesjs.utils.utf8.fromBytes(decryptedBytes);\nconsole.log(decryptedText);\n// \"TextMustBe16Byte\"\n```\n\n\n### CFB - Cipher Feedback \n\n```javascript\n// An example 128-bit key\nvar key = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ];\n\n// The initialization vector (must be 16 bytes)\nvar iv = [ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,35, 36 ];\n\n// Convert text to bytes (must be a multiple of the segment size you choose below)\nvar text = 'TextMustBeAMultipleOfSegmentSize';\nvar textBytes = aesjs.utils.utf8.toBytes(text);\n\n// The segment size is optional, and defaults to 1\nvar segmentSize = 8;\nvar aesCfb = new aesjs.ModeOfOperation.cfb(key, iv, segmentSize);\nvar encryptedBytes = aesCfb.encrypt(textBytes);\n\n// To print or store the binary data, you may convert it to hex\nvar encryptedHex = aesjs.utils.hex.fromBytes(encryptedBytes);\nconsole.log(encryptedHex);\n// \"55e3af2638c560b4fdb9d26a630733ea60197ec23deb85b1f60f71f10409ce27\"\n\n// When ready to decrypt the hex string, convert it back to bytes\nvar encryptedBytes = aesjs.utils.hex.toBytes(encryptedHex);\n\n// The cipher feedback mode of operation maintains internal state,\n// so to decrypt a new instance must be instantiated.\nvar aesCfb = new aesjs.ModeOfOperation.cfb(key, iv, 8);\nvar decryptedBytes = aesCfb.decrypt(encryptedBytes);\n\n// Convert our bytes back into text\nvar decryptedText = aesjs.utils.utf8.fromBytes(decryptedBytes);\nconsole.log(decryptedText);\n// \"TextMustBeAMultipleOfSegmentSize\"\n```\n\n\n### OFB - Output Feedback\n\n```javascript\n// An example 128-bit key\nvar key = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ];\n\n// The initialization vector (must be 16 bytes)\nvar iv = [ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,35, 36 ];\n\n// Convert text to bytes\nvar text = 'Text may be any length you wish, no padding is required.';\nvar textBytes = aesjs.utils.utf8.toBytes(text);\n\nvar aesOfb = new aesjs.ModeOfOperation.ofb(key, iv);\nvar encryptedBytes = aesOfb.encrypt(textBytes);\n\n// To print or store the binary data, you may convert it to hex\nvar encryptedHex = aesjs.utils.hex.fromBytes(encryptedBytes);\nconsole.log(encryptedHex);\n// \"55e3af2655dd72b9f32456042f39bae9accff6259159e608be55a1aa313c598d\n//  b4b18406d89c83841c9d1af13b56de8eda8fcfe9ec8e75e8\"\n\n// When ready to decrypt the hex string, convert it back to bytes\nvar encryptedBytes = aesjs.utils.hex.toBytes(encryptedHex);\n\n// The output feedback mode of operation maintains internal state,\n// so to decrypt a new instance must be instantiated.\nvar aesOfb = new aesjs.ModeOfOperation.ofb(key, iv);\nvar decryptedBytes = aesOfb.decrypt(encryptedBytes);\n\n// Convert our bytes back into text\nvar decryptedText = aesjs.utils.utf8.fromBytes(decryptedBytes);\nconsole.log(decryptedText);\n// \"Text may be any length you wish, no padding is required.\"\n```\n\n\n### ECB - Electronic Codebook (NOT recommended)\n\nThis mode is **not** recommended. Since, for a given key, the same plaintext block in produces the same ciphertext block out, this mode of operation can leak data, such as patterns. For more details and examples, see the Wikipedia article, [Electronic Codebook](http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_Codebook_.28ECB.29).\n\n```javascript\n// An example 128-bit key\nvar key = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ];\n\n// Convert text to bytes\nvar text = 'TextMustBe16Byte';\nvar textBytes = aesjs.utils.utf8.toBytes(text);\n\nvar aesEcb = new aesjs.ModeOfOperation.ecb(key);\nvar encryptedBytes = aesEcb.encrypt(textBytes);\n\n// To print or store the binary data, you may convert it to hex\nvar encryptedHex = aesjs.utils.hex.fromBytes(encryptedBytes);\nconsole.log(encryptedHex);\n// \"a7d93b35368519fac347498dec18b458\"\n\n// When ready to decrypt the hex string, convert it back to bytes\nvar encryptedBytes = aesjs.utils.hex.toBytes(encryptedHex);\n\n// Since electronic codebook does not store state, we can\n// reuse the same instance.\n//var aesEcb = new aesjs.ModeOfOperation.ecb(key);\nvar decryptedBytes = aesEcb.decrypt(encryptedBytes);\n\n// Convert our bytes back into text\nvar decryptedText = aesjs.utils.utf8.fromBytes(decryptedBytes);\nconsole.log(decryptedText);\n// \"TextMustBe16Byte\"\n```\n\n\n\nBlock Cipher\n------------\n\nYou should usually use one of the above common modes of operation. Using the block cipher algorithm directly is also possible using **ECB** as that mode of operation is merely a thin wrapper.\n\nBut this might be useful to experiment with custom modes of operation or play with block cipher algorithms.\n\n```javascript\n\n// the AES block cipher algorithm works on 16 byte bloca ks, no more, no less\nvar text = \"ABlockIs16Bytes!\";\nvar textAsBytes = aesjs.utils.utf8.toBytes(text)\nconsole.log(textAsBytes);\n// [65, 66, 108, 111, 99, 107, 73, 115, 49, 54, 66, 121, 116, 101, 115, 33]\n\n// create an instance of the block cipher algorithm\nvar key = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8, 9, 7, 9, 3];\nvar aes = new aesjs.AES(key);\n\n// encrypt...\nvar encryptedBytes = aes.encrypt(textAsBytes);\nconsole.log(encryptedBytes);\n// [136, 15, 199, 174, 118, 133, 233, 177, 143, 47, 42, 211, 96, 55, 107, 109] \n\n// To print or store the binary data, you may convert it to hex\nvar encryptedHex = aesjs.utils.hex.fromBytes(encryptedBytes);\nconsole.log(encryptedHex);\n// \"880fc7ae7685e9b18f2f2ad360376b6d\"\n\n// When ready to decrypt the hex string, convert it back to bytes\nvar encryptedBytes = aesjs.utils.hex.toBytes(encryptedHex);\n\n// decrypt...\nvar decryptedBytes = aes.decrypt(encryptedBytes);\nconsole.log(decryptedBytes);\n// [65, 66, 108, 111, 99, 107, 73, 115, 49, 54, 66, 121, 116, 101, 115, 33]\n\n\n// decode the bytes back into our original text\nvar decryptedText = aesjs.utils.utf8.fromBytes(decryptedBytes);\nconsole.log(decryptedText);\n// \"ABlockIs16Bytes!\"\n```\n\n\nNotes\n=====\n\nWhat is a Key\n-------------\n\nThis seems to be a point of confusion for many people new to using encryption. You can think of the key as the *\"password\"*. However, these algorithms require the *\"password\"* to be a specific length.\n\nWith AES, there are three possible key lengths, 128-bit (16 bytes), 192-bit (24 bytes) or 256-bit (32 bytes). When you create an AES object, the key size is automatically detected, so it is important to pass in a key of the correct length.\n\nOften, you wish to provide a password of arbitrary length, for example, something easy to remember or write down. In these cases, you must come up with a way to transform the password into a key of a specific length. A **Password-Based Key Derivation Function** (PBKDF) is an algorithm designed for this exact purpose.\n\nHere is an example, using the popular (possibly obsolete?) pbkdf2:\n\n```javascript\nvar pbkdf2 = require('pbkdf2');\n\nvar key_128 = pbkdf2.pbkdf2Sync('password', 'salt', 1, 128 / 8, 'sha512');\nvar key_192 = pbkdf2.pbkdf2Sync('password', 'salt', 1, 192 / 8, 'sha512');\nvar key_256 = pbkdf2.pbkdf2Sync('password', 'salt', 1, 256 / 8, 'sha512');\n```\n\nAnother possibility, is to use a hashing function, such as SHA256 to hash the password, but this method is vulnerable to [Rainbow Attacks](http://en.wikipedia.org/wiki/Rainbow_table), unless you use a [salt](http://en.wikipedia.org/wiki/Salt_(cryptography)).\n\nPerformance\n-----------\n\nTodo...\n\nTests\n-----\n\nA test suite has been generated (`test/test-vectors.json`) from a known correct implementation, [pycrypto](https://www.dlitz.net/software/pycrypto/). To generate new test vectors, run `python generate-tests.py`.\n\nTo run the node.js test suite:\n\n```\nnpm test\n```\n\nTo run the web browser tests, open the `test/test.html` file in your browser.\n\nFAQ\n---\n\n#### How do I get a question I have added?\n\nE-mail me at aes-js@ricmoo.com with any questions, suggestions, comments, et cetera.\n\n\nDonations\n---------\n\nObviously, it's all licensed under the MIT license, so use it as you wish; but if you'd like to buy me a coffee, I won't complain. =)\n\n- Bitcoin - `1K1Ax9t6uJmjE4X5xcoVuyVTsiLrYRqe2P`\n- Ethereum - `0x70bDC274028F3f391E398dF8e3977De64FEcBf04`\n","_attachments":{},"homepage":"https://github.com/ricmoo/aes-js#readme","bugs":{"url":"http://github.com/ricmoo/aes-js/issues","email":"github@ricmoo.com"},"license":"MIT"}