{"id":16390185,"url":"https://github.com/slamdunk/php-symmetric-encryption","last_synced_at":"2025-10-25T06:35:04.187Z","repository":{"id":46179217,"uuid":"422524571","full_name":"Slamdunk/php-symmetric-encryption","owner":"Slamdunk","description":"PHP Symmetric Encryption","archived":false,"fork":false,"pushed_at":"2024-10-30T03:10:30.000Z","size":128,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-30T06:14:27.240Z","etag":null,"topics":[],"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/Slamdunk.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["Slamdunk"],"custom":"https://paypal.me/filippotessarotto"}},"created_at":"2021-10-29T09:56:50.000Z","updated_at":"2024-10-30T03:10:33.000Z","dependencies_parsed_at":"2024-11-06T22:18:09.204Z","dependency_job_id":"141b35aa-f185-469b-8e61-feaa26ba7bd0","html_url":"https://github.com/Slamdunk/php-symmetric-encryption","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"a951f62cfc5ba0582da532ed8af0f3dc7ff9bd21"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Slamdunk%2Fphp-symmetric-encryption","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Slamdunk%2Fphp-symmetric-encryption/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Slamdunk%2Fphp-symmetric-encryption/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Slamdunk%2Fphp-symmetric-encryption/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Slamdunk","download_url":"https://codeload.github.com/Slamdunk/php-symmetric-encryption/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229841455,"owners_count":18132562,"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":[],"created_at":"2024-10-11T04:35:11.467Z","updated_at":"2025-10-25T06:34:59.140Z","avatar_url":"https://github.com/Slamdunk.png","language":"PHP","funding_links":["https://github.com/sponsors/Slamdunk","https://paypal.me/filippotessarotto"],"categories":[],"sub_categories":[],"readme":"# Slam / php-symmetric-encryption\n\n[![Latest Stable Version](https://img.shields.io/packagist/v/slam/php-symmetric-encryption.svg)](https://packagist.org/packages/slam/php-symmetric-encryption)\n[![Downloads](https://img.shields.io/packagist/dt/slam/php-symmetric-encryption.svg)](https://packagist.org/packages/slam/php-symmetric-encryption)\n[![Integrate](https://github.com/Slamdunk/php-symmetric-encryption/workflows/CI/badge.svg?branch=master)](https://github.com/Slamdunk/php-symmetric-encryption/actions)\n[![Code Coverage](https://codecov.io/gh/Slamdunk/php-symmetric-encryption/coverage.svg?branch=master)](https://codecov.io/gh/Slamdunk/php-symmetric-encryption?branch=master)\n[![Infection MSI](https://badge.stryker-mutator.io/github.com/Slamdunk/php-symmetric-encryption/master)](https://dashboard.stryker-mutator.io/reports/github.com/Slamdunk/php-symmetric-encryption/master)\n\nV1: encrypt strings with [`sodium_crypto_aead_xchacha20poly1305_ietf_encrypt`](https://www.php.net/manual/en/function.sodium-crypto-aead-xchacha20poly1305-ietf-encrypt.php) function.\n\n## Installation\n\nTo install with composer run the following command:\n\n```console\n$ composer require slam/php-symmetric-encryption\n```\n\n## Usage\n\n```php\nuse SlamSymmetricEncryption\\V1Encryptor;\n\n// Generate a key and save it somewhere\n$key = V1Encryptor::generateKey();\nvar_dump($key); // string(44) \"Hog2u9jtOzyt+mPyAJwp8v3dI6Uvp1T4FUKrAjizVGo=\"\n\n// Use the key\n$encryptor = new V1Encryptor($key);\n\n$ciphertext = $encryptor-\u003eencrypt('foo');\nvar_dump($ciphertext); // string(59) \"dznmjbqHnI_26crKpRYvp125K9N6ctqU0kVCmoSRbG7HAKCIrnAz0RBELQ\"\n\n$plaintext = $encryptor-\u003edecrypt($ciphertext);\nvar_dump($plaintext); // string(3) \"foo\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslamdunk%2Fphp-symmetric-encryption","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslamdunk%2Fphp-symmetric-encryption","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslamdunk%2Fphp-symmetric-encryption/lists"}