{"_id":"@10dimen/crypto-toolkit","_rev":"4-560eb5e11750ef54c069113102d52739","name":"@10dimen/crypto-toolkit","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@10dimen/crypto-toolkit","version":"1.0.0","author":{"name":"Onur Dikmen"},"license":"ISC","_id":"@10dimen/crypto-toolkit@1.0.0","maintainers":[{"name":"techkir","email":"dikmenonur@gmail.com"}],"dist":{"shasum":"6db2eace971dbb83467fcae38a7ebb3f3b5cfb5c","tarball":"https://registry.npmjs.org/@10dimen/crypto-toolkit/-/crypto-toolkit-1.0.0.tgz","fileCount":3,"integrity":"sha512-+P+xe84BP//5arqjERPopsJHCmD5r24fVqf2+DNjqH82dDkO8f/6rbpf5fu3OcWJ12OInuJ6UKRzutVm+4gmxw==","signatures":[{"sig":"MEUCIQDG5hOICfHzYidijbDTvgdYkgzKgf3zNQvhRF+Le2jhVQIgZNfFNStv5ej5OPrD5cobIWAnpmUgVyrv7tNxR60625w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4879},"main":"src/index.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"techkir","email":"dikmenonur@gmail.com"},"_npmVersion":"10.5.0","description":"**CryptoToolkit** is a comprehensive encryption and data security library designed for web applications. It provides easy-to-use functions for encrypting and decrypting data, as well as managing encryption keys. With support for **AES-GCM** and **RSA-OAEP","directories":{},"_nodeVersion":"21.7.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/crypto-toolkit_1.0.0_1722234616331_0.6012651071658659","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@10dimen/crypto-toolkit","version":"1.0.1","author":{"name":"Onur Dikmen"},"license":"ISC","_id":"@10dimen/crypto-toolkit@1.0.1","maintainers":[{"name":"techkir","email":"dikmenonur@gmail.com"}],"dist":{"shasum":"6cf516bab73a08511b841cae44abc86c50cf626d","tarball":"https://registry.npmjs.org/@10dimen/crypto-toolkit/-/crypto-toolkit-1.0.1.tgz","fileCount":3,"integrity":"sha512-RkQsPNMmTkPTUsSFMEV62T2wRxU3EGmL5vV3NSV6skwFq6O46uwjXgBJDNZm6+yERW8MIx4lkusu7d4Q/PykUQ==","signatures":[{"sig":"MEUCIHEnuMJMHufUgwCo0I+e9EqaMyJSfDZBOuPkIR+Bb+vNAiEAvnVrgVi7dFsw2AN0ZaNnRQH1a0/DEmGdiXbm3GDd4NM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7192},"main":"src/index.ts","gitHead":"5e73436ec7279aec4210d120f0322be569adad17","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"techkir","email":"dikmenonur@gmail.com"},"_npmVersion":"10.5.0","description":"**CryptoToolkit** is a comprehensive encryption and data security library designed for web applications. It provides easy-to-use functions for encrypting and decrypting data, as well as managing encryption keys. With support for **AES-GCM** and **RSA-OAEP","directories":{},"_nodeVersion":"21.7.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/crypto-toolkit_1.0.1_1722234830845_0.12324969662163565","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@10dimen/crypto-toolkit","version":"1.0.2","author":{"name":"Onur Dikmen"},"license":"ISC","_id":"@10dimen/crypto-toolkit@1.0.2","maintainers":[{"name":"techkir","email":"dikmenonur@gmail.com"}],"dist":{"shasum":"1d61cedfece0c328916e3418d8ac7f242ce6ddbe","tarball":"https://registry.npmjs.org/@10dimen/crypto-toolkit/-/crypto-toolkit-1.0.2.tgz","fileCount":3,"integrity":"sha512-wsKk7rWX9vW5HbENYQtcnyVT7/gar1TUn8km0v6GvO2XsIdIunzFxjcesthbAd3DUs32C6865WyN8gY/mz3Pvw==","signatures":[{"sig":"MEYCIQDge0nLqmuaY+rxfoSfaUubb1GGgmElLlUcW4yET6fVcwIhAPifYIBkQ70ql9/uYe7ylKCqbqK6mKogNPWRnWVeWijR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10410},"main":"src/index.ts","gitHead":"5e73436ec7279aec4210d120f0322be569adad17","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"techkir","email":"dikmenonur@gmail.com"},"_npmVersion":"10.5.0","description":"**CryptoToolkit** is a comprehensive encryption and data security library designed for web applications. It provides easy-to-use functions for encrypting and decrypting data, as well as managing encryption keys. With support for **AES-GCM** and **RSA-OAEP","directories":{},"_nodeVersion":"21.7.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/crypto-toolkit_1.0.2_1722234922405_0.41312180371118634","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@10dimen/crypto-toolkit","version":"1.0.3","author":{"name":"Onur Dikmen"},"license":"ISC","_id":"@10dimen/crypto-toolkit@1.0.3","maintainers":[{"name":"techkir","email":"dikmenonur@gmail.com"}],"dist":{"shasum":"db01a3855060384c8a66d2d9ebe986c77a535b51","tarball":"https://registry.npmjs.org/@10dimen/crypto-toolkit/-/crypto-toolkit-1.0.3.tgz","fileCount":3,"integrity":"sha512-N5QLsjzuTK38Id4lL5w9sLfOyFLgBjjt2CRDCtmriAE0LJSx+0MH5HgtYY0WX87+uTZ6a3Q9cMvRoZuC9BkKpQ==","signatures":[{"sig":"MEUCIQCYD9Z1ZoGrkHKNuf20AKjS4DyQpyC3viuyIHx1xdkRMAIgANqILLNL8tqNR9uUeGCUVgCKGdjBzuYkn1glzIZU/gQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10166},"main":"src/index.ts","gitHead":"5e73436ec7279aec4210d120f0322be569adad17","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"techkir","email":"dikmenonur@gmail.com"},"_npmVersion":"10.5.0","description":"**CryptoToolkit** is a comprehensive encryption and data security library designed for web applications. It provides easy-to-use functions for encrypting and decrypting data, as well as managing encryption keys. With support for **AES-GCM** and **RSA-OAEP","directories":{},"_nodeVersion":"21.7.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/crypto-toolkit_1.0.3_1722235063749_0.6950146347470603","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"@10dimen/crypto-toolkit","version":"1.0.4","description":"**CryptoToolkit** is a comprehensive encryption and data security library designed for web applications. It provides easy-to-use functions for encrypting and decrypting data, as well as managing encryption keys. With support for **AES-GCM** and **RSA-OAEP","main":"src/index.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Onur Dikmen"},"license":"ISC","_id":"@10dimen/crypto-toolkit@1.0.4","gitHead":"5e73436ec7279aec4210d120f0322be569adad17","_nodeVersion":"21.7.1","_npmVersion":"10.5.0","dist":{"integrity":"sha512-LCahdyoVA1TXEB4BQmCNeFo1L0uPAfKmHgvgnNCCTVRrkpCNxEPwdS7X+RBDTmNw2mVlEsyxE54Rr3YdJ7TukQ==","shasum":"2a6240f4c70c44831da5cbf7f1d0dea0b6e56062","tarball":"https://registry.npmjs.org/@10dimen/crypto-toolkit/-/crypto-toolkit-1.0.4.tgz","fileCount":3,"unpackedSize":10333,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAHCV9y79PHFx48DPxl7ph1qy+kzqHAfSscvBxG4CdccAiEA2DTQeYZMClL09FkkvhRv/BH/HlQE5FUszpZ8cvXyzgA="}]},"_npmUser":{"name":"techkir","email":"dikmenonur@gmail.com"},"directories":{},"maintainers":[{"name":"techkir","email":"dikmenonur@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/crypto-toolkit_1.0.4_1722235252366_0.7111227970113703"},"_hasShrinkwrap":false}},"time":{"created":"2024-07-29T06:30:16.223Z","modified":"2024-07-29T06:40:52.716Z","1.0.0":"2024-07-29T06:30:16.449Z","1.0.1":"2024-07-29T06:33:50.982Z","1.0.2":"2024-07-29T06:35:22.563Z","1.0.3":"2024-07-29T06:37:43.911Z","1.0.4":"2024-07-29T06:40:52.508Z"},"author":{"name":"Onur Dikmen"},"license":"ISC","description":"**CryptoToolkit** is a comprehensive encryption and data security library designed for web applications. It provides easy-to-use functions for encrypting and decrypting data, as well as managing encryption keys. With support for **AES-GCM** and **RSA-OAEP","maintainers":[{"name":"techkir","email":"dikmenonur@gmail.com"}],"readme":"# CryptoToolkit\r\n\r\n**CryptoToolkit** is a powerful and flexible encryption library designed for modern web applications. It provides comprehensive utilities for data encryption, decryption, and key management, supporting **AES-GCM** and **RSA-OAEP** algorithms. Additionally, it includes functionalities for hashing data using SHA-512.\r\n\r\n## Features\r\n\r\n- **Key Management:** Easily generate, export, and import public and private keys.\r\n- **Encryption and Decryption:** Securely encrypt and decrypt data with advanced algorithms.\r\n- **Data Storage:** Store encrypted data in `localStorage` or `sessionStorage`.\r\n- **Hashing:** Compute SHA-512 hashes of data for integrity checks and more.\r\n- **User-Friendly API:** Integrate encryption features seamlessly into your applications.\r\n\r\n## Installation\r\n\r\nTo install `CryptoToolkit`, you can use npm or yarn:\r\n\r\n```bash\r\nnpm install @10dimen/crypto-toolkit\r\n```\r\n\r\nOr with yarn:\r\n\r\n```bash\r\nyarn add @10dimen/crypto-toolkit\r\n```\r\n\r\n## Usage\r\n\r\n### Encryption and Decryption\r\n\r\nEncrypt and store data:\r\n\r\n```javascript\r\nimport { CryptoUtils } from '@10dimen/crypto-toolkit';\r\n\r\n// Encrypt and store data in localStorage\r\nawait CryptoUtils.encryptAndStore('myKey', 'mySecretData');\r\n```\r\n\r\nDecrypt data from storage:\r\n\r\n```javascript\r\nimport { CryptoUtils } from '@10dimen/crypto-toolkit';\r\n\r\n// Retrieve and decrypt data from localStorage\r\nconst decryptedData = await CryptoUtils.decryptFromStorage('myKey');\r\nconsole.log(decryptedData); // Output: 'mySecretData'\r\n```\r\n\r\n### Key Management\r\n\r\nGenerate a new key pair:\r\n\r\n```javascript\r\nconst keys = await CryptoUtils.generateKey();\r\nconsole.log(keys);\r\n```\r\n\r\nExport and import keys:\r\n\r\n```javascript\r\n// Export public key\r\nconst publicKey = await CryptoUtils.exportPublicKey();\r\nconsole.log(publicKey);\r\n\r\n// Import public key\r\nconst importedPublicKey = await CryptoUtils.importPublicKey(publicKey);\r\n```\r\n\r\n### Hashing\r\n\r\nHash data using SHA-512:\r\n\r\n```javascript\r\nconst hashedData = await CryptoUtils.hashSHA512('myData');\r\nconsole.log(hashedData);\r\n```\r\n\r\n**Note:** MD5 hashing is not supported by the Web Crypto API and is not included in this library. For MD5 hashing, consider using additional libraries.\r\n\r\n## API Reference\r\n\r\n### `CryptoUtils.encrypt(data: string | ArrayBuffer): Promise<ArrayBuffer>`\r\n\r\nEncrypts the provided data using RSA-OAEP.\r\n\r\n- **data:** The data to encrypt (can be a string or an `ArrayBuffer`).\r\n\r\n### `CryptoUtils.decrypt(encryptedData: ArrayBuffer): Promise<string>`\r\n\r\nDecrypts the provided data using RSA-OAEP.\r\n\r\n- **encryptedData:** The encrypted data to decrypt (must be an `ArrayBuffer`).\r\n\r\n### `CryptoUtils.encryptAndStore(key: string, data: string, storage: string = 'localStorage'): Promise<void>`\r\n\r\nEncrypts the data and stores it in the specified storage.\r\n\r\n- **key:** The key under which the data will be stored.\r\n- **data:** The data to encrypt and store.\r\n- **storage:** Storage type, either `'localStorage'` or `'sessionStorage'`.\r\n\r\n### `CryptoUtils.decryptFromStorage(key: string, storage: string = 'localStorage'): Promise<string | null>`\r\n\r\nRetrieves and decrypts data from the specified storage.\r\n\r\n- **key:** The key under which the data is stored.\r\n- **storage:** Storage type, either `'localStorage'` or `'sessionStorage'`.\r\n\r\n### `CryptoUtils.hashSHA512(data: string): Promise<string>`\r\n\r\nHashes the provided data using SHA-512.\r\n\r\n- **data:** The data to hash.\r\n\r\n## Contributing\r\n\r\nWe welcome contributions! To contribute:\r\n\r\n1. **Fork the repository.**\r\n2. **Create a new branch (`git checkout -b feature/YourFeature`).**\r\n3. **Make your changes.**\r\n4. **Commit your changes (`git commit -am 'Add new feature'`).**\r\n5. **Push to the branch (`git push origin feature/YourFeature`).**\r\n6. **Open a Pull Request.**\r\n\r\nPlease refer to the [CONTRIBUTING.md](CONTRIBUTING.md) for more details.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n","readmeFilename":"README"}