secure-storage-wasm v0.1.10
Secure Storage π
π Overview
Secure Storage π is a WebAssembly (WASM) module written in Rust that provides secure, high-performance encryption and decryption capabilities using the ChaCha20-Poly1305 AEAD (Authenticated Encryption with Associated Data) algorithm. This project is ideal for securely storing and transmitting sensitive data in web applications.
β¨ Features
- β End-to-end Encryption - Uses the ChaCha20-Poly1305 cipher for secure data encryption.
- β WASM Powered - High-performance cryptographic operations in the browser.
- β Lightweight & Fast - Rustβs efficiency ensures minimal overhead.
- β Authenticated Encryption - Ensures data integrity and authenticity.
Configuration
To include wasm into your application, Based on the bundler
Vite
// To configure vite with wasm
import wasm from "vite-plugin-wasm";
// https://vite.dev/config/
export default defineConfig({
plugins: [react(), wasm()],
})
π οΈ Usage
import { getItem, setItem, clear } from "secure-storage";
// To store data with encryption
setItem("key", "data")
// To store raw data (without encryption)
setItem("key", "data", true)
getItem("key") // -> string
π API Reference
set_item(key: string, data: string, encrypted?: boolean | null) => void
@default: encrypted = true Generates and sets the encrypted/raw data in the localstorage based on encrypted boolean
get_item(key: string) => string
Gets the decrypted data in the localstorage
remove(key: string) => void
Removes the key from localstorage
clear() => void
Clears the localstorage
βοΈ Compatible web engine
Here is the list of tested web engine, 1. Chromium 2. Safari 3. Gecko
βοΈ Supported frameworks
- Vite
- Nextjs
- Vuejs
- create-react-route
And few more testing in progress.
π€ Contributing
We welcome contributions! Feel free to submit issues, feature requests, or pull requests.
- Fork the repo
- Create a new branch:
git checkout -b feature-branch
- Commit changes:
git commit -m "Add a new feature"
- Push to the branch:
git push origin feature-branch
- Create a Pull Request
π License
This project is licensed under the MIT License.
π Acknowledgments
Special thanks to the Rust and WebAssembly communities for their amazing tools and documentation!
π Secure your data with Secure Storage π today!