Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pure js aes implementation #794

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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