{"id":18656250,"url":"https://github.com/bayfrontmedia/encryptor","last_synced_at":"2026-02-10T06:33:25.390Z","repository":{"id":54182062,"uuid":"291084083","full_name":"bayfrontmedia/encryptor","owner":"bayfrontmedia","description":"A fast, simple two-way encryption library utilizing OpenSSL.","archived":false,"fork":false,"pushed_at":"2024-12-23T21:29:36.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T12:44:17.834Z","etag":null,"topics":["decrypt","decryption","encrypt","encryption","encryptor","openssl","php"],"latest_commit_sha":null,"homepage":"","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/bayfrontmedia.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-08-28T15:41:16.000Z","updated_at":"2024-12-23T21:28:51.000Z","dependencies_parsed_at":"2025-05-12T14:15:50.098Z","dependency_job_id":"d25c96eb-e65c-4be9-a4f4-a289bb3aed86","html_url":"https://github.com/bayfrontmedia/encryptor","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/bayfrontmedia/encryptor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bayfrontmedia%2Fencryptor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bayfrontmedia%2Fencryptor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bayfrontmedia%2Fencryptor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bayfrontmedia%2Fencryptor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bayfrontmedia","download_url":"https://codeload.github.com/bayfrontmedia/encryptor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bayfrontmedia%2Fencryptor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29292097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T03:42:42.660Z","status":"ssl_error","status_checked_at":"2026-02-10T03:42:41.897Z","response_time":65,"last_error":"SSL_read: 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":["decrypt","decryption","encrypt","encryption","encryptor","openssl","php"],"created_at":"2024-11-07T07:22:32.072Z","updated_at":"2026-02-10T06:33:25.375Z","avatar_url":"https://github.com/bayfrontmedia.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Encryptor\n\nA fast, simple two-way encryption library utilizing OpenSSL.\n\n- [License](#license)\n- [Author](#author)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n\n## License\n\nThis project is open source and available under the [MIT License](LICENSE).\n\n## Author\n\n\u003cimg src=\"https://cdn1.onbayfront.com/bfm/brand/bfm-logo.svg\" alt=\"Bayfront Media\" width=\"250\" /\u003e\n\n- [Bayfront Media homepage](https://www.bayfrontmedia.com?utm_source=github\u0026amp;utm_medium=direct)\n- [Bayfront Media GitHub](https://github.com/bayfrontmedia)\n\n## Requirements\n\n* PHP `^8.0` (Tested up to `8.4`)\n* OpenSSL PHP extension\n* JSON PHP extension\n\n## Installation\n\n```\ncomposer require bayfrontmedia/encryptor\n```\n\n## Usage\n\n### Start using Encryptor\n\nA private, reproducible key must be passed to the constructor. \nThe same key must be used when encrypting and decrypting.\nIf the key used to encrypt a value is lost, it will not be able to be decrypted.\n\nAn optional second constructor parameter allows you to specify which [cipher method](https://www.php.net/manual/en/function.openssl-get-cipher-methods.php) to use.\nBy default, Encryptor uses `AES-256-CBC`.\n\nIf an invalid cipher method is used, a `Bayfront\\Encryptor\\InvalidCipherException` exception will be thrown.\n\n```\nuse Bayfront\\Encryptor\\Encryptor;\n\n$encryptor = new Encryptor('private_key');\n```\n\n### Public methods\n\n- [getKey](#getkey)\n- [getCipher](#getcipher)\n- [encrypt](#encrypt)\n- [encryptString](#encryptstring)\n- [decrypt](#decrypt)\n- [decryptString](#decryptstring)\n\n\u003chr /\u003e\n\n### getKey\n\n**Description:**\n\nReturns the encryption key.\n\n**Parameters:**\n\n- None\n\n**Returns:**\n\n- (string)\n\n\u003chr /\u003e\n\n### getCipher\n\n**Description:**\n\nReturns the cipher method used for encryption.\n\n**Parameters:**\n\n- None\n\n**Returns:**\n\n- (string)\n\n\u003chr /\u003e\n\n### encrypt\n\n**Description:**\n\nEncrypts a given value. \n\n**Parameters:**\n\n- `$value` (mixed)\n- `$serialize = true` (bool)\n\n**Returns:**\n\n- (string)\n\n**Throws:**\n\n- `Bayfront\\Encryptor\\EncryptException`\n\n**Example:**\n\n```\ntry {\n\n    $encrypted = $encryptor-\u003eencrypt([\n        'name' =\u003e 'John',\n        'user_id' =\u003e 8\n    ]);\n\n} catch (EncryptException $e) {\n    die($e-\u003egetMessage());\n}\n```\n\n\u003chr /\u003e\n\n### encryptString\n\n**Description:**\n\nEncrypts a string without serialization. \n\n**Parameters:**\n\n- `$value` (string)\n\n**Returns:**\n\n- (string)\n\n**Throws:**\n\n- `Bayfront\\Encryptor\\EncryptException`\n\n**Example:**\n\n```\ntry {\n\n    $encrypted_string = $encryptor-\u003eencryptString('A string to encrypt');\n\n} catch (EncryptException $e) {\n    die($e-\u003egetMessage());\n}\n```\n\n\u003chr /\u003e\n\n### decrypt\n\n**Description:**\n\nDecrypts a given value. \n\n**Parameters:**\n\n- `$data` (string)\n- `$unserialize = true` (bool)\n\n**Returns:**\n\n- (mixed)\n\n**Throws:**\n\n- `Bayfront\\Encryptor\\DecryptException`\n\n**Example:**\n\n```\ntry {\n\n    $decrypted = $encryptor-\u003edecrypt($encrypted);\n\n} catch (DecryptException $e) {\n    die($e-\u003egetMessage());\n}\n```\n\n\u003chr /\u003e\n\n### decryptString\n\n**Description:**\n\nDecrypts a string without unserialization. \n\n**Parameters:**\n\n- `$data` (string)\n\n**Returns:**\n\n- (string)\n\n**Throws:**\n\n- `Bayfront\\Encryptor\\DecryptException`\n\n**Example:**\n\n```\ntry {\n\n    $decrypted_string = $encryptor-\u003edecryptString($encrypted_string);\n\n} catch (DecryptException $e) {\n    die($e-\u003egetMessage());\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbayfrontmedia%2Fencryptor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbayfrontmedia%2Fencryptor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbayfrontmedia%2Fencryptor/lists"}