Skip to content

Commit

Permalink
Added support for ES6 modules
Browse files Browse the repository at this point in the history
  • Loading branch information
zigazajc007 committed Mar 8, 2023
1 parent 5a70005 commit b8c8e32
Show file tree
Hide file tree
Showing 9 changed files with 852 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
# XChaCha20-JS

XChaCha20 implementation in a plain JavaScript.
XChaCha20 implementation in JavaScript (ES6).

This library will auto generate random nonce and append it to the encrypted message.

## Usage

### 1. Import library
```html
<script src="XChaCha20.min.js"></script>
### 1. Download library
```bash
npm i --save @rabbit-company/xchacha20
```

### 2. Encryption
### 2. Import library
```js
import XChaCha20 from "@rabbit-company/xchacha20";
```

### 3. Encryption
```js
XChaCha20.encrypt(message, secretKey);
```

### 3. Decryption
### 4. Decryption
```js
XChaCha20.decrypt(message, secretKey);
```
6 changes: 0 additions & 6 deletions XChaCha20.min.js

This file was deleted.

Loading

0 comments on commit b8c8e32

Please sign in to comment.