AES-GCM encryption wrapper using native Linux binary (Bun runtime)
npm install ts-plug-encryptts-plug-encrypt adalah TypeScript module (Bun runtime) yang berfungsi sebagai wrapper / callback untuk binary plug-encrypt yang ditulis menggunakan Go.
Module ini menyediakan API sederhana berbasis async function untuk melakukan file encryption & decryption (AES-GCM) tanpa perlu berinteraksi langsung dengan CLI.
> ⚠ Platform saat ini: Linux only
> Binary untuk Windows & macOS akan tersedia di versi selanjutnya.
---
- Bun >= 1.0
- Linux
- Binary plug-encrypt (sudah disertakan di package)
Module ini tidak mendukung Node.js.
---
bash
bun add ts-plug-encrypt
``$3
`bash
bun add ts-plug-encrypt
`---
Usage
$3
`ts
import { TsPlugencrypt } from "ts-plug-encrypt";
`---
$3
`ts
await TsPlugencrypt.encrypt(
"examples/input.txt",
"examples/output.encrypt"
);
`---
$3
`ts
await TsPlugencrypt.decrypt(
"examples/output.encrypt",
"examples/input.txt"
);
`---
API
$3
Encrypt file menggunakan AES-GCM.
Parameters
*
inputfile: string
Path file plaintext
* outputfile: string
Path file output terenkripsiReturns
*
Promise---
$3
Decrypt file terenkripsi ke bentuk plaintext.
Parameters
*
targetfile: string
Path file terenkripsi
* outputfile: string
Path file hasil dekripsiReturns
*
Promise---
Platform Support
| Platform | Status |
| -------- | ----------- |
| Linux | ✅ Supported |
| Windows | ⏳ Planned |
| macOS | ⏳ Planned |
---
Notes
* Module ini menggunakan Bun native
spawn API
* Binary plug-encrypt dipanggil sebagai child process
* Error dari binary akan dilempar sebagai Error`---
MIT