{"_id":"aes-256-gcm","_rev":"4-44372286cc145b8e57010a64f59ea909","name":"aes-256-gcm","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"aes-256-gcm","version":"1.0.0","description":"Simplifies encryption/decryption using the AES 256 GCM algorithm.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/catcher-in-the-try/aes-256-gcm.git"},"keywords":["aes","aes-256-gcm","crypto","encryption","decryption","aes","aes-256"],"author":{"name":"Anton Ivanov","email":"anton@ivanov.hk"},"license":"Unlicense","bugs":{"url":"https://github.com/catcher-in-the-try/aes-256-gcm/issues"},"homepage":"https://github.com/catcher-in-the-try/aes-256-gcm#readme","gitHead":"c51fdd9f776b9fef2892fd6d30b65e848f8444a5","_id":"aes-256-gcm@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"anton-ivanov","email":"anton@ivanov.hk"},"dist":{"integrity":"sha512-TW7A8gruSIr1Cf/YKNkRdjCiZ1fB3uLOUqfsURQEQwOzUA5VNSIlXZgNayHO4Xa6RVI5DHbBeW5EwHlCg4cUdA==","shasum":"a255176bebbbde525b3bd441efeb64de2eb56d56","tarball":"https://registry.npmjs.org/aes-256-gcm/-/aes-256-gcm-1.0.0.tgz","fileCount":4,"unpackedSize":4959,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAm402htHgYatIE3MImtxskpsgVf44qd/yNsOemEL1ZwAiANgVaAf8ciHbu+dTORPQqTa4/z6FNrszLboVuxgrBx+g=="}]},"maintainers":[{"name":"anton-ivanov","email":"anton@ivanov.hk"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aes-256-gcm_1.0.0_1519616949553_0.07651260520578074"},"_hasShrinkwrap":false},"1.0.1":{"name":"aes-256-gcm","version":"1.0.1","description":"Simplifies encryption/decryption using the AES 256 GCM algorithm.","main":"index.js","scripts":{"test":"echo \"No test specified for aes-256-gcm\""},"repository":{"type":"git","url":"git+https://github.com/catcher-in-the-try/aes-256-gcm.git"},"keywords":["aes","aes-256-gcm","crypto","encryption","decryption","aes","aes-256"],"author":{"name":"Anton Ivanov","email":"anton@ivanov.hk"},"license":"Unlicense","bugs":{"url":"https://github.com/catcher-in-the-try/aes-256-gcm/issues"},"homepage":"https://github.com/catcher-in-the-try/aes-256-gcm#readme","gitHead":"60202a88eef13f61c10f555bc8f5eaca1281f42a","_id":"aes-256-gcm@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"anton-ivanov","email":"anton@ivanov.hk"},"dist":{"integrity":"sha512-fs2zb9+HSTWo1/FXTy/zbpKNBMrxz3nO8WdUiYfDB4O1KN3AoOegs3DTnbfhuYEQ07W0/+T/wMYy67tJ/KmsGg==","shasum":"bc0cee52b05179a9cdcf951014970903c76e4b31","tarball":"https://registry.npmjs.org/aes-256-gcm/-/aes-256-gcm-1.0.1.tgz","fileCount":4,"unpackedSize":4964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbRxiYCRA9TVsSAnZWagAAk3wP/3PTfaIXeZpJne1T9GFS\nN0MdM8/cTJcFewvyjRJ8WZ6XKJhx0OSGOP3CbJoSQrVQeSQ3Y1p6/SWZwxwq\nqFXZ+L75fA3JEnezwCbXUOnmCz4fSYNE9Zj8YAC38tV+KTXRiR0idfoQgdCy\nGomntzOobEyKpht/w3qc4WBGx2+yyWc79HHO3P8FjcgkYMfZMgmPxVhReNX+\nMxc3CURt4onkCTv2GSZBMwczkCv4tI84zZzdu1TauNezLQ/qIwB+NoGWz+SL\nv31mVt5j27QLm7suA9IXeF9BwzmD/jIhtO1gpOnJtHwPVHgZExCG+G9sWkAN\ndOE1h6Dotjr/TVjz8B7F0Kis/zW19Mc8GntkR3ntjG57yxiXmeCg0o4OqFT3\n4tZW0S1wJ5p1FUWm8AkbTZXWKiHSm1bJXvBxbZOy1GaNV0rV0sfvDRtsot8x\nERWP0NzFxbVlhjck0dlHKObS4kJ2pOmJEYz4HdYVu1HY+Usr9E4FVMMZ4Q5V\n5p1Nm74e1JKc8thCg5rBqjtmlXO62zL7xXP6d7j89g4KNPntID6lu34Y04d1\ngzzxN5zcVo4MRqBu9CsIumgV8BNRfPMULqJhPC0R0177Je7U2crawBS5I0RM\nikL8dSBd42/WHd6mGDe0ulYylwH3+EdYrqFrt76WMMWJdTqN/XAh6LWudDY1\n18XF\r\n=Sw64\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9biKijrBEviK5cOwi/blBizmaswbg6UNQFr8cNT+z7gIhALdJfitAW72NpK9r2p6Ns554oyTojPVnsr0PqZU+VANk"}]},"maintainers":[{"name":"anton-ivanov","email":"anton@ivanov.hk"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aes-256-gcm_1.0.1_1531386008393_0.4842561185975134"},"_hasShrinkwrap":false},"1.0.3":{"name":"aes-256-gcm","version":"1.0.3","description":"Simplifies encryption/decryption using the AES 256 GCM algorithm.","main":"index.js","scripts":{"test":"echo \"No test specified for aes-256-gcm\""},"repository":{"type":"git","url":"git+https://github.com/catcher-in-the-try/aes-256-gcm.git"},"keywords":["aes","aes-256-gcm","crypto","encryption","decryption","aes","aes-256"],"author":{"name":"Anton Ivanov","email":"anton@ivanov.hk"},"license":"Unlicense","bugs":{"url":"https://github.com/catcher-in-the-try/aes-256-gcm/issues"},"homepage":"https://github.com/catcher-in-the-try/aes-256-gcm#readme","gitHead":"7f6e4e17a3c13cedbf82d9651829b4b7fe35181a","_id":"aes-256-gcm@1.0.3","_npmVersion":"6.1.0","_nodeVersion":"8.11.2","_npmUser":{"name":"anton-ivanov","email":"anton@ivanov.hk"},"dist":{"integrity":"sha512-+8ZxU/Oq7EBueJKmUyeNni7YGfcgL3RSoXvOgHPn9FPtRSDctWwH1gJb+TfcwnoLZ32y4DWIHJTIoWnHNI5qIw==","shasum":"1c314023adcaac8a7246efef97867b630adc6872","tarball":"https://registry.npmjs.org/aes-256-gcm/-/aes-256-gcm-1.0.3.tgz","fileCount":4,"unpackedSize":4998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbSbiGCRA9TVsSAnZWagAAY7oP/1AvPs3eOeM2V20BXZtC\nX65U/Z/DNFDCEtLnu8R5CDa9WFQ6amJDO17SElQD7TFbq13XJXezLEWAur/1\nBW/qoFovcjUq78zxpBrDReaMWGYknkgiahpzI4ErF1Yox4OABgn4DXjh1XH9\nQ3r7S9cU1uqclvaZ52JCQI+vEdjM9JAuThxCXA4zgnRTXcAZb6dPwL9b7Ccs\nsqoxCYJBSMI7o4e/hRh7RZXh/uUFvnBXZyHP9O8GMzxOYcRKUVgIJQ8GlFV4\n6/8l3Y/EA6UP3ALAER0u6iU61EwVGyqyChZ8D1vRIXlx9LIiB2n11Nm2juuc\nEAkEfmdHWQEE0dTG114fekBLRsteFYW0DeUjismI7xmMc/SAYraYou2fanjd\njSIDnWQV15BSTUU2FlL1zzp0OUPbB5meJ5uEIhWnruKILyVQOWsavKl8esT0\nY9LJr01WqtuT4JGMcLIp6YdLdI58f75rGD6Imk8O8Crf7UrCaK1Fz5ZF0Xds\ntBAE6v9Cg8KBreAz1ooQKMiQVlt+JnppWrPP7+abFBDkrAKXEK8CrLnefIgH\nh3U+P0v2qAzmSdAzl7oSXQV7k8L32XhNuxoCE3TBQPQubCDe//BIuizwdBEI\nSvIToiqdKFuxPcSQAiK+CP/NOeLCQWwVrEnv7KjNzGaCXE8epRW1vZA20vci\nEaQG\r\n=TL92\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBXXq1oWBFC2dz43lC/slPcW68UQxTzMCK9HngurPRlJAiAfhsnVKCJwU6rTHsWehhmK5HaS+URSLxHIVFDjuZljFA=="}]},"maintainers":[{"name":"anton-ivanov","email":"anton@ivanov.hk"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aes-256-gcm_1.0.3_1531558022239_0.6624220643494538"},"_hasShrinkwrap":false}},"time":{"created":"2018-02-26T03:49:09.553Z","1.0.0":"2018-02-26T03:49:09.701Z","modified":"2022-04-11T12:50:00.093Z","1.0.1":"2018-07-12T09:00:08.453Z","1.0.3":"2018-07-14T08:47:02.866Z"},"maintainers":[{"name":"anton-ivanov","email":"anton@ivanov.hk"}],"description":"Simplifies encryption/decryption using the AES 256 GCM algorithm.","homepage":"https://github.com/catcher-in-the-try/aes-256-gcm#readme","keywords":["aes","aes-256-gcm","crypto","encryption","decryption","aes","aes-256"],"repository":{"type":"git","url":"git+https://github.com/catcher-in-the-try/aes-256-gcm.git"},"author":{"name":"Anton Ivanov","email":"anton@ivanov.hk"},"bugs":{"url":"https://github.com/catcher-in-the-try/aes-256-gcm/issues"},"license":"Unlicense","readme":"# AES-256-GCM encryption/decryption shortcuts #\r\n\r\nA static class that simplifies encryption/decryption using the AES 256 GCM algorithm.\r\n\r\nJust use a one-liner to encrypt or decrypt - the IV and tag are handled\r\nautomatically.\r\n\r\n## Example ##\r\n\r\n```js\r\nconst Aes = require('aes-256-gcm');\r\n\r\n// Must be 32 bytes.\r\nconst SHARED_SECRET = '12345678901234567890123456789012';\r\n\r\n// Encrypt:\r\nlet { ciphertext, iv, tag } = Aes.encrypt('hi', SHARED_SECRET);\r\n\r\n//   ciphertext: 'VOE='\r\n//   iv: '0K6oPWsBAHLXYtLu5VAvsQ=='\r\n//   tag: 'hCae3Lt5sAK3oNAnUh5emA==' \r\n\r\n\r\n// Decrypt:\r\nlet cleartext = Aes.decrypt(ciphertext, iv, tag, SHARED_SECRET;\r\n\r\n// `cleartext` contains:\r\n// 'hi'\r\n\r\n```\r\n\r\n## Methods ##\r\n\r\n### static encrypt(text, secret) ###\r\n\r\nEncrypts the `text` using the 256-bit shared key (`secret`) and returns an object\r\ncontaining three base64-encoded strings:\r\n\r\n```json\r\n{ \r\n  \"ciphertext\": \"(string)\", \r\n  \"iv\": \"(string)\", \r\n  \"tag\": \"(string)\"\r\n}\r\n```\r\n\r\nAll of those strings must be passed to the end user to successfully decrypt the\r\ntext.\r\n\r\n### static decrypt(ciphertext, iv, tag, secret) ###\r\n\r\nDecrypts the `ciphertext` using the `iv` and authentication tag `tag` received\r\nfrom the encryption function, and using the 256-bit shared key (`secret`).\r\n\r\nReturns the decoded string.","readmeFilename":"README.md"}