{"id":21601742,"url":"https://github.com/kitlabs-cn/kitcryptbundle","last_synced_at":"2025-04-11T02:20:29.094Z","repository":{"id":57007063,"uuid":"98093023","full_name":"kitlabs-cn/KitCryptBundle","owner":"kitlabs-cn","description":"Encryption and decryption in symfony.(DES,3DES,IDEA,RC2,RC4,RSA,DSA,AES,BLOWFISH)","archived":false,"fork":false,"pushed_at":"2023-08-11T09:16:41.000Z","size":22,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T23:41:25.371Z","etag":null,"topics":["3des","crypto","rsa","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/kitlabs-cn.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":"2017-07-23T11:22:14.000Z","updated_at":"2022-01-05T10:10:49.000Z","dependencies_parsed_at":"2022-08-21T14:31:01.493Z","dependency_job_id":null,"html_url":"https://github.com/kitlabs-cn/KitCryptBundle","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitlabs-cn%2FKitCryptBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitlabs-cn%2FKitCryptBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitlabs-cn%2FKitCryptBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitlabs-cn%2FKitCryptBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kitlabs-cn","download_url":"https://codeload.github.com/kitlabs-cn/KitCryptBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248328361,"owners_count":21085301,"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":["3des","crypto","rsa","symfony","symfony-bundle"],"created_at":"2024-11-24T19:10:31.097Z","updated_at":"2025-04-11T02:20:29.074Z","avatar_url":"https://github.com/kitlabs-cn.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KitCryptBundle\nSymfony Crypt Bundle(use openssl)\n\n\n## Installation\n \n### Step 1: Download the Bundle\n---------------------------\n \nOpen a command console, enter your project directory and execute the\nfollowing command to download the latest stable version of this bundle:\n \n\t\n\t$ composer require kitlabs/kit-crypt-bundle\n\n \nThis command requires you to have Composer installed globally, as explained\nin the [installation chapter](https://getcomposer.org/doc/00-intro.md)\nof the Composer documentation.\n \n### Step 2: Enable the Bundle\n---------------------------\n \nThen, enable the bundle by adding it to the list of registered bundles\nin the `app/AppKernel.php` file of your project:\n``` php\n\u003c?php\n// app/AppKernel.php\n \n// ...\nclass AppKernel extends Kernel\n{\n    public function registerBundles()\n    {\n        $bundles = array(\n            // ...\n \n            new Kit\\CryptBundle\\KitCryptBundle(),\n        );\n \n        // ...\n    }\n \n    // ...\n}\n```\n### Setp 3: config \n``` yaml\n# app/config/config.yml\nkit_crypt:\n    clients:\n        default:\n            method: 'aes-256-cbc'\n            secret_key: 'Kit@Crypt!Bundle'\n            secret_iv: '12345!@#$%^67890' #16 bit\n            option: 0 # 0默认值;OPENSSL_RAW_DATA = 1,采用PKCS7填充;OPENSSL_ZERO_PADDING = 2，采用0填充; OPENSSL_NO_PADDING = 3,不填充\n        data_api:# client name,可以是多个\n            method: 'des-cbc'\n            secret_key: 'Kit@Crypt!Bundle'\n            secret_iv: 'q1w2e3r4'\n            option: 1\n```\n\t\nPS:params  \n\n- **method** list [openssl cipher methods](cipher_methods.md)\r\n- **secret_iv** iv encrypt method AES-256-CBC expects 16 bytes - else you will get a warning\n\t\n\n## Usage\n``` php\n/**\n * \n * @var \\Kit\\CryptBundle\\Service\\OpensslService $opensslService\n */\n$opensslService = $this-\u003eget('kit_crypt.openssl');\n$encrypt = $opensslService-\u003eencrypt('lcp0578', 'data_api'); //public function encrypt($string, $name = 'default', $iv = null)\ndump($encrypt);\ndump($opensslService-\u003edecrypt($encrypt, 'data_api')); //public function decrypt($string, $name = 'default', $iv = null)\nfunction cryptoJsAesDecrypt($passphrase, $ct, $iv, $s)\nfunction cryptoJsAesEncrypt($passphrase, $value)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitlabs-cn%2Fkitcryptbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkitlabs-cn%2Fkitcryptbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitlabs-cn%2Fkitcryptbundle/lists"}