Skip to content

Commit

Permalink
Add pure js aes implementation (#794)
Browse files Browse the repository at this point in the history
  • Loading branch information
kigawas authored Oct 14, 2024
1 parent 4e11b37 commit a73eeeb
Show file tree
Hide file tree
Showing 13 changed files with 238 additions and 1,066 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4

Expand All @@ -22,3 +25,4 @@ jobs:
- run: pnpm run build && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ If you want a WASM version to run directly in modern browsers or on some blockch

Parameters:

- **receiverRawPK** - Receiver's public key, hex string or buffer
- **receiverRawPK** - Receiver's public key, hex string or Uint8Array
- **msg** - Data to encrypt

Returns: **Buffer**
Expand All @@ -59,7 +59,7 @@ Returns: **Buffer**

Parameters:

- **receiverRawSK** - Receiver's private key, hex string or buffer
- **receiverRawSK** - Receiver's private key, hex string or Uint8Array
- **msg** - Data to decrypt

Returns: **Buffer**
Expand Down
5 changes: 4 additions & 1 deletion example/browser/script.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { bytesToHex } from "@noble/ciphers/utils";
import { Buffer } from "buffer";
import { PrivateKey, decrypt, encrypt } from "eciesjs";
import './style.css';

import "./style.css";

globalThis.Buffer = Buffer

const sk = new PrivateKey();
const encoder = new TextEncoder();
Expand Down
3 changes: 2 additions & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
"author": "",
"license": "MIT",
"dependencies": {
"buffer": "^6.0.3",
"eciesjs": "file:.."
},
"devDependencies": {
"vite": "^5.4.8",
"vite-plugin-node-polyfills": "^0.22.0"
"vite-bundle-visualizer": "^1.2.1"
}
}
Loading

0 comments on commit a73eeeb

Please sign in to comment.