{"id":37010270,"url":"https://github.com/ioleo/cryptomute","last_synced_at":"2026-01-14T00:59:11.919Z","repository":{"id":57015567,"uuid":"51755730","full_name":"ioleo/cryptomute","owner":"ioleo","description":"Encrypt numeric data (binary, decimal, hex) preserving it's format (eg. 16-digits card number to 16-digits encrypted number).","archived":true,"fork":false,"pushed_at":"2016-07-15T06:59:36.000Z","size":24,"stargazers_count":26,"open_issues_count":2,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-26T11:26:02.018Z","etag":null,"topics":["encryption","format-preserving-encryption","php","php-library"],"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/ioleo.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":"2016-02-15T13:01:39.000Z","updated_at":"2025-07-29T15:35:51.000Z","dependencies_parsed_at":"2022-08-22T09:31:42.700Z","dependency_job_id":null,"html_url":"https://github.com/ioleo/cryptomute","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ioleo/cryptomute","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioleo%2Fcryptomute","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioleo%2Fcryptomute/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioleo%2Fcryptomute/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioleo%2Fcryptomute/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ioleo","download_url":"https://codeload.github.com/ioleo/cryptomute/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioleo%2Fcryptomute/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28407629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["encryption","format-preserving-encryption","php","php-library"],"created_at":"2026-01-14T00:59:11.205Z","updated_at":"2026-01-14T00:59:11.879Z","avatar_url":"https://github.com/ioleo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cryptomute\r\n\r\nA small PHP class implementing Format Preserving Encryption via Feistel Network.\r\n\r\n## 1. Installation\r\n\r\nYou can install Cryptomute via [Composer](http://getcomposer.org) (packagist has [loostro/cryptomute](https://packagist.org/packages/loostro/cryptomute) package). In your `composer.json` file use:\r\n\r\n``` json\r\n{\r\n    \"require\": {\r\n        \"loostro/cryptomute\": \"^1.0\"\r\n    }\r\n}\r\n```\r\n\r\nAnd run: `php composer.phar install`. After that you can require the autoloader and use Cryptomute:\r\n\r\n## 2. Usage\r\n\r\n``` php\r\nrequire_once 'vendor/autoload.php';\r\n\r\nuse Cryptomute\\Cryptomute;\r\n\r\n$cryptomute = new Cryptomute(\r\n    'aes-128-cbc',      // cipher\r\n    '0123456789zxcvbn', // base key\r\n    7,                  // number of rounds\r\n);\r\n\r\n$password = '0123456789qwerty';\r\n$iv = '0123456789abcdef';\r\n\r\n$plainValue = '2048';\r\n$encoded = $cryptomute-\u003eencrypt($plainValue, 10, false, $password, $iv);\r\n$decoded = $cryptomute-\u003edecrypt($encoded, 10, false, $password, $iv);\r\n\r\nvar_dump([\r\n  'plainValue' =\u003e $plainValue,\r\n  'encoded'    =\u003e $encoded,\r\n  'decoded'    =\u003e $decoded,\r\n]);\r\n```\r\n\r\n```\r\narray(3) {              \r\n  [\"plainValue\"]=\u003e       \r\n  string(4) \"2048\"       \r\n  [\"encoded\"]=\u003e          \r\n  string(9) \"309034283\"  \r\n  [\"decoded\"]=\u003e          \r\n  string(4) \"2048\"       \r\n}                        \r\n```\r\n\t\r\n## 3. Options\r\n\r\n### 3.1 Cipher\r\n \r\nCipher is the first constructor argument. Supported cipher methods are:\r\n\r\nCipher             | IV\r\n------------------ | ---\r\n`des-cbc`          | yes\r\n`aes-128-cbc`      | yes\r\n`aes-128-ecb`      | no\r\n`aes-192-cbc`      | yes\r\n`aes-192-ecb`      | no\r\n`camellia-128-cbc` | yes\r\n`camellia-128-ecb` | no\r\n`camellia-192-cbc` | yes\r\n`camellia-192-ecb` | no\r\n\r\n### 3.2 Key\r\n\r\nKey is the second constructor argument. Base key from which all round keys are derrived.\r\n\r\n### 3.3 Rounds\r\n\r\nRounds is the third constructor argument. Must be an odd integer greater or equal to 3. More rounds is more secure,\r\nbut also slower. Recommended value is at least 7.\r\n\r\n## 4. Public methods\r\n\r\n### 4.1 setValueRange(`$minValue`, `$maxValue`)\r\n\r\nSets minimum and maximum values. If the result is out of range it will be re-encrypted (or re-decrypted) until ouput\r\nis in range.\r\n\r\n### 4.2 encrypt(`$plainValue`, `$base`, `$pad`, `$password`, `$iv`)\r\n \r\nEncrypts data. Takes following arguments:\r\n\r\n* `$plainValue` (string) input data to be encrypted\r\n* `$base` (int) input data base, accepted values is 2 (binary), 10 (decimal) or 16 (hexadecimal)\r\n* `$pad` (bool) pad left output to match `$maxValue`'s length?\r\n* `$password` (string) encryption password\r\n* `$iv` (string) initialization vector - only if cipher requires it\r\n\r\n\r\n### 4.2 decrypt(`$cryptValue`, `$base`, `$pad`, `$password`, `$iv`)\r\n \r\nDecrypts data. Takes following arguments:\r\n\r\n* `$cryptValue` (string) input data to be decrypted\r\n* `$base` (int) input data base, accepted values is 2 (binary), 10 (decimal) or 16 (hexadecimal)\r\n* `$pad` (bool) pad left output to match `$maxValue`'s length?\r\n* `$password` (string) encryption password\r\n* `$iv` (string) initialization vector - only if cipher requires it\r\n\r\n## License\r\n\r\nCryptomute is licensed under [The MIT License (MIT)](LICENSE).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fioleo%2Fcryptomute","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fioleo%2Fcryptomute","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fioleo%2Fcryptomute/lists"}