mirror of
https://github.com/cupcakearmy/occulto.git
synced 2025-09-06 08:50:44 +00:00
2.0.0 (#3)
* rewrite * testing worklflow * sprcify version * config stuff * add hash as buffer * delete docs * use typedarray everywhere and docs * readme * aes * cleanup * rsa * testing with playwright * fix playwright * readme * docs * update deps * use headless * add prepublish * build pipeline * move types up * move types up * add types legacy * packaging * versions bump * cleanup * maybe this time * drop support for commonjs * version bump * cleanup
This commit is contained in:
39
README.md
39
README.md
@@ -1,18 +1,24 @@
|
||||
# occulto 🔒
|
||||
|
||||
High level wrapper around the [node native crypto API](https://nodejs.org/api/crypto.html).
|
||||
> Occulto <kbd>/okˈkul.to/</kbd>
|
||||
>
|
||||
> _hidden, concealed. secret._
|
||||
|
||||
**No Deps & Typescript typings included**
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
Supports Hashes, Symmetric AES & ChaCha20 ciphers and Asymmetric RSA.
|
||||
Isomorphic encryption library that works both in the browser and node with _no dependencies_ and written in Typescript.
|
||||
|
||||
[**📒 DOCS HERE 📒**](https://cupcakearmy.github.io/occulto/index.html)
|
||||
[**📒 API Documentation 📒**](https://occulto.pages.dev)
|
||||
|
||||
## Quickstart 🚀
|
||||
|
||||
###### Requirements
|
||||
|
||||
- Node >= 11 required (ChaCha20)
|
||||
- Node >= 16 required
|
||||
|
||||
###### Install
|
||||
|
||||
@@ -20,32 +26,32 @@ Supports Hashes, Symmetric AES & ChaCha20 ciphers and Asymmetric RSA.
|
||||
npm i occulto
|
||||
```
|
||||
|
||||
### Examples
|
||||
## Examples
|
||||
|
||||
## [RSA](https://cupcakearmy.github.io/occulto/modules/_rsa_.html)
|
||||
### [RSA](https://occulto.pages.dev/classes/RSA)
|
||||
|
||||
```typescript
|
||||
import { RSA } from 'occulto'
|
||||
|
||||
const pair = await RSA.gen()
|
||||
const encrypted = RSA.encrypt('some text', pair.pub)
|
||||
const decrypted = RSA.decrypt(encrypted, pair.prv)
|
||||
const pair = await RSA.generateKeyPair()
|
||||
const encrypted = await RSA.encrypt('some text', pair.public)
|
||||
const decrypted = await RSA.decrypt(encrypted, pair.private)
|
||||
```
|
||||
|
||||
## [Symmetric](https://cupcakearmy.github.io/occulto/modules/_symmetric_.html)
|
||||
### [AES](https://occulto.pages.dev/classes/AES)
|
||||
|
||||
[Available Ciphers](https://cupcakearmy.github.io/occulto/enums/_symmetric_.ciphers.html)
|
||||
[Available Modes](https://occulto.pages.dev/enums/Modes)
|
||||
|
||||
```javascript
|
||||
import { Symmetric } from 'occulto'
|
||||
|
||||
const encrypted = Symmetric.encrypt('some string' , 'myPass', Symmetric.Ciphers.AES_128_GCM)
|
||||
const decrypted = Symmetric.decrypt(encrypted, 'myPadd')
|
||||
const encrypted = await Symmetric.encryptEasy('some string', 'myPass')
|
||||
const decrypted = await Symmetric.decryptEasy(encrypted, 'myPass')
|
||||
```
|
||||
|
||||
## [Hash](https://cupcakearmy.github.io/occulto/modules/_hash_.html)
|
||||
### [Hash](https://occulto.pages.dev/classes/Hash)
|
||||
|
||||
[Available hashes](https://cupcakearmy.github.io/occulto/enums/_hash_.hashes.html)
|
||||
[Available hashes](https://occulto.pages.dev/enums/Hashes)
|
||||
|
||||
```typescript
|
||||
import { Hash } from 'occulto'
|
||||
@@ -53,5 +59,4 @@ import { Hash } from 'occulto'
|
||||
const hash = Hash.digest('something')
|
||||
|
||||
const h = Hash.digest('something', Hash.Hashes.MD5)
|
||||
|
||||
```
|
||||
|
Reference in New Issue
Block a user