{"_id":"@anuragkmr_45/encrypt-decrypt","_rev":"1-bbda838ebc5eae8a468b2b619542da9a","name":"@anuragkmr_45/encrypt-decrypt","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@anuragkmr_45/encrypt-decrypt","version":"1.0.0","description":"secure package for encryption and decryption","main":"./src/index.js","type":"module","scripts":{"test":"node ./test/index.test.js","dev":"node ./src/index.js"},"repository":{"type":"git","url":"git+https://github.com/anuragkmr45/crypto-utils.git"},"keywords":["encrypt","decrypt","encryption","decryption","cipher","aes256","security","hash","Base64url","AES","DES","SHA-1","SHA1","SHA256"],"author":{"name":"Anurag Kumar"},"license":"MIT","bugs":{"url":"https://github.com/anuragkmr45/crypto-utils/issues"},"homepage":"https://github.com/anuragkmr45/crypto-utils#readme","_id":"@anuragkmr_45/encrypt-decrypt@1.0.0","gitHead":"88e8f039369fa95691b9d7417c3d45843a2a597c","_nodeVersion":"21.4.0","_npmVersion":"10.2.5","dist":{"integrity":"sha512-+QoHJtVq39IjxNP2xx0qPItCanMTTG+p3hP+nq9OLEvnISoYoKo9TH6tAzIYHmSKkjbdyELpKN7FDCAzhNUbuw==","shasum":"27b88f4700fb7fd2f9bc21102d1bbf831e9c9881","tarball":"https://registry.npmjs.org/@anuragkmr_45/encrypt-decrypt/-/encrypt-decrypt-1.0.0.tgz","fileCount":5,"unpackedSize":5302,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOe6DUF59mRsc1kH3VVh991ie3HeILsXWe2JxHINVgFAIgZHMvhwxBydj6LLygihPKprO6E1F3ehW0wIVfaVvNN/w="}]},"_npmUser":{"name":"anuragkmr_45","email":"anurag45kmr@gmail.com"},"directories":{},"maintainers":[{"name":"anuragkmr_45","email":"anurag45kmr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/encrypt-decrypt_1.0.0_1715999895223_0.24309253657211638"},"_hasShrinkwrap":false},"1.0.1":{"name":"@anuragkmr_45/encrypt-decrypt","version":"1.0.1","description":"secure package for encryption and decryption","main":"./src/index.js","type":"module","scripts":{"test":"node ./test/index.test.js","dev":"node ./src/index.js"},"repository":{"type":"git","url":"git+https://github.com/anuragkmr45/encrypt-decrypt.git"},"keywords":["encrypt-decrypt","encrypt","decrypt","encryption","decryption","crypto","cipher","aes256","security","hash","Base64url","AES","DES","DES-EDE3","DES-EDE3-CBC","SHA-1","SHA1","encrypt-decrypt-package","encrypt-decrypt-js","encrypt-decrypt-node","SHA256"],"author":{"name":"Anurag Kumar"},"license":"MIT","bugs":{"url":"https://github.com/anuragkmr45/encrypt-decrypt/issues"},"homepage":"https://github.com/anuragkmr45/encrypt-decrypt#readme","_id":"@anuragkmr_45/encrypt-decrypt@1.0.1","gitHead":"5fcfdd2ee33b1e4fb14bb25c851dd075636e4280","_nodeVersion":"21.4.0","_npmVersion":"10.2.5","dist":{"integrity":"sha512-yMC49l0TBEOTbPxVByLzzA2gWgiaNi1rDKnBpX2INZugzzPFxZVvGTGhWa7f4Sm2BcZ7y4Js8fCvejOMf1Z1aw==","shasum":"4c12ae6cdf42550e09bfb03d2b92007399b47652","tarball":"https://registry.npmjs.org/@anuragkmr_45/encrypt-decrypt/-/encrypt-decrypt-1.0.1.tgz","fileCount":6,"unpackedSize":9641,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDr6FF3CsZ1WeSNRKHTeid4noeMiqYUU2T0pOAVgRezQQIgKxJQKgIq17dfg6AGPg2A05YeFG22xPc0c8yNWZFtd+c="}]},"_npmUser":{"name":"anuragkmr_45","email":"anurag45kmr@gmail.com"},"directories":{},"maintainers":[{"name":"anuragkmr_45","email":"anurag45kmr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/encrypt-decrypt_1.0.1_1716036398489_0.009737472344558906"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-18T02:38:15.109Z","1.0.0":"2024-05-18T02:38:15.361Z","modified":"2024-05-18T12:46:38.844Z","1.0.1":"2024-05-18T12:46:38.644Z"},"maintainers":[{"name":"anuragkmr_45","email":"anurag45kmr@gmail.com"}],"description":"secure package for encryption and decryption","homepage":"https://github.com/anuragkmr45/encrypt-decrypt#readme","keywords":["encrypt-decrypt","encrypt","decrypt","encryption","decryption","crypto","cipher","aes256","security","hash","Base64url","AES","DES","DES-EDE3","DES-EDE3-CBC","SHA-1","SHA1","encrypt-decrypt-package","encrypt-decrypt-js","encrypt-decrypt-node","SHA256"],"repository":{"type":"git","url":"git+https://github.com/anuragkmr45/encrypt-decrypt.git"},"author":{"name":"Anurag Kumar"},"bugs":{"url":"https://github.com/anuragkmr45/encrypt-decrypt/issues"},"license":"MIT","readme":"# @anuragkmr_45/encrypt-decrypt\r\n\r\n@anuragkmr_45/encrypt-decrypt is a simple, lightweight library for encrypting and decrypting data using the <b>AES-256-GCM algorithm</b>. It is designed to make encryption straightforward and secure, leveraging Node.js's crypto module for robust cryptographic operations.\r\n\r\n## Table of Contents\r\n\r\n- [Installation](#installation)\r\n- [Usage](#usage)\r\n- [Contributing](#contributing)\r\n- [License](#license)\r\n\r\n## Installation\r\n\r\n```\r\nnpm install @anuragkmr_45/encrypt-decrypt\r\n```\r\n\r\n## Usage\r\n\r\n### Importing @anuragkmr_45/encrypt-decrypt :\r\n\r\nImport the @anuragkmr_45/encrypt-decrypt module into your project\r\n```\r\nimport encryptDecrypt from 'encryptDecrypt';\r\n```\r\n\r\n### Creating an Instance :\r\n\r\nCreate an instance of @anuragkmr_45/encrypt-decrypt by providing a secret key. The secret key must be a non-empty string.\r\n\r\n```\r\nconst secretKey = 'you-should-pick-something-strong-and-secure';\r\n\r\nconst encryptDecrypt = encryptDecrypt(secretKey);\r\n```\r\n\r\n### Encrypting Data\r\nTo encrypt data, use the encrypt method. It converts the input into a secure, encrypted string.\r\n\r\n```\r\nconst data = 'Hello World !!';\r\n\r\nconst encryptedData = encryptDecrypt.encrypt(data);\r\n\r\nconsole.log('Encrypted Data:', encryptedData);\r\n```\r\n\r\n### Decrypting Data\r\n\r\nTo decrypt data, use the decrypt method. It converts the encrypted string back to its original form.\r\n\r\n```\r\nconst decryptedData = encryptDecrypt.decrypt(encryptedData);\r\nconsole.log('Decrypted Data:', decryptedData);\r\n```\r\n\r\n## Example\r\n```\r\nimport encryptDecrypt from 'encryptDecrypt';\r\n\r\nconst secretKey = 'you-should-pick-something-strong-and-secure';\r\n\r\nconst encryptDecrypt = encryptDecrypt(secretKey);\r\n\r\nconst data = 'Hello World !!';\r\n\r\n// encrypt the data\r\nconst encryptedData = encryptDecrypt.encrypt(data);\r\nconsole.log('Encrypted Data:', encryptedData);\r\n\r\n// Decrypt the data\r\nconst decryptedData = encryptDecrypt.decrypt(encryptedData);\r\nconsole.log('Decrypted Data:', decryptedData);\r\n```\r\n\r\n## Configuration Options\r\n\r\nWhen creating a <b>encryptDecrypt instance</b> , you can provide an optional configuration object with the following properties:\r\n\r\n<ul>\r\n    <li>'encoding' : The encoding format for the encrypted output. Default is 'hex'.\r\n    </li>\r\n    <li>'saltLength' :  The length of the salt used in key derivation. Default is 64.\r\n    </li>\r\n    <li>'pbkdf2Iterations' :  The number of iterations for the PBKDF2 key derivation function. Default is 100000.\r\n    </li>\r\n</ul>\r\n\r\n### Example with Options\r\n```\r\nconst options = {\r\n    encoding: 'base64',\r\n    saltLength: 32,\r\n    pbkdf2Iterations: 200000\r\n};\r\n\r\nconst encryptDecrypt = encryptDecrypt(secretKey, options);\r\n```\r\n\r\n## Error Handling\r\n\r\nencrypt-decrypt will throw an error in the following situations:\r\n\r\n<ul>\r\n    <li>If the secret key is not a non-empty string.</li>\r\n    <li>If the value to be encrypted or decrypted is null or undefined.</li>\r\n</ul>\r\n\r\n\r\n## License\r\nThe MIT License (MIT)\r\n\r\n```\r\nThe MIT License (MIT)\r\n  \r\nCopyright (c) 2024 Anurag Kumar\r\n  \r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n  \r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n  \r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n```","readmeFilename":"Readme.MD"}