6 Commits

Author SHA1 Message Date
dcfd25c823 update deps 2023-04-27 22:30:22 +02:00
5e811edbc5 changelog 2023-04-25 00:07:31 +02:00
66b54dd27d 2.0.1 2023-04-25 00:06:41 +02:00
2d23b95605 update deps 2023-04-25 00:06:36 +02:00
1ab82a78fe readme 2023-01-14 18:49:31 +01:00
5babec20ce stable version 2023-01-14 18:42:49 +01:00
7 changed files with 472 additions and 426 deletions

View File

@@ -1,9 +1,9 @@
name: "Publish to NPM"
name: 'Publish to NPM'
on:
push:
tags:
- "v*"
- 'v*'
jobs:
build:
@@ -16,13 +16,13 @@ jobs:
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: "https://registry.npmjs.org"
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: 7
version: 8
- name: Install dependencies
run: pnpm install

View File

@@ -1,4 +1,4 @@
name: "Run Tests"
name: 'Run Tests'
on:
pull_request:
@@ -17,12 +17,12 @@ jobs:
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: 7
version: 8
- name: Install dependencies
run: pnpm install

1
.npmrc
View File

@@ -1 +0,0 @@
engine-strict=true

View File

@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2.0.1]
### Changed
- Updated dependencies.
## [2.0.0]
### Added

View File

@@ -33,8 +33,10 @@ npm i occulto
```typescript
import { RSA } from 'occulto'
const pair = await RSA.generateKeyPair()
const encrypted = await RSA.encrypt('some text', pair.public)
const pair = await RSA.generateKeyPair(2 ** 11)
const bytes = Bytes.encode(message)
const encrypted = await RSA.encrypt(bytes, pair.public)
const decrypted = await RSA.decrypt(encrypted, pair.private)
```
@@ -42,11 +44,29 @@ const decrypted = await RSA.decrypt(encrypted, pair.private)
[Available Modes](https://occulto.pages.dev/enums/Modes)
```javascript
import { Symmetric } from 'occulto'
There is an _easy_ API, that will take care of everything for you.
const encrypted = await Symmetric.encryptEasy('some string', 'myPass')
const decrypted = await Symmetric.decryptEasy(encrypted, 'myPass')
```typescript
import { AES } from 'occulto'
const password = 'foobar'
const message = 'this is a secret'
const encrypted = await AES.encryptEasy(message, password)
const decrypted = await AES.decryptEasy(encrypted, password)
```
The low level API is also exposed for advanced usages.
```typescript
import { AES } from 'occulto'
const message = 'this is a secret'
const key = await AES.generateKey()
const data = Bytes.encode(message)
const ciphertext = await AES.encrypt(data, key)
const plaintext = await AES.decrypt(ciphertext, key)
```
### [Hash](https://occulto.pages.dev/classes/Hash)
@@ -54,9 +74,7 @@ const decrypted = await Symmetric.decryptEasy(encrypted, 'myPass')
[Available hashes](https://occulto.pages.dev/enums/Hashes)
```typescript
import { Hash } from 'occulto'
import { Hash, Hashes } from 'occulto'
const hash = Hash.digest('something')
const h = Hash.digest('something', Hash.Hashes.MD5)
const hashed = await Hash.hash('Some value', Hashes.SHA_512)
```

View File

@@ -1,6 +1,6 @@
{
"name": "occulto",
"version": "2.0.0-rc.10",
"version": "2.0.1",
"license": "MIT",
"description": "crypt utility",
"keywords": [
@@ -13,7 +13,7 @@
"node": ">=16",
"npm": "please-use-pnpm",
"yarn": "please-use-pnpm",
"pnpm": "7"
"pnpm": ">=8"
},
"type": "module",
"types": "./dist/index.d.ts",
@@ -41,15 +41,15 @@
},
"devDependencies": {
"@endyjasmi/karma-playwright-launcher": "^0.0.4",
"@types/node": "^16.18.11",
"@types/node": "^16.18.25",
"chai": "^4.3.7",
"karma": "^6.4.1",
"karma": "^6.4.2",
"karma-mocha": "^2.0.1",
"mocha": "^10.2.0",
"npm-run-all": "^4.1.5",
"playwright": "^1.29.2",
"typedoc": "^0.23.24",
"typescript": "^4.9.4"
"playwright": "^1.33.0",
"typedoc": "^0.24.6",
"typescript": "^5.0.4"
},
"repository": {
"type": "git",

823
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff