#security #encryption

bin+lib ruswacipher

A Rust tool for encrypting and protecting WebAssembly modules

1 unstable release

new 0.1.0 Mar 23, 2025

#182 in WebAssembly

MIT license

195KB
4K SLoC

Rust 3.5K SLoC // 0.1% comments TypeScript 438 SLoC // 0.3% comments JavaScript 176 SLoC // 0.0% comments

๐Ÿ” RusWaCipher - Rust WebAssembly Encryption Tool

โš ๏ธ IMPORTANT NOTICE: RusWaCipher is currently in early development stage. The API and functionality are subject to change.

CI License: MIT Rust Version

A Rust-based tool for encrypting and protecting WebAssembly (WASM) modules, preventing code from being easily analyzed or reverse-engineered.

๐ŸŽฏ Project Goals

  • ๐Ÿ”’ Provide encryption functionality for WASM modules
  • ๐ŸŒ Implement browser-side decryption runtime
  • ๐Ÿ›ก๏ธ Protect WebAssembly code intellectual property
  • ๐Ÿ”‘ Support multiple encryption algorithms

๐Ÿงฉ Core Components

  • ๐Ÿ“Š WASM Analyzer: Parse and modify WASM binary structures
  • ๐Ÿ” Encryption Engine: Support for AES-GCM and ChaCha20-Poly1305
  • ๐Ÿ”„ Decryption Runtime: Browser-side JavaScript decryption library
  • ๐Ÿ’ป CLI Tools: Command-line interface for encryption operations
  • ๐Ÿงฐ Plugin System: Support for custom encryption algorithms

๐Ÿ› ๏ธ Technology Stack

  • ๐Ÿฆ€ Language: Rust 2021 Edition
  • ๐Ÿ“ฆ WASM Parsing: wasmparser
  • ๐Ÿ”’ Encryption: aes-gcm, chacha20poly1305
  • โŒจ๏ธ CLI: clap

๐Ÿ“Š Project Status

RusWaCipher is an early-stage project with many features under active development:

  • ๐ŸŸข Core Encryption: Basic encryption/decryption functionality
  • ๐ŸŸก WASM Processing: Binary parsing and modification
  • ๐ŸŸก Code Obfuscation: Control flow obfuscation, dead code insertion
  • ๐ŸŸก JavaScript Runtime: Browser-side decryption
  • ๐ŸŸก Plugin System: Custom algorithm integration

๐Ÿ“ Basic Usage

๐Ÿ“ฅ Installation

cargo install --path .

๐Ÿ”’ Encrypting WASM Modules

ruswacipher encrypt -i input.wasm -o encrypted.wasm -a aes-gcm -b

๐Ÿ”“ Decrypting WASM Modules

ruswacipher decrypt -i encrypted.wasm -o decrypted.wasm -k key_file.key

๐ŸŒ Generating JavaScript Runtime

ruswacipher generate-web -o web_dir -a aes-gcm

๐Ÿ” Security Considerations

  • โš ๏ธ Browser-side decryption requires the key to be available in JavaScript
  • ๐Ÿ›ก๏ธ For production, consider server-side key management
  • ๐Ÿ”’ Use this tool as one layer in a defense-in-depth strategy

๐Ÿ“š Documentation

Plugin development documentation and advanced features will be available soon.

๐Ÿ”„ Continuous Integration

This project uses GitHub Actions for continuous integration and delivery:

  • ๐Ÿงช CI Workflow: Automatically runs tests, linting, and builds for every push and pull request
  • ๐Ÿ›ก๏ธ Security Audit: Regularly scans dependencies for security vulnerabilities
  • ๐Ÿ“ฆ Release Workflow: Automates the creation of cross-platform releases when a new version is tagged

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Dependencies

~7โ€“13MB
~163K SLoC