{"_id":"@ashiteam/ashi-smule","_rev":"1-ecc4d1033e1fe3a3ef65c3a0b8c6336f","name":"@ashiteam/ashi-smule","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.1":{"name":"@ashiteam/ashi-smule","version":"1.0.1","description":"AES encription/decription library for my use","main":"ashi-aes.js","scripts":{"build":"tsc","test":"npm run build && node ./dist/test.js","buildPackage":"npm run build && grunt","dist":"npm run buildPackage && cd npm && npm publish --access public"},"keywords":["smule"],"author":{"name":"Asanga Weerapura"},"license":"ISC","devDependencies":{"@types/cheerio":"^0.22.11","@types/dateformat":"^3.0.0","@types/got":"^9.4.1","@types/grunt":"^0.4.25","@types/node":"^11.10.4","@types/sanitize-filename":"^1.1.28","@types/tunnel":"0.0.0","cheerio":"^1.0.0-rc.2","dateformat":"^3.0.3","got":"^9.6.0","grunt":"^1.0.3","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify-es":"git://github.com/gruntjs/grunt-contrib-uglify.git#harmony","ky":"^0.9.1","ky-universal":"^0.1.0","sanitize-filename":"^1.6.1","tslint":"^5.13.1","tunnel":"0.0.6","typescript":"~3.2.2","uglify-es":"^3.3.9"},"peerDependencies":{"@types/cheerio":"^0.22.11","@types/sanitize-filename":"^1.1.28","cheerio":"^1.0.0-rc.2","ky":"^0.9.1","ky-universal":"^0.1.0","sanitize-filename":"^1.6.1"},"dependencies":{},"_id":"@ashiteam/ashi-smule@1.0.1","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-Of7Gf9EV6Upcneg3w9W0weF4+YW6DMNSDx5CKdG8T2aVu+xmXp7TvX+JdSZT6/MEo3Fy6B0ZVt9Y/eO2mo24EA==","shasum":"c846cc0421d9e726d7557f71f6f0fb5e440d238a","tarball":"https://registry.npmjs.org/@ashiteam/ashi-smule/-/ashi-smule-1.0.1.tgz","fileCount":15,"unpackedSize":85971,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMXy6CRA9TVsSAnZWagAAuVcP/jaNCJ5iBfGkm0COjwFp\nbsVhYCfY4EIa5szeJtuRocx7ZNPNGNPJoFvl31/UzAVqRb1z8nCtFjb2Jpj5\ncm7DWwM2n7M8gPOf5szt4acrOOzCzgwlaxoMYpiHFDX5NIWLyzjiw/wtgelo\nOt8QxZU69qoYxPOgaPVGobc+qQL9bNntjN5PzEITywhd4JcHnmjrgGH1zay9\n2i3pxclV+9gNmuzYro1LxGPVHJtiQoKktzak1kQ0Kv9iqpgjtbkmdv04qT51\nC4NFb7X9Zgfqut4TQO7bftL+pENEoO+Bt49F/v9qyJ62Kux20muBYgGM4QLA\nMsRxvy0FFHfJAqTuUdp1VMv/JfMWES6x0/wNywinQXNVT2S51+t0EdlZN4cS\nosicckHqqx4BVBV3hk9NqJgBGfsgsm3QmAnAAIuUbmm1BwIMPSrIgjESYjU7\nWFHsuViqLIUzVQPC4N1PsDLsKP95YRBfXbYWA8iRzgELNKftwt2gH1PPxWlq\nR5JsK00NxqsKgDj67XCkmRl7/cXfRiczypITpbQuWiMWnaZYYNmwIkq8bNCw\nb51GkW2yoLeUo79tuUTan8tZ9oioKHpnU6VeVaavPcWde2cZvD6oKsDO+e7C\nxBIWwBfAyuEqWUZKTcV7Qy2YZjED0hAIs0LCzBOYXiQ+9d9iungjGmucszG3\n3Xvs\r\n=hkUF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5MwWYjQCzMncCOb0fXuP7OgKDNQAMuQkpLqzAa7sK6AIgdkPpK9MaK278cwBnf8qEGzsnEoH8GfWJ7gHd39WJmVo="}]},"maintainers":[{"name":"asangawee","email":"asangaw@rogers.com"}],"_npmUser":{"name":"asangawee","email":"asangaw@rogers.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ashi-smule_1.0.1_1580301497696_0.6743611602354618"},"_hasShrinkwrap":false}},"time":{"created":"2020-01-29T12:38:17.505Z","1.0.1":"2020-01-29T12:38:17.879Z","modified":"2022-04-04T15:45:41.696Z"},"maintainers":[{"name":"asangawee","email":"asangaw@rogers.com"}],"description":"AES encription/decription library for my use","keywords":["smule"],"author":{"name":"Asanga Weerapura"},"license":"ISC","readme":"# AshiTEAM AES\n\nA helper class for my use to encrypt/decrypt binary data and string data using a password.\n\n### Installing\n\nInstall using npm\n\n```\nnpm i @ashiteam/ashi-aes --save\n```\n\nThe password to use for encryption/decryption can be passed in the constructor or as an optional parameter to the encrypt/decrypt functions.\n\nTo use, first import, create a variable and use as follows\n\n```\n\nimport { AshiAes } from '@ashiteam/ashi-aes';\n\nconst aes = new AshiAes('my password');\nconst data =\n'This is a test string to encrypt. This is a test string to encrypt. This is a test string to encrypt. This is a test string to encrypt';\nconst encData = aes.encryptText(data);\nconst decData = aes.decryptText(encData);\n\nconsole.log(encData);\nconsole.log(data);\nconsole.log(decData);\nconsole.log(decData == data ? 'All good' : 'ERROR');\n\n```\n\nTo encrypt binarry data, use the encryptData & decryptData functions. You can pass in a Buffer and get back a Buffer to and from these functions.\n\n```\n\nconst encBinaryData = aes.encryptData(binaryData);\nconst decBinaryData = aes.decryptData(encBinaryData);\n\n```\n\nTo pass the password to the functions, do as follows\n\n```\n\nimport { AshiAes } from '@ashiteam/ashi-aes';\ns\nconst aes = new AshiAes('');\n\nconst encData = aes.encryptText(data, 'password to use');\nconst decData = aes.decryptText(encData, 'password to use');\n\n```\n\n## Some Implementation Details\n\nThe key used for encryption/decryption is a 256 bit key generated using pbkdf2 using a random salt of 16 bytes long using 100 iterations. The 100 iterations is the default, this however can be changed to a different value by setting the iterations property.\n\nWhen encrypting:\n\n- The random salt is stored as the firs 16 bytes of the output.\n- A randome iv of 16 bytes is generated and used and stored as the second 16 bytes of the output.\n- The encrypted data is stored starting from the 32nd byte\n\nWhen decrypting:\n\n- The salt from the first 16 bytes are used to generate the key\n- The second 16 bytes are used as the initial vector (iv)\n\n#### Note\n\n**Data encrypted using other tools or languages (such as Java, C#, ...) can be decrypted by this code (and vice versa) provided the salt & iv are stored as the first 32 bytes, and the key is generated as mentiond above.**\n\n## Authors\n\n- **Asanga Weerapura** - _All work_\n\n## License\n\nThis project is licensed under the ISC License.\n\n## Acknowledgments\n\n- node-forge\n- buffer\n","readmeFilename":"README.md"}