@lowerdeck/encryption 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -0
- package/package.json +11 -5
- package/.claude/settings.local.json +0 -9
- package/.turbo/turbo-build.log +0 -13
- package/.turbo/turbo-test.log +0 -11
- package/CHANGELOG.md +0 -31
- package/tsconfig.json +0 -8
package/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# `@lowerdeck/encryption`
|
|
2
|
+
|
|
3
|
+
Encryption utility for securely encrypting and decrypting secrets using entity-specific passwords. Uses SHA-512 for key derivation and provides a simple API for secret management.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @lowerdeck/encryption
|
|
9
|
+
yarn add @lowerdeck/encryption
|
|
10
|
+
bun add @lowerdeck/encryption
|
|
11
|
+
pnpm add @lowerdeck/encryption
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { Encryption } from '@lowerdeck/encryption';
|
|
18
|
+
|
|
19
|
+
// Initialize with a master password
|
|
20
|
+
const encryption = new Encryption('master-password-123');
|
|
21
|
+
|
|
22
|
+
// Encrypt a secret for a specific entity
|
|
23
|
+
const encrypted = await encryption.encrypt({
|
|
24
|
+
secret: 'my-api-key',
|
|
25
|
+
entityId: 'user_123'
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// Decrypt the secret
|
|
29
|
+
const decrypted = await encryption.decrypt({
|
|
30
|
+
encrypted,
|
|
31
|
+
entityId: 'user_123'
|
|
32
|
+
});
|
|
33
|
+
console.log(decrypted); // 'my-api-key'
|
|
34
|
+
|
|
35
|
+
// Different entity IDs produce different encryptions
|
|
36
|
+
await encryption.encrypt({
|
|
37
|
+
secret: 'same-secret',
|
|
38
|
+
entityId: 'user_456'
|
|
39
|
+
}); // Different encrypted output
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## License
|
|
43
|
+
|
|
44
|
+
This project is licensed under the Apache License 2.0.
|
|
45
|
+
|
|
46
|
+
<div align="center">
|
|
47
|
+
<sub>Built with ❤️ by <a href="https://metorial.com">Metorial</a></sub>
|
|
48
|
+
</div>
|
package/package.json
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowerdeck/encryption",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
+
"files": [
|
|
8
|
+
"src/**",
|
|
9
|
+
"dist/**",
|
|
10
|
+
"README.md",
|
|
11
|
+
"package.json"
|
|
12
|
+
],
|
|
7
13
|
"author": "Tobias Herber",
|
|
8
14
|
"license": "Apache 2",
|
|
9
15
|
"type": "module",
|
|
@@ -21,15 +27,15 @@
|
|
|
21
27
|
"scripts": {
|
|
22
28
|
"test": "vitest run --passWithNoTests",
|
|
23
29
|
"lint": "prettier src/**/*.ts --check",
|
|
24
|
-
"build": "microbundle"
|
|
30
|
+
"build": "rm -rf ./dist && microbundle"
|
|
25
31
|
},
|
|
26
32
|
"dependencies": {
|
|
27
|
-
"@lowerdeck/base62": "^1.0.
|
|
28
|
-
"@lowerdeck/id": "^1.0.
|
|
33
|
+
"@lowerdeck/base62": "^1.0.4",
|
|
34
|
+
"@lowerdeck/id": "^1.0.5",
|
|
29
35
|
"base-x": "^5.0.0"
|
|
30
36
|
},
|
|
31
37
|
"devDependencies": {
|
|
32
|
-
"@lowerdeck/tsconfig": "^1.0.
|
|
38
|
+
"@lowerdeck/tsconfig": "^1.0.1",
|
|
33
39
|
"microbundle": "^0.15.1",
|
|
34
40
|
"typescript": "5.8.2",
|
|
35
41
|
"vitest": "^3.1.2"
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
[0m[2m[35m$[0m [2m[1mmicrobundle[0m
|
|
3
|
-
No name was provided for external module '@lowerdeck/id' in output.globals – guessing 'id'
|
|
4
|
-
No name was provided for external module '@lowerdeck/base62' in output.globals – guessing 'base62'
|
|
5
|
-
[34mBuild "@lowerdeck/encryption" to dist:[39m
|
|
6
|
-
[32m911 B[39m: [37mindex.cjs[39m.gz
|
|
7
|
-
[32m829 B[39m: [37mindex.cjs[39m.br
|
|
8
|
-
[32m770 B[39m: [37mindex.module.js[39m.gz
|
|
9
|
-
[32m706 B[39m: [37mindex.module.js[39m.br
|
|
10
|
-
[32m882 B[39m: [37mindex.module.js[39m.gz
|
|
11
|
-
[32m821 B[39m: [37mindex.module.js[39m.br
|
|
12
|
-
[32m995 B[39m: [37mindex.umd.js[39m.gz
|
|
13
|
-
[32m896 B[39m: [37mindex.umd.js[39m.br
|
package/.turbo/turbo-test.log
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
[0m[2m[35m$[0m [2m[1mvitest run --passWithNoTests[0m
|
|
3
|
-
[?25l
|
|
4
|
-
[1m[46m RUN [49m[22m [36mv3.2.4 [39m[90m/Users/tobias/code/metorial/metorial-enterprise/oss/src/packages/backend/encryption[39m
|
|
5
|
-
|
|
6
|
-
No test files found, exiting with code 0
|
|
7
|
-
|
|
8
|
-
[2minclude: [22m[33m**/*.{test,spec}.?(c|m)[jt]s?(x)[39m
|
|
9
|
-
[2mexclude: [22m[33m**/node_modules/**[2m, [22m**/dist/**[2m, [22m**/cypress/**[2m, [22m**/.{idea,git,cache,output,temp}/**[2m, [22m**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*[39m
|
|
10
|
-
|
|
11
|
-
[?25h
|
package/CHANGELOG.md
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# @lowerdeck/encryption
|
|
2
|
-
|
|
3
|
-
## 1.0.5
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Fix default entry point
|
|
8
|
-
- Updated dependencies
|
|
9
|
-
- @lowerdeck/base62@1.0.3
|
|
10
|
-
- @lowerdeck/id@1.0.4
|
|
11
|
-
|
|
12
|
-
## 1.0.4
|
|
13
|
-
|
|
14
|
-
### Patch Changes
|
|
15
|
-
|
|
16
|
-
- update versions
|
|
17
|
-
- Updated dependencies
|
|
18
|
-
- @lowerdeck/base62@1.0.2
|
|
19
|
-
- @lowerdeck/id@1.0.3
|
|
20
|
-
|
|
21
|
-
## 1.0.3
|
|
22
|
-
|
|
23
|
-
### Patch Changes
|
|
24
|
-
|
|
25
|
-
- Fix deps
|
|
26
|
-
|
|
27
|
-
## 1.0.2
|
|
28
|
-
|
|
29
|
-
### Patch Changes
|
|
30
|
-
|
|
31
|
-
- Fix salts
|