{"id":13414230,"url":"https://github.com/mongoose-os-libs/vfs-dev-encr","last_synced_at":"2025-03-14T21:32:17.671Z","repository":{"id":85692325,"uuid":"140205343","full_name":"mongoose-os-libs/vfs-dev-encr","owner":"mongoose-os-libs","description":"VFS device that encrypts reads and writes","archived":false,"fork":false,"pushed_at":"2021-12-15T00:19:00.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-07-31T21:52:04.881Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mongoose-os-libs.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}},"created_at":"2018-07-08T21:54:38.000Z","updated_at":"2021-05-29T02:21:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"9678cdeb-5063-4907-8ae5-c01dbb2c52a5","html_url":"https://github.com/mongoose-os-libs/vfs-dev-encr","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongoose-os-libs%2Fvfs-dev-encr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongoose-os-libs%2Fvfs-dev-encr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongoose-os-libs%2Fvfs-dev-encr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongoose-os-libs%2Fvfs-dev-encr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mongoose-os-libs","download_url":"https://codeload.github.com/mongoose-os-libs/vfs-dev-encr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221508976,"owners_count":16834807,"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-07-30T21:00:16.898Z","updated_at":"2024-10-26T07:30:43.166Z","avatar_url":"https://github.com/mongoose-os-libs.png","language":"C","funding_links":[],"categories":["Awesome Mongoose OS [![Awesome](https://awesome.re/badge.svg)](https://awesome.re)"],"sub_categories":["Official Libraries"],"readme":"# A VFS device that encrypts reads and writes\n\n## Overview\n\n * AES-128/192/256 are supported (`algo: AES-nnn` parameter, default is `AES-128`).\n * Reads and writes are encrypted, erases are passed through as is.\n * Encryption is performed in ECB mode, key is XORed with offset.\n * Reads and writes must be aligned to 16-byte boundaries.\n * Writes will be padded to 16 byte block size, so partial writes will only work for last plain-text block.\n\n _Hint:_ If you want an encrypted filesystem, [LFS](https://github.com/mongoose-os-libs/vfs-fs-lfs) will work just fine with this method while [SPIFFS](https://github.com/mongoose-os-libs/vfs-fs-spiffs) will not.\n\n## Key source\n\nKey can be supplied directly (as the `key` option) but a better approach is to use a _key device_ to obtain the key when required.\n\nKey device can be any other VFS device that supports reads. It can be an existing device (`key_dev: name`) or created in-situ (`key_dev_type` + `key_dev_opts`).\n\n_Hint:_ To read key from RAM, use the `vfs-dev-ram`.\n\n_Hint 2:_ Want to generate your own key? Create your own VFS device. Don't worry about methods other than `read`.\n\n## Example\n\nOptions for encrypting `extf0` with AES-256 with key from STM32 OTP area (536836096 = 0x1fff7800).\n\n```json\n {\"dev\": \"extf0\", \"algo\": \"AES-256\", \"key_dev_type\": \"RAM\", \"key_dev_opts\": {\"addr\": 536836096, \"size\": 32}}\n\n```\n\nDon't forget to add `vfs-dev-ram` to libs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmongoose-os-libs%2Fvfs-dev-encr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmongoose-os-libs%2Fvfs-dev-encr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmongoose-os-libs%2Fvfs-dev-encr/lists"}