{"id":22394005,"url":"https://github.com/alextartan/flysystem-libsodium-adapter","last_synced_at":"2025-10-28T11:42:46.655Z","repository":{"id":37382245,"uuid":"198319136","full_name":"alextartan/flysystem-libsodium-adapter","owner":"alextartan","description":"Libsodium adapter for Flysytem","archived":false,"fork":false,"pushed_at":"2022-10-17T03:39:49.000Z","size":410,"stargazers_count":3,"open_issues_count":12,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-06T01:54:30.726Z","etag":null,"topics":["flysystem","flysystem-adapter","libsodium-php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alextartan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-23T00:03:12.000Z","updated_at":"2022-08-29T12:16:53.000Z","dependencies_parsed_at":"2022-09-14T21:21:27.246Z","dependency_job_id":null,"html_url":"https://github.com/alextartan/flysystem-libsodium-adapter","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/alextartan/flysystem-libsodium-adapter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextartan%2Fflysystem-libsodium-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextartan%2Fflysystem-libsodium-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextartan%2Fflysystem-libsodium-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextartan%2Fflysystem-libsodium-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alextartan","download_url":"https://codeload.github.com/alextartan/flysystem-libsodium-adapter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextartan%2Fflysystem-libsodium-adapter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278239968,"owners_count":25954097,"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-03T02:00:06.070Z","response_time":53,"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":["flysystem","flysystem-adapter","libsodium-php"],"created_at":"2024-12-05T05:08:35.612Z","updated_at":"2025-10-03T22:50:12.463Z","avatar_url":"https://github.com/alextartan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Libsodium Adapter for Flysystem\n\nPerforming on-the-fly client-side encryption for safe storage of files.\n\nOn uploads, the content is encrypted using [Poly 1305](https://en.wikipedia.org/wiki/Poly1305) with a secret key and stored securely on the filesystem.\n\nOn downloads, the content is decrypted. \n\nCurrent build status\n===\n\n![CI](https://github.com/alextartan/flysystem-libsodium-adapter/workflows/CI/badge.svg?branch=master)\n[![codecov](https://codecov.io/gh/alextartan/flysystem-libsodium-adapter/branch/master/graph/badge.svg)](https://codecov.io/gh/alextartan/flysystem-libsodium-adapter)\n[![Infection MSI](https://badge.stryker-mutator.io/github.com/alextartan/flysystem-libsodium-adapter/master)](https://infection.github.io)\n[![Dependabot Status](https://api.dependabot.com/badges/status?host=github\u0026repo=alextartan/flysystem-libsodium-adapter)](https://dependabot.com)\n[![Downloads](https://img.shields.io/badge/dynamic/json.svg?url=https://repo.packagist.org/packages/alextartan/flysystem-libsodium-adapter.json\u0026label=Downloads\u0026query=$.package.downloads.total\u0026colorB=orange)](https://packagist.org/packages/alextartan/flysystem-libsodium-adapter)\n\n## Installation\n\n```bash\ncomposer require alextartan/flysystem-libsodium-adapter\n```\n\n## Usage\n\n```php\nuse AlexTartan\\Flysystem\\Adapter\\ChunkEncryption\\Libsodium;use AlexTartan\\Flysystem\\Adapter\\EncryptionAdapterDecorator;\nuse League\\Flysystem\\Filesystem;\nuse League\\Flysystem\\Memory\\MemoryAdapter;\n\n$adapter = new MemoryAdapter();\n$encryption = Libsodium::factory($encryptionKey, 4096);\n\n$adapterDecorator = new EncryptionAdapterDecorator(\n    $adapter, \n    $encryption\n);\n\n$filesystem = new Filesystem($adapterDecorator);\n```\n\n**Notice**;\n\nDue to how AwsS3 (and probably other remote adapters) handle stream uploads, \nI had to change the way this lib worked (versions up to `v.1.0.0`)\n\nNew releases employ a `php://temp` stream in which the encryption is done \nand once that finishes, the stream is sent to `writeStream`/`readStream`\n\nPerformance wise, it handles ok from what i could see.\n\n## Versioning\n\nThis library adheres to [semver](https://semver.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextartan%2Fflysystem-libsodium-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falextartan%2Fflysystem-libsodium-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextartan%2Fflysystem-libsodium-adapter/lists"}