{"id":26885232,"url":"https://github.com/meysammoghaddam/protectedbrowserstorage","last_synced_at":"2025-05-08T22:30:31.835Z","repository":{"id":130709744,"uuid":"268102297","full_name":"MeysamMoghaddam/ProtectedBrowserStorage","owner":"MeysamMoghaddam","description":"Provides services for storing data in the browser's localStorage. The stored data is protected using AES encryption and decryption functions.","archived":false,"fork":false,"pushed_at":"2020-06-14T19:42:26.000Z","size":18,"stargazers_count":7,"open_issues_count":3,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-01T01:05:24.683Z","etag":null,"topics":["aes-encryption","asp-net-core","blazor","blazor-client","blazor-webassembly","blazorwasm","browser-localstorage","decryption-functions","localstorage","netstandard","protected","sessionstorage"],"latest_commit_sha":null,"homepage":null,"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/MeysamMoghaddam.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":"2020-05-30T15:02:55.000Z","updated_at":"2023-11-01T14:47:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"1a3d8f47-01aa-4183-ae96-4b88ffa446cb","html_url":"https://github.com/MeysamMoghaddam/ProtectedBrowserStorage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeysamMoghaddam%2FProtectedBrowserStorage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeysamMoghaddam%2FProtectedBrowserStorage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeysamMoghaddam%2FProtectedBrowserStorage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeysamMoghaddam%2FProtectedBrowserStorage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MeysamMoghaddam","download_url":"https://codeload.github.com/MeysamMoghaddam/ProtectedBrowserStorage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253157509,"owners_count":21863129,"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":["aes-encryption","asp-net-core","blazor","blazor-client","blazor-webassembly","blazorwasm","browser-localstorage","decryption-functions","localstorage","netstandard","protected","sessionstorage"],"created_at":"2025-03-31T18:52:22.209Z","updated_at":"2025-05-08T22:30:31.774Z","avatar_url":"https://github.com/MeysamMoghaddam.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ProtectedBrowserStorage\nProvides services for storing data in the browser's localStorage. The stored data is protected using AES encryption and decryption functions.\nI'm use this in my Blazor WebAssembly client-side project.\n\n# Install\n```\nInstall-Package ProtectedBrowserStorage.NETStandard -Version x.x\n```  \nx.x is version of package for use last version see https://www.nuget.org/packages/ProtectedBrowserStorage.NETStandard\n\n# How to use\nAdd this line to Startup.cs. Register into DI container\n\n\n```\nservices.AddProtectedLocalStore(new EncryptionService(\n                new KeyInfo(\"45BLO2yoJkvBwz99kBEMlNkxvL40vUSGaqr/WBu3+Vg=\", \"Ou3fn+I9SVicGWMLkFEgZQ==\")));\n```        \n\n## For Use Blazor WebAssembly client-side Register into Program.cs\n\n```\nbuilder.Services.AddProtectedLocalStore(new EncryptionService(\n                new KeyInfo(\"45BLO2yoJkvBwz99kBEMlNkxvL40vUSGaqr/WBu3+Vg=\", \"Ou3fn+I9SVicGWMLkFEgZQ==\")));\n```   \n\nIn _Imports.razor add this\n\n```\n@using ProtectedLocalStore\n@inject ProtectedLocalStore _protectedLocalStore\n``` \n\nNow we can use it in our Component.\n\n### Use browser session storage\n\nset Synchronous protected data\n```\n_protectedLocalStore.SetSession(\"key\", data);\n``` \n\nset Asynchronous protected data\n```\n_protectedLocalStore.SetSessionAsync(\"key\", data);\n``` \n\nget Synchronous data\n```\n_protectedLocalStore.GetSession\u003cT\u003e(\"key\");\n``` \n\nget Asynchronous data\n```\n_protectedLocalStore.GetSessionAsync\u003cT\u003e(\"key\");\n``` \n\n### Use browser local storage\n\nset Synchronous protected data\n```\n_protectedLocalStore.SetLocal(\"key\", data);\n``` \n\nset Asynchronous protected data\n```\n_protectedLocalStore.SetLocalAsync(\"key\", data);\n``` \n\nget Synchronous data\n```\n_protectedLocalStore.GetLocal\u003cT\u003e(\"key\");\n``` \n\nget Asynchronous data\n```\n_protectedLocalStore.GetLocalAsync\u003cT\u003e(\"key\");\n``` \n\n*** I'm glad to see your comments ***\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeysammoghaddam%2Fprotectedbrowserstorage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeysammoghaddam%2Fprotectedbrowserstorage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeysammoghaddam%2Fprotectedbrowserstorage/lists"}