{"id":28456175,"url":"https://github.com/bytehide/securelocalstorage","last_synced_at":"2026-01-03T13:13:06.205Z","repository":{"id":65560568,"uuid":"353402030","full_name":"bytehide/SecureLocalStorage","owner":"bytehide","description":"SecureLocalStorage for .NET: A simple and lightweight extension that allows you to safely store data locally.","archived":false,"fork":false,"pushed_at":"2023-11-11T15:11:45.000Z","size":417,"stargazers_count":11,"open_issues_count":2,"forks_count":4,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-06T22:41:32.972Z","etag":null,"topics":["dotnet","dotnet-core","localstorage","security","security-tools","storage"],"latest_commit_sha":null,"homepage":"","language":"C#","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/bytehide.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-31T15:22:23.000Z","updated_at":"2025-05-13T01:06:13.000Z","dependencies_parsed_at":"2024-06-28T01:44:38.447Z","dependency_job_id":null,"html_url":"https://github.com/bytehide/SecureLocalStorage","commit_stats":null,"previous_names":["dotnetsafer/securelocalstorage"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bytehide/SecureLocalStorage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytehide%2FSecureLocalStorage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytehide%2FSecureLocalStorage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytehide%2FSecureLocalStorage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytehide%2FSecureLocalStorage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bytehide","download_url":"https://codeload.github.com/bytehide/SecureLocalStorage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytehide%2FSecureLocalStorage/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259809412,"owners_count":22914853,"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":["dotnet","dotnet-core","localstorage","security","security-tools","storage"],"created_at":"2025-06-06T22:40:27.145Z","updated_at":"2026-01-03T13:13:06.151Z","avatar_url":"https://github.com/bytehide.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Secure Local Storage\n\n![alt text](https://github.com/dotnetsafer/SecureLocalStorage/blob/master/Blobs/SecureLocalSmall.png?raw=true)\n\nSecure Local Storage is a simple package for .NET that allows you to safely store information locally, allowing you to select whether the information will only be decryptable on the computer where it was created, or if it can be shared between several computers.\n\nMainly it offers you the option of storing information or sensitive settings and obtaining it from the same or another application.\n\n## Installation\n\nUse the nuget package manager to install [SecureLocalStorage.](https://www.nuget.org/packages/SecureLocalStorage/)\n\n_Package Manager:_\n```csharp\nInstall-Package SecureLocalStorage -Version 2.0.0\n```\n_.NET CLI:_\n```csharp\ndotnet add package SecureLocalStorage --version 2.0.0\n```\n\n\n**Caveat:**\n\nVersion 1 does not support MacOs and Linux, so please upgrade to version 2 if you are encrypting local data in a cross-platform project.\n\nSince version 2, both Mac and Linux and Windows have the ability to store fully encrypted local files and data on the machine where your software runs.\n\n## Simple Usage\n\n\n### Instantiate the class with the default settings:\n\n```csharp\nvar config = new DefaultLocalStorageConfig();\nvar storage = new SecureLocalStorage.SecureLocalStorage(config);\n```\n### Add data to storage:\n```csharp\nstorage.Set(\"Example\", \"Hello world.\");\n//If key exists content will replaced.\n```\n### Add custom data to storage:\n```csharp\nvar userExample = new UserExample {Name = \"Juan\", Verified = true};\nstorage.Set(\"User\", userExample);\n```\n### Get data from storage:\n```csharp\nstring data = storage.Get(\"Example\"); //Hello world\n```\n### Get custom data from storage:\n```csharp\nvar data = storage.Get\u003cUserExample\u003e(\"User\"); //{Name = \"Juan\", Verified = true}\n```\n### Remove data from storage:\n```csharp\nstorage.Remove(\"User\");\n```\n### Check if data exists on storage\n```csharp\nvar exists = storage.Exists(\"User\");\n```\n\n## Advanced Usage\n\nBy default, the information is encrypted with the values of the machine that runs the application and it is only possible to manipulate the data in the same environment, that is, information stored between devices cannot be stolen.\n\nOptionally you can configure where that information is stored and how it is encrypted.\n\n### Custom configuration\n\nThe information is stored by default in `Environment.SpecialFolder.ApplicationData`.\n\nand its hierarchy is as follows:\n\n`%SpecialFolder% / Your_App_Name / default.`\n\n#### Change default app name:\n\n```csharp\nconfig = new CustomLocalStorageConfig(null, \"DotnetsaferTesting\").WithDefaultKeyBuilder();\n```\nMake sure the name is unique to your application, or it could create conflicts with other applications.\n\n#### Change default path:\n\n```csharp\nconfig = new CustomLocalStorageConfig(@\"current/default\", \"DotnetsaferTesting\").WithDefaultKeyBuilder();\n```\n\n#### Change default encryption key:\n\nIf you don't want the encryption key to be unique values of the device, you can set one yourself.\n```csharp\nconfig = new CustomLocalStorageConfig(@\"current/default\", \"DotnetsaferTesting\", \"secret1234\");\n```\n**If you want to add a dynamic key you can override the `BuildLocalSecureKey` method:**\n\n```csharp\nconfig.BuildLocalSecureKey = () =\u003e Guid.NewGuid().ToString();\n```\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytehide%2Fsecurelocalstorage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbytehide%2Fsecurelocalstorage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytehide%2Fsecurelocalstorage/lists"}