{"id":19858111,"url":"https://github.com/tzsk/laravel-crypton","last_synced_at":"2025-10-07T04:47:02.379Z","repository":{"id":37032068,"uuid":"166970943","full_name":"tzsk/laravel-crypton","owner":"tzsk","description":"Axios Helper Laravel Encrypted API Request Response with Vue Plugin","archived":false,"fork":false,"pushed_at":"2025-09-25T15:12:37.000Z","size":606,"stargazers_count":20,"open_issues_count":26,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-25T17:24:14.556Z","etag":null,"topics":["crypton-adapter","javascript-library","npm-package","request-encryption","response-encryption","vue-plugin"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tzsk.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":"contributing.md","funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-01-22T10:02:09.000Z","updated_at":"2025-06-30T21:01:15.000Z","dependencies_parsed_at":"2023-02-05T01:46:09.873Z","dependency_job_id":"45f54bdd-1566-4251-9bc8-594ef1dd2012","html_url":"https://github.com/tzsk/laravel-crypton","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tzsk/laravel-crypton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzsk%2Flaravel-crypton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzsk%2Flaravel-crypton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzsk%2Flaravel-crypton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzsk%2Flaravel-crypton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tzsk","download_url":"https://codeload.github.com/tzsk/laravel-crypton/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tzsk%2Flaravel-crypton/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278722727,"owners_count":26034461,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["crypton-adapter","javascript-library","npm-package","request-encryption","response-encryption","vue-plugin"],"created_at":"2024-11-12T14:21:28.281Z","updated_at":"2025-10-07T04:47:02.364Z","avatar_url":"https://github.com/tzsk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Crypton\n\nIt is a js helper for the `tzsk/crypton`. This encrypts the request JSON payload and also Decrypts the Laravel encrypted string to normal javascript object.\n\nThis is built, so you don't have to worry about the encryption and decryption while sending data and matching the same encryption procedure as Laravel has, and you just focus on your own logic.\n\n**Recommendation:** It is best to use it in the production because the encrypted request response will be hard to debug.\n\n**NOTE: IT DOES NOT SUPPORT FILE UPLOAD/STREAM REQUEST OR DOWNLOAD/STREAM RESPONSE**\n\n\n## Installation\n\nIf you are using any javascript framework the you should use the `npm` package.\n\n```bash\n$ npm install --save laravel-crypton\n```\n\nOr if you are not using any javascript framework then use the following link in your script `src`:\n\n```html\n\u003cscript src=\"https://unpkg.com/laravel-crypton@latest/dist/crypton.min.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\nIf you are using any javascript framework then import it.\n\n```js\nimport axios from 'axios';\nimport { Crypton } from 'laravel-crypton';\n```\n\nOtherwise just use it as explained below\n\n```js\nvar key = 'Encryption Key in the Laravel End'; // env('CRYPTON_KEY')\n\n// Now create 2 different axios instance.\nvar Http = axios.create(...);\n\nvar Https = axios.create(...);\nCrypton(key).encrypt(Https);\n\n// Encrypt request.\nCrypton(key).request().encrypt(axiosInstance);\n\n// Encrypt response.\nCrypton(key).response().encrypt(axiosInstance);\n\n// Encrypt both.\nCrypton(key).both().encrypt(axiosInstance);\n// Alias -\u003e You don't need to specify the both method.\nCrypton(key).encrypt(axiosInstance);\n\n// Encrypted XHR call.\nHttps.post('http://example.com/api/something', {movie: 'Avengers: Endgame'}).then((response) =\u003e {\n    console.log(response.data);\n});\n\n// Plain XHR call.\nHttp.post('http://example.com/api/something', {movie: 'Avengers: Endgame'}).then((response) =\u003e {\n    console.log(response.data);\n});\n```\n\nIf the `crypton` middleware is applied in the above route then you can see the request or response being encrypted and decrypted in the `Developer Tools -\u003e Network` tab. But if you look at the console you will see that the `response.data` is just a plain javascript object.\n\n## Standalone\n\nYou can also use the encrypter only to encrypt or decrypt. After importing the script tag.\n\n```js\nlet crypt = new Encrypter(key); // Key is the crypton key 'base64:...'\n\n// Then you have the basic methods\ncrypt.encrypt(param); // Param: any\n\ncrypt.decrypt(param); // Param: string\n```\n\n## Vue JS Plugin\n\nIf you are using Vue JS. Then there is already a Plugin Provided with this pakage. Follow the code below to know how to use it.\n\n```js\nimport { VueCrypton } from 'laravel-crypton';\n\nconst key = 'Encryption Key in the Laravel End'; // env('CRYPTON_KEY')\nVue.use(VueCrypton(key), {\n    // Any Axios Options\n});\n```\n\nNow inside the vue components you can call.\n\n```js\n// Encrypted XHR call.\nthis.$https.post('http://example.com/api/something', {movie: 'Avengers: Endgame'}).then((response) =\u003e {\n    console.log(response.data);\n});\n\n// Plain XHR call.\nthis.$http.post('http://example.com/api/something', {movie: 'Avengers: Endgame'}).then((response) =\u003e {\n    console.log(response.data);\n});\n```\n\n## Change log\n\nPlease see [CHANGELOG](changelog.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](contributing.md) for details.\n\n## Security\n\nIf you discover any security related issues, please email mailtokmahmed@gmail.com instead of using the issue tracker.\n\n## Credits\n\n- [Kazi Mainuddin Ahmed][link-author]\n- [All Contributors][link-contributors]\n\n## License\n\nThe MIT License (MIT). Please see [License File](license.md) for more information.\n\n[link-author]: https://github.com/tzsk\n[link-contributors]: ../../contributors","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftzsk%2Flaravel-crypton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftzsk%2Flaravel-crypton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftzsk%2Flaravel-crypton/lists"}