# @jinx_ark/rsa-crypto-js

> This library provides RSA cryptographic functions. Use this library to encrypt/decrypt the message. Also you can generate private/public key using one of the function.

Latest version **1.0.3** (published 2023-10-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install @jinx_ark/rsa-crypto-js
pnpm add @jinx_ark/rsa-crypto-js
yarn add @jinx_ark/rsa-crypto-js
bun add @jinx_ark/rsa-crypto-js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2023-10-20 |
| First published | 2023-10-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Rajkumar |
| Maintainers | jinx_ark |

## Links

- npm: https://www.npmjs.com/package/@jinx_ark/rsa-crypto-js
- Repository: https://github.com/rajkumar004/rsa-crypto-js
- Homepage: https://github.com/rajkumar004/rsa-crypto-js#readme
- Issues: https://github.com/rajkumar004/rsa-crypto-js/issues
- npm.io page: https://npm.io/package/@jinx_ark/rsa-crypto-js

## Recent versions

- 1.0.3 (latest) — 2023-10-20
- 1.0.2 — 2023-10-20
- 1.0.1 — 2023-10-20
- 1.0.0 — 2023-10-19

## README

# @jinx_ark/rsa-crypto-js

This library provides RSA cryptographic functions. Use this library to encrypt/decrypt the message.
Also you can generate private/public key using one of the function.


## Installation

Installation is done using the npm install command:

```bash
  $ npm install @jinx_ark/rsa-crypto-js
```

## Usage/Examples

To generate key, use the below code:
```javascript
import { generateKey } from '@jinx_ark/rsa-crypto-js';

generateKey(
    key => {
        setKey(key);
    }, { modulusLength: 2048, hashName: 'SHA-256' }
);
```
```javascript
Syntax: generateKey(cb, config)
-------------------------------
config: {
    modulusLength: <it can be 1024, 2048, or 4096>,
    hashName: <it can be "SHA-1", "SHA-256", "SHA-384", or "SHA-512">
}
```

To encrypt the data, use the below code:
```javascript
import { encryptRSA } from '@jinx_ark/rsa-crypto-js';

encryptRSA(data => {
    console.log('encrypted data: ', data);
}, config)
```
```javascript
Syntax: encryptRSA(cb, config)
------------------------------
config: {
    publicKey: <your generated pubickey>,
    data: <string>
}
```

To decrypt the data, use the below code:
```javascript
import { encryptRSA } from '@jinx_ark/rsa-crypto-js';

decryptRSA(data => {
    console.log('encrypted data: :::', data);
    setDecryptedData(data);
}, config)
```
```javascript
Syntax: decryptRSA(cb, config)
------------------------------
config: {
    privateKey: <your generated private-key>,
    data: <string>
}
```
## Features

- Generate private and public key
- Encrypt/decrypt the data(string)


## Authors

- [@Rajkumar J](https://github.com/rajkumar004)

---
_Source: https://npm.io/package/@jinx_ark/rsa-crypto-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
