{"id":15388861,"url":"https://github.com/vjai/simple-crypto","last_synced_at":"2025-04-15T20:22:46.854Z","repository":{"id":29332163,"uuid":"32865865","full_name":"VJAI/simple-crypto","owner":"VJAI","description":"Cordova plugin to encrypt/decrypt data","archived":false,"fork":false,"pushed_at":"2019-05-27T10:26:43.000Z","size":40,"stargazers_count":9,"open_issues_count":3,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T01:01:43.476Z","etag":null,"topics":["cordova-plugin"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VJAI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-25T13:21:49.000Z","updated_at":"2023-07-13T22:20:31.000Z","dependencies_parsed_at":"2022-09-06T17:52:15.355Z","dependency_job_id":null,"html_url":"https://github.com/VJAI/simple-crypto","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VJAI%2Fsimple-crypto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VJAI%2Fsimple-crypto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VJAI%2Fsimple-crypto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VJAI%2Fsimple-crypto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VJAI","download_url":"https://codeload.github.com/VJAI/simple-crypto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249145961,"owners_count":21220066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cordova-plugin"],"created_at":"2024-10-01T14:58:28.087Z","updated_at":"2025-04-15T20:22:46.826Z","avatar_url":"https://github.com/VJAI.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimpleCrypto\n\nA PhoneGap plugin to encrypt strings using RNCryptor/JNCryptor (iOS/Android)\n\n## Usage\n\nThe plugin exposes two methods:\n\n```javascript\nvar rncryptor = cordova.require(\"com.disusered.simplecrypto.SimpleCrypto\");\n\nrncryptor.encrypt(key, data, successCallback, failureCallback)\nrncryptor.decrypt(key, data, successCallback, failureCallback)\n```\n\nThe parameters:\n\n* key: A string to use as your key.\n* data: A string representing data to encrypt or decrypt.\n* successHandler: Should be a function. Is called when the crypto operation is completed and is shown to the user.\n* failureHandler: Should be a function. Is called when there was a problem with the crypto operation.\n\n## Example usage\nUseless cyclical example.\n\n```javascript\nvar rncryptor = cordova.require(\"com.disusered.simplecrypto.SimpleCrypto\");\n\nvar key = 'myKey';\n\nfunction failureCallback(error) {\n    console.log('Error: ' + error);\n}\n\nfunction successCallback(encryptedData) {\n    console.log('Encrypted data: ' + encryptedData);\n    rncryptor.decrypt(key, encryptedData,\n        function successCallback(decryptedData) {\n            console.log('Decrypted data: ' + decryptedData);\n        }, failureCallback);\n}\n\nrncryptor.encrypt(key, 'My data to encode', successCallback, failureCallback);\n```\n\n### Usage with promises\nUseless cyclical example.\n\n```javascript\nvar rncryptor = cordova.require(\"com.disusered.simplecrypto.SimpleCrypto\");\n\nvar key = 'myKey';\n\nfunction failureCallback(error) {\n    console.log('Error: ' + error);\n}\n\nfunction successCallback(encryptedData) {\n    console.log('Encrypted data: ' + encryptedData);\n    rncryptor.decrypt(key, encryptedData,\n        function successCallback(decryptedData) {\n            console.log('Decrypted data: ' + decryptedData);\n        }, failureCallback);\n}\n\nrncryptor.encrypt(key, 'My data to encode')\n  .then(successCallback)\n  .catch(failureCallback);\n```\n\n\n\n## RNCryptor\n\n### iOS\n\nThis plugin uses the Objective-C implementation of [RNCryptor](https://github.com/RNCryptor/RNCryptor). RNCryptor is a CCCryptor (AES encryption) wrapper for iOS and Mac. The data format includes all the metadata required to securely implement AES encryption. It is returned as a base64 string ~~using [NSData+Base64](https://github.com/l4u/NSData-Base64)~~. The encrypted blob includes:\n\n* AES-256 encryption\n* CBC mode\n* Password stretching with PBKDF2\n* Password salting\n* Random IV\n* Encrypt-then-hash HMAC\n\n### Android\n\nThis plugin uses the Java implementation of RNCryptor, [JNCryptor](https://github.com/RNCryptor/JNCryptor). JNCryptor is an easy-to-use library for encrypting data with AES. It was ported to Java from the RNCryptor library for iOS.\n\n## Todo\n- ~~User defined key~~\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvjai%2Fsimple-crypto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvjai%2Fsimple-crypto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvjai%2Fsimple-crypto/lists"}