mirror of
https://github.com/cupcakearmy/occulto.git
synced 2024-12-22 04:46:24 +00:00
Update README.md
This commit is contained in:
parent
c5547aba06
commit
ecb3aec225
22
README.md
22
README.md
@ -14,25 +14,13 @@ Supports Hashes, Symmetric AES & ChaCha20 ciphers and Asymmetric RSA.
|
|||||||
npm i node-forge occulto
|
npm i node-forge occulto
|
||||||
```
|
```
|
||||||
|
|
||||||
```javascript
|
|
||||||
// Whatever import you prefer
|
|
||||||
// const { RSA } = require('occulto')
|
|
||||||
import { RSA } from 'occulto'
|
|
||||||
|
|
||||||
const pair = await RSA.gen()
|
|
||||||
|
|
||||||
const encrypted = RSA.encrypt('some string', 'myPass')
|
|
||||||
const decrypted = RSA.decrypt(encrypted, 'myPass')
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
[**📒 DOCS HERE 📒**](https://cupcakearmy.github.io/occulto/index.html)
|
[**📒 DOCS HERE 📒**](https://cupcakearmy.github.io/occulto/index.html)
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
## RSA
|
## RSA
|
||||||
|
|
||||||
```javascript
|
```typescript
|
||||||
const pair = await RSA.gen()
|
const pair = await RSA.gen()
|
||||||
const encrypted = RSA.encrypt('some text', pair.pub)
|
const encrypted = RSA.encrypt('some text', pair.pub)
|
||||||
const decrypted = RSA.decrypt(encrypted, pair.prv)
|
const decrypted = RSA.decrypt(encrypted, pair.prv)
|
||||||
@ -41,8 +29,6 @@ const decrypted = RSA.decrypt(encrypted, pair.prv)
|
|||||||
## Symmetric
|
## Symmetric
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// Whatever import you prefer
|
|
||||||
// const { Symmetric } = require('occulto')
|
|
||||||
import { Symmetric } from 'occulto'
|
import { Symmetric } from 'occulto'
|
||||||
|
|
||||||
const encrypted = Symmetric.encrypt('some string' , 'myPass', Symmetric.Ciphers.AES_128_GCM)
|
const encrypted = Symmetric.encrypt('some string' , 'myPass', Symmetric.Ciphers.AES_128_GCM)
|
||||||
@ -51,13 +37,11 @@ const decrypted = Symmetric.decrypt(encrypted, 'myPadd')
|
|||||||
|
|
||||||
## Hash
|
## Hash
|
||||||
|
|
||||||
```javascript
|
```typescript
|
||||||
// Whatever import you prefer
|
|
||||||
// const { Hash } = require('occulto')
|
|
||||||
import { Hash } from 'occulto'
|
import { Hash } from 'occulto'
|
||||||
|
|
||||||
const hash = Hash.digest('something')
|
const hash = Hash.digest('something')
|
||||||
|
|
||||||
const h = Hash.digest('something', Hashes.MD5)
|
const h = Hash.digest('something', Hash.Hashes.MD5)
|
||||||
|
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user