https://github.com/icyjoseph/wasm-aes-soft
Thin wrapper around aes-soft to use as WASM.
https://github.com/icyjoseph/wasm-aes-soft
aes128 wasm wasm-aes wasm-bindgen wasm-descrypt wasm-encrypt wasm-pack
Last synced: 3 months ago
JSON representation
Thin wrapper around aes-soft to use as WASM.
- Host: GitHub
- URL: https://github.com/icyjoseph/wasm-aes-soft
- Owner: icyJoseph
- License: apache-2.0
- Created: 2020-05-27T11:15:21.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-27T13:11:10.000Z (over 5 years ago)
- Last Synced: 2025-03-15T03:44:41.115Z (7 months ago)
- Topics: aes128, wasm, wasm-aes, wasm-bindgen, wasm-descrypt, wasm-encrypt, wasm-pack
- Language: Rust
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE_APACHE
Awesome Lists containing this project
README
# Wasm AES128
Thin wrapper around [aes-soft](https://docs.rs/crate/aes-soft/0.3.3). Implements encrypt and decrypt functions.
Blocks to encode must have length of 16 bytes.
## Build
To build, use `wasm-pack build`.
## Using with Deno
After running `wasm-pack build`, a `pkg/` directory is created on your project root.
Inside this directory there's a javascript file `wasm_aes_soft_bg.js` which starts with:
```javascript
import * as wasm from "./wasm_aes_soft_bg.wasm";
```Replace that line with these lines:
```javascript
const binary = await Deno.readFile("./wasm_aes_soft_bg.wasm");
const wasmModule = new WebAssembly.Module(binary);
const instance = await WebAssembly.instantiate(wasmModule);
const wasm = instance.exports;
```Copy that file together with the `wasm_aes_soft_bg.wasm` binary to the project where you want to use AES128, and you are good to go!
## Credit
This is a thin wrapper around the create [aes-soft](https://docs.rs/crate/aes-soft/0.3.3). All credit goes to their creators.