{"_id":"@cometa-tec-br/react-native-aes-encryptor","_rev":"4-d9c3c7fed85fac3f878775f893ac6790","name":"@cometa-tec-br/react-native-aes-encryptor","dist-tags":{"latest":"1.0.8"},"versions":{"1.0.0":{"name":"@cometa-tec-br/react-native-aes-encryptor","version":"1.0.0","keywords":["react-native","react-component","ios","android","aes","crypto","mobile","async","sha1","sha256","sha512","pbkdf2","hmac256","hmac512","uuid"],"author":{"name":"Allan Fernando"},"license":"MIT","_id":"@cometa-tec-br/react-native-aes-encryptor@1.0.0","maintainers":[{"name":"cometa.tec.br","email":"allan-sjp@hotmail.com"}],"homepage":"https://github.com/OAllanFernando/react-native-aes-encryptor","bugs":{"url":"https://github.com/OAllanFernando/react-native-aes-encryptor/issues"},"dist":{"shasum":"e78e0e9df25bcf8917c8c67ad57bd0abfbb67952","tarball":"https://registry.npmjs.org/@cometa-tec-br/react-native-aes-encryptor/-/react-native-aes-encryptor-1.0.0.tgz","fileCount":17,"integrity":"sha512-OQ4y3FSz/x+T6hBrH2Mo53uw7IwSIvtZXid1FlQD48XfUlYhQvrb7TvFHPLceLGvSpueX26DPoQgJ6qwcN7scQ==","signatures":[{"sig":"MEQCIFfKwIyf9iSx0ZXawoPuE61bLDMRx7k+NBklBxgquE4zAiAbJCdlEEfjn/RYAcZrNQM63hbut4YE3et0yyMmqOM0Vw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46026},"main":"index.js","types":"index.d.ts","gitHead":"0ee452720e3d7d394fada496d289eb69459e58a0","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"cometa.tec.br","email":"allan-sjp@hotmail.com"},"repository":{"url":"git://github.com/OAllanFernando/react-native-aes-encryptor.git","type":"git"},"_npmVersion":"10.8.2","description":"Modern AES encryption library for React Native — simple, fast, and secure.","directories":{},"_nodeVersion":"18.20.8","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/react-native-aes-encryptor_1.0.0_1762021561651_0.40840634899794415","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@cometa-tec-br/react-native-aes-encryptor","version":"1.0.6","keywords":["react-native","react-component","ios","android","aes","crypto","mobile","async","sha1","sha256","sha512","pbkdf2","hmac256","hmac512","uuid"],"author":{"name":"Allan Fernando"},"license":"MIT","_id":"@cometa-tec-br/react-native-aes-encryptor@1.0.6","maintainers":[{"name":"cometa.tec.br","email":"allan-sjp@hotmail.com"}],"homepage":"https://github.com/OAllanFernando/react-native-aes-encryptor","bugs":{"url":"https://github.com/OAllanFernando/react-native-aes-encryptor/issues"},"dist":{"shasum":"820dede44e3f7a5cf2de8b70a9ebaf9fe98b3434","tarball":"https://registry.npmjs.org/@cometa-tec-br/react-native-aes-encryptor/-/react-native-aes-encryptor-1.0.6.tgz","fileCount":17,"integrity":"sha512-4PdxSM+Ls+vvynVlxiFPBw89AUBs1tid8hvCUO8W/S2F1rQCOuzt7NX/RsplkTyYcpEklFwt+VDWfJ8TWc0Kmw==","signatures":[{"sig":"MEUCIQD0S1zSEf6/pWkKsBp4//v6qgtvBf81GLCsDTQjqZ9K0wIgLxR0U+t4yCvDqFd8c0G8Iso//vAJPRTcMkPf0P7L12A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":45982},"main":"index.js","types":"index.d.ts","gitHead":"86b3c5b3fda8d895f147807e5152dde82898f46e","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"cometa.tec.br","email":"allan-sjp@hotmail.com"},"repository":{"url":"git://github.com/OAllanFernando/react-native-aes-encryptor.git","type":"git"},"_npmVersion":"10.8.2","description":"Modern AES encryption library for React Native — simple, fast, and secure.","directories":{},"_nodeVersion":"18.20.8","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/react-native-aes-encryptor_1.0.6_1762023934880_0.5516659784115956","host":"s3://npm-registry-packages-npm-production"}},"1.0.7":{"name":"@cometa-tec-br/react-native-aes-encryptor","version":"1.0.7","keywords":["react-native","react-component","ios","android","aes","crypto","mobile","async","sha1","sha256","sha512","pbkdf2","hmac256","hmac512","uuid"],"author":{"name":"Allan Fernando"},"license":"MIT","_id":"@cometa-tec-br/react-native-aes-encryptor@1.0.7","maintainers":[{"name":"cometa.tec.br","email":"allan-sjp@hotmail.com"}],"homepage":"https://github.com/OAllanFernando/react-native-aes-encryptor","bugs":{"url":"https://github.com/OAllanFernando/react-native-aes-encryptor/issues"},"dist":{"shasum":"5a47998dcbcb241e22c4697823e47105409cdb28","tarball":"https://registry.npmjs.org/@cometa-tec-br/react-native-aes-encryptor/-/react-native-aes-encryptor-1.0.7.tgz","fileCount":17,"integrity":"sha512-vpP0s+X5U3EsWaxmAfgahVpHm2m+R1IJVgRtvP0Bu5qUWD6APSo0uGlIwwFtVzwAEfqokS/Et283uML366He1w==","signatures":[{"sig":"MEUCIQC26+mEdP/wc+hCwmSrJSALsO6qtaCbY09mZvu8rsEijQIgfJBG4kVmNhHGsXHbFAbU20JgqQBZxJ7BxjZoBfis714=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46159},"main":"index.js","types":"index.d.ts","gitHead":"7357c47bebd14ebd935c6184d5b9692fbbda5826","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"cometa.tec.br","email":"allan-sjp@hotmail.com"},"repository":{"url":"git://github.com/OAllanFernando/react-native-aes-encryptor.git","type":"git"},"_npmVersion":"10.8.2","description":"Modern AES encryption library for React Native — simple, fast, and secure.","directories":{},"_nodeVersion":"18.20.8","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/react-native-aes-encryptor_1.0.7_1762024597234_0.019423080446819174","host":"s3://npm-registry-packages-npm-production"}},"1.0.8":{"name":"@cometa-tec-br/react-native-aes-encryptor","version":"1.0.8","publishConfig":{"access":"public"},"description":"Modern AES encryption library for React Native — simple, fast, and secure.","main":"index.js","types":"index.d.ts","author":{"name":"Allan Fernando"},"license":"MIT","keywords":["react-native","react-component","ios","android","aes","crypto","mobile","async","sha1","sha256","sha512","pbkdf2","hmac256","hmac512","uuid"],"homepage":"https://github.com/OAllanFernando/react-native-aes-encryptor","bugs":{"url":"https://github.com/OAllanFernando/react-native-aes-encryptor/issues"},"repository":{"type":"git","url":"git://github.com/OAllanFernando/react-native-aes-encryptor.git"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_id":"@cometa-tec-br/react-native-aes-encryptor@1.0.8","gitHead":"962b7ac3cff47981599f965d77a5d1aa9f33ef41","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"integrity":"sha512-xFRFMaNeEfjZBSERCgGLjIsG9i03hLHp5xMQvZH3hhXMwcWwQlnHEDrDV0UnJW3JyGVk6ZIqrjiO2o8OMziYUQ==","shasum":"3fe716cc9ef46ad3754f9c6eab1674eea9bd5f55","tarball":"https://registry.npmjs.org/@cometa-tec-br/react-native-aes-encryptor/-/react-native-aes-encryptor-1.0.8.tgz","fileCount":17,"unpackedSize":46159,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDbc4U0Kn+X8IgKxPpKJZrf9JIbxfqMwzh4ptwDkYwVawIhAKKIrb59uJrjTXLfc52Qq+r8Z1q8FksAgAgzOgmofwY8"}]},"_npmUser":{"name":"cometa.tec.br","email":"allan-sjp@hotmail.com"},"directories":{},"maintainers":[{"name":"cometa.tec.br","email":"allan-sjp@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-native-aes-encryptor_1.0.8_1762351618302_0.4723156571757563"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-01T18:26:01.472Z","modified":"2025-11-05T14:06:58.713Z","1.0.0":"2025-11-01T18:26:01.860Z","1.0.6":"2025-11-01T19:05:35.071Z","1.0.7":"2025-11-01T19:16:37.414Z","1.0.8":"2025-11-05T14:06:58.488Z"},"bugs":{"url":"https://github.com/OAllanFernando/react-native-aes-encryptor/issues"},"author":{"name":"Allan Fernando"},"license":"MIT","homepage":"https://github.com/OAllanFernando/react-native-aes-encryptor","keywords":["react-native","react-component","ios","android","aes","crypto","mobile","async","sha1","sha256","sha512","pbkdf2","hmac256","hmac512","uuid"],"repository":{"type":"git","url":"git://github.com/OAllanFernando/react-native-aes-encryptor.git"},"description":"Modern AES encryption library for React Native — simple, fast, and secure.","maintainers":[{"name":"cometa.tec.br","email":"allan-sjp@hotmail.com"}],"readme":"# React Native AES encryption/decryption — compatible with modern React Native and Gradle\n\n\nAES encryption/decryption for react-native\n\n## Installation\n```sh\nnpm i @cometa-tec-br/react-native-aes-encryptor\n```\n\n### Installation (iOS)\n\n##### Using CocoaPods (React Native 0.60 and higher)\n\n```sh\ncd ios\npod install\n```\n\n##### Using React Native Link (React Native 0.59 and lower)\n\nRun `react-native link @cometa-tec-br/react-native-aes-encryptor` after which you should be able to use this library on iOS.\n\n### Installation (Android)\n\n##### React Native 0.60 and higher\n\n-   Linking is done automatically\n\n##### Using React Native Link (React Native 0.59 and lower)\n\n-   In `android/settings.gradle`\n\n```gradle\n...\ninclude ':react-native-aes-encryptor'\nproject(':react-native-aes-encryptor').projectDir = new File(rootProject.projectDir, '../node_modules/@cometa-tec-br/react-native-aes-encryptor/android')\n```\n\n-   In `android/app/build.gradle`\n\n```gradle\n...\ndependencies {\n    ...\n    implementation project(':@cometa-tec-br/react-native-aes-encryptor')\n}\n```\n\n-   register module (in MainApplication.java)\n\n```java\n......\nimport com.tectiv3.aes.AesPackage;\n\n......\n\n@Override\nprotected List<ReactPackage> getPackages() {\n   ......\n   new AesPackage(),\n   // or\n   // packages.add(new AesPackage());\n   ......\n}\n```\n\n\n### Example\n\n```js\nimport { NativeModules, Platform } from 'react-native'\nimport Aes from '@cometa-tec-br/react-native-aes-encryptor'\n\nconst generateKey = (password, salt, cost, length) => Aes.pbkdf2(password, salt, cost, length, 'sha256')\n\nconst encryptData = (text, key) => {\n    return Aes.randomKey(16).then(iv => {\n        return Aes.encrypt(text, key, iv, 'aes-256-cbc').then(cipher => ({\n            cipher,\n            iv,\n        }))\n    })\n}\n\nconst decryptData = (encryptedData, key) => Aes.decrypt(encryptedData.cipher, key, encryptedData.iv, 'aes-256-cbc')\n\ntry {\n    generateKey('Arnold', 'salt', 5000, 256).then(key => {\n        console.log('Key:', key)\n        encryptData('These violent delights have violent ends', key)\n            .then(({ cipher, iv }) => {\n                console.log('Encrypted:', cipher)\n\n                decryptData({ cipher, iv }, key)\n                    .then(text => {\n                        console.log('Decrypted:', text)\n                    })\n                    .catch(error => {\n                        console.log(error)\n                    })\n\n                Aes.hmac256(cipher, key).then(hash => {\n                    console.log('HMAC', hash)\n                })\n            })\n            .catch(error => {\n                console.log(error)\n            })\n    })\n} catch (e) {\n    console.error(e)\n}\n```\n\n#### Or\n\n```js\nasync function asyncDecrypt(cipher, key, iv) {\n    try {\n        var text = await decryptData({ cipher, iv }, key)\n        console.log(text)\n        return text\n    } catch (e) {\n        console.error(e)\n    }\n}\n```\n\n### methods\n\n-   `encrypt(text, key, iv, algorithm)`\n-   `decrypt(base64, key, iv, algorithm)`\n-   `pbkdf2(text, salt, cost, length, algorithm)`\n-   `hmac256(cipher, key)`\n-   `hmac512(cipher, key)`\n-   `sha1(text)`\n-   `sha256(text)`\n-   `sha512(text)`\n-   `randomUuid()`\n-   `randomKey(length)`\n","readmeFilename":"README.md"}