@powerlines/plugin-crypto 0.10.24 → 0.10.26

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.
@@ -1 +1 @@
1
- require(`../plugin-pBKbb5K9.cjs`),require(`../types-o3zWarRp.cjs`);
1
+ require(`../plugin-DHXHjv16.cjs`),require(`../types-DHkg7xmX.cjs`);
@@ -0,0 +1,3 @@
1
+ import { a as __ΩCryptoPluginContext, c as __ΩCryptoPluginUserConfig, i as CryptoPluginUserConfig, n as CryptoPluginOptions, o as __ΩCryptoPluginOptions, r as CryptoPluginResolvedConfig, s as __ΩCryptoPluginResolvedConfig, t as CryptoPluginContext } from "../plugin-AoiogbrF.cjs";
2
+ import "../index-CEgs-Dz2.cjs";
3
+ export { CryptoPluginContext, CryptoPluginOptions, CryptoPluginResolvedConfig, CryptoPluginUserConfig, __ΩCryptoPluginContext, __ΩCryptoPluginOptions, __ΩCryptoPluginResolvedConfig, __ΩCryptoPluginUserConfig };
@@ -0,0 +1,3 @@
1
+ import { a as __ΩCryptoPluginContext, c as __ΩCryptoPluginUserConfig, i as CryptoPluginUserConfig, n as CryptoPluginOptions, o as __ΩCryptoPluginOptions, r as CryptoPluginResolvedConfig, s as __ΩCryptoPluginResolvedConfig, t as CryptoPluginContext } from "../plugin-BfCldGxF.mjs";
2
+ import "../index-D9zIjQH9.mjs";
3
+ export { CryptoPluginContext, CryptoPluginOptions, CryptoPluginResolvedConfig, CryptoPluginUserConfig, __ΩCryptoPluginContext, __ΩCryptoPluginOptions, __ΩCryptoPluginResolvedConfig, __ΩCryptoPluginUserConfig };
@@ -1 +1 @@
1
- import"../plugin-Gb47Xzf6.mjs";import"../types-DBtscVQq.mjs";export{};
1
+ import"../plugin-DzeYlbKJ.mjs";import"../types-BKeuN6sy.mjs";export{};
@@ -1 +1 @@
1
- require(`../plugin-pBKbb5K9.cjs`);
1
+ require(`../plugin-DHXHjv16.cjs`);
@@ -0,0 +1,2 @@
1
+ import { a as __ΩCryptoPluginContext, c as __ΩCryptoPluginUserConfig, i as CryptoPluginUserConfig, n as CryptoPluginOptions, o as __ΩCryptoPluginOptions, r as CryptoPluginResolvedConfig, s as __ΩCryptoPluginResolvedConfig, t as CryptoPluginContext } from "../plugin-AoiogbrF.cjs";
2
+ export { CryptoPluginContext, CryptoPluginOptions, CryptoPluginResolvedConfig, CryptoPluginUserConfig, __ΩCryptoPluginContext, __ΩCryptoPluginOptions, __ΩCryptoPluginResolvedConfig, __ΩCryptoPluginUserConfig };
@@ -0,0 +1,2 @@
1
+ import { a as __ΩCryptoPluginContext, c as __ΩCryptoPluginUserConfig, i as CryptoPluginUserConfig, n as CryptoPluginOptions, o as __ΩCryptoPluginOptions, r as CryptoPluginResolvedConfig, s as __ΩCryptoPluginResolvedConfig, t as CryptoPluginContext } from "../plugin-BfCldGxF.mjs";
2
+ export { CryptoPluginContext, CryptoPluginOptions, CryptoPluginResolvedConfig, CryptoPluginUserConfig, __ΩCryptoPluginContext, __ΩCryptoPluginOptions, __ΩCryptoPluginResolvedConfig, __ΩCryptoPluginUserConfig };
@@ -1 +1 @@
1
- import"../plugin-Gb47Xzf6.mjs";export{};
1
+ import"../plugin-DzeYlbKJ.mjs";export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-crypto",
3
- "version": "0.10.24",
3
+ "version": "0.10.26",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin that provides unique identifier generation capabilities at runtime by adding the `id` builtin module.",
6
6
  "repository": {
@@ -128,17 +128,17 @@
128
128
  "files": ["dist/**/*"],
129
129
  "keywords": ["powerlines", "storm-software", "powerlines-plugin"],
130
130
  "dependencies": {
131
- "@powerlines/plugin-env": "^0.13.56",
132
- "@storm-software/config-tools": "^1.188.52",
131
+ "@powerlines/plugin-env": "^0.13.58",
132
+ "@storm-software/config-tools": "^1.188.54",
133
133
  "@stryke/path": "^0.22.0",
134
134
  "defu": "^6.1.4",
135
- "powerlines": "^0.30.1",
135
+ "powerlines": "^0.30.3",
136
136
  "@noble/ciphers": "^2.0.1"
137
137
  },
138
138
  "devDependencies": {
139
- "@powerlines/nx": "^0.10.50",
139
+ "@powerlines/nx": "^0.10.52",
140
140
  "@types/node": "^24.10.1"
141
141
  },
142
142
  "publishConfig": { "access": "public" },
143
- "gitHead": "499105ba7cabc6fa139bbc6829746a15c5c59357"
143
+ "gitHead": "8f31b1531e973824d7c3d58abe08c1f1f75e36e5"
144
144
  }
@@ -1 +0,0 @@
1
- const e=require(`../crypto-B-aare-W.cjs`);exports.cryptoModule=e.t;
@@ -1 +0,0 @@
1
- import{t as e}from"../crypto-BH9o0GJJ.mjs";export{e as cryptoModule};
@@ -1 +0,0 @@
1
- const e=require(`../crypto-B-aare-W.cjs`);require(`../components-BWLXb7a2.cjs`),exports.cryptoModule=e.t;
@@ -1 +0,0 @@
1
- import{t as e}from"../crypto-BH9o0GJJ.mjs";import"../components-ipRi4DSE.mjs";export{e as cryptoModule};
@@ -1,142 +0,0 @@
1
- const e=require(`./index.cjs`);let t=require(`@stryke/string-format/title-case`);function n(e){return`
2
- // Generated with ${(0,t.titleCase)(e.config.framework)}
3
- // Note: Do not edit this file manually - it will be overwritten automatically
4
- `}function r(e,t={}){let{directive:r=null,prettierIgnore:i=!1}=t;return`/* eslint-disable */
5
- // biome-ignore lint: disable
6
- ${i?`// prettier-ignore`:``}${r?`\n\n${r}\n`:`
7
- `}
8
- ${n(e)}
9
-
10
- `}function i(e){return`
11
- /**
12
- * The cryptography module provides custom helper functions to support encrypting and decrypting data.
13
- *
14
- * @module ${e.config.output.builtinPrefix}:crypto
15
- */
16
-
17
- ${r(e)}
18
-
19
- import { xchacha20poly1305, chacha20poly1305 } from "@noble/ciphers/chacha.js";
20
- import { randomBytes, managedNonce, hexToBytes } from "@noble/ciphers/utils.js";
21
- import { scrypt } from "@noble/hashes/scrypt.js";
22
- import { blake3 } from "@noble/hashes/blake3.js";
23
- ${e.config.crypto.encryptionKey?`
24
- const nonce = randomBytes(24);
25
- const chacha = xchacha20poly1305(hexToBytes("${e.config.crypto.encryptionKey}"), nonce);
26
-
27
- /**
28
- * Symmetrically encrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher.
29
- *
30
- * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
31
- *
32
- * @param plaintext - The data to encrypt.
33
- * @returns The encrypted data.
34
- */
35
- export function encrypt(plaintext: string): string {
36
- return chacha.encrypt(
37
- nonce,
38
- new TextEncoder().encode(plaintext),
39
- null
40
- );
41
- }
42
-
43
- /**
44
- * Symmetrically decrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher.
45
- *
46
- * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
47
- *
48
- * @param encrypted - The encrypted data to decrypt.
49
- * @returns The decrypted data.
50
- */
51
- export function decrypt(encrypted: string): string {
52
- const decrypted = chacha.decrypt(
53
- nonce,
54
- encrypted,
55
- null
56
- );
57
-
58
- return new TextDecoder().decode(decrypted);
59
- }
60
- `:``}
61
-
62
- /**
63
- * Symmetrically encrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher with a password.
64
- *
65
- * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
66
- *
67
- * @param password - The password used to derive the encryption key.
68
- * @param plaintext - The data to encrypt.
69
- * @returns The encrypted data.
70
- */
71
- export function encryptWithPassword(password: string, plaintext: string): string {
72
- const key = scrypt(
73
- new TextEncoder().encode(password),
74
- hexToBytes("${e.config.crypto.salt?e.config.crypto.salt:`nonce`}"),
75
- 1048576, // requires 1GB of RAM to calculate
76
- 8,
77
- 1,
78
- 32
79
- );
80
-
81
- return chacha20poly1305(key).encrypt(
82
- nonce,
83
- new TextEncoder().encode(plaintext),
84
- null
85
- );
86
- }
87
-
88
- /**
89
- * Symmetrically decrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher with a password.
90
- *
91
- * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
92
- *
93
- * @param password - The password used to derive the decryption key.
94
- * @param encrypted - The encrypted data to decrypt.
95
- * @returns The decrypted data.
96
- */
97
- export function decryptWithPassword(password: string, encrypted: string): string {
98
- const key = scrypt(
99
- new TextEncoder().encode(password),
100
- hexToBytes("${e.config.crypto.salt?e.config.crypto.salt:`nonce`}"),
101
- 1048576, // requires 1GB of RAM to calculate
102
- 8,
103
- 1,
104
- 32
105
- );
106
-
107
- const decrypted = chacha20poly1305(key).decrypt(
108
- nonce,
109
- encrypted,
110
- null
111
- );
112
-
113
- return new TextDecoder().decode(decrypted);
114
- }
115
-
116
- /**
117
- * Hashes data using the [BLAKE3](https://en.wikipedia.org/wiki/BLAKE_(hash_function)#BLAKE3) hash function.
118
- *
119
- * @see https://en.wikipedia.org/wiki/BLAKE_(hash_function)#BLAKE3
120
- *
121
- * @param data - The data to hash.
122
- * @returns The hashed data.
123
- */
124
- export function hash(data: string): string {
125
- return Buffer.from(
126
- blake3(new TextEncoder().encode(data), {
127
- key: ${e.config.crypto.salt?`hexToBytes("${e.config.crypto.salt}")`:`new TextEncoder().encode("powerlines")`})
128
- })
129
- ).toString("hex");
130
- }
131
-
132
- // Export noble cipher and hash functions for advanced usage
133
-
134
- export * from "@noble/ciphers/chacha.js";
135
- export * from "@noble/ciphers/aes.js";
136
- export * from "@noble/ciphers/utils.js";
137
- export * from '@noble/hashes/blake3.js';
138
- export * from '@noble/hashes/pbkdf2.js';
139
- export * from '@noble/hashes/scrypt.js';
140
- export * from '@noble/hashes/utils.js';
141
-
142
- `}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
@@ -1,142 +0,0 @@
1
- import{titleCase as e}from"@stryke/string-format/title-case";function t(t){return`
2
- // Generated with ${e(t.config.framework)}
3
- // Note: Do not edit this file manually - it will be overwritten automatically
4
- `}function n(e,n={}){let{directive:r=null,prettierIgnore:i=!1}=n;return`/* eslint-disable */
5
- // biome-ignore lint: disable
6
- ${i?`// prettier-ignore`:``}${r?`\n\n${r}\n`:`
7
- `}
8
- ${t(e)}
9
-
10
- `}function r(e){return`
11
- /**
12
- * The cryptography module provides custom helper functions to support encrypting and decrypting data.
13
- *
14
- * @module ${e.config.output.builtinPrefix}:crypto
15
- */
16
-
17
- ${n(e)}
18
-
19
- import { xchacha20poly1305, chacha20poly1305 } from "@noble/ciphers/chacha.js";
20
- import { randomBytes, managedNonce, hexToBytes } from "@noble/ciphers/utils.js";
21
- import { scrypt } from "@noble/hashes/scrypt.js";
22
- import { blake3 } from "@noble/hashes/blake3.js";
23
- ${e.config.crypto.encryptionKey?`
24
- const nonce = randomBytes(24);
25
- const chacha = xchacha20poly1305(hexToBytes("${e.config.crypto.encryptionKey}"), nonce);
26
-
27
- /**
28
- * Symmetrically encrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher.
29
- *
30
- * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
31
- *
32
- * @param plaintext - The data to encrypt.
33
- * @returns The encrypted data.
34
- */
35
- export function encrypt(plaintext: string): string {
36
- return chacha.encrypt(
37
- nonce,
38
- new TextEncoder().encode(plaintext),
39
- null
40
- );
41
- }
42
-
43
- /**
44
- * Symmetrically decrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher.
45
- *
46
- * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
47
- *
48
- * @param encrypted - The encrypted data to decrypt.
49
- * @returns The decrypted data.
50
- */
51
- export function decrypt(encrypted: string): string {
52
- const decrypted = chacha.decrypt(
53
- nonce,
54
- encrypted,
55
- null
56
- );
57
-
58
- return new TextDecoder().decode(decrypted);
59
- }
60
- `:``}
61
-
62
- /**
63
- * Symmetrically encrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher with a password.
64
- *
65
- * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
66
- *
67
- * @param password - The password used to derive the encryption key.
68
- * @param plaintext - The data to encrypt.
69
- * @returns The encrypted data.
70
- */
71
- export function encryptWithPassword(password: string, plaintext: string): string {
72
- const key = scrypt(
73
- new TextEncoder().encode(password),
74
- hexToBytes("${e.config.crypto.salt?e.config.crypto.salt:`nonce`}"),
75
- 1048576, // requires 1GB of RAM to calculate
76
- 8,
77
- 1,
78
- 32
79
- );
80
-
81
- return chacha20poly1305(key).encrypt(
82
- nonce,
83
- new TextEncoder().encode(plaintext),
84
- null
85
- );
86
- }
87
-
88
- /**
89
- * Symmetrically decrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher with a password.
90
- *
91
- * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
92
- *
93
- * @param password - The password used to derive the decryption key.
94
- * @param encrypted - The encrypted data to decrypt.
95
- * @returns The decrypted data.
96
- */
97
- export function decryptWithPassword(password: string, encrypted: string): string {
98
- const key = scrypt(
99
- new TextEncoder().encode(password),
100
- hexToBytes("${e.config.crypto.salt?e.config.crypto.salt:`nonce`}"),
101
- 1048576, // requires 1GB of RAM to calculate
102
- 8,
103
- 1,
104
- 32
105
- );
106
-
107
- const decrypted = chacha20poly1305(key).decrypt(
108
- nonce,
109
- encrypted,
110
- null
111
- );
112
-
113
- return new TextDecoder().decode(decrypted);
114
- }
115
-
116
- /**
117
- * Hashes data using the [BLAKE3](https://en.wikipedia.org/wiki/BLAKE_(hash_function)#BLAKE3) hash function.
118
- *
119
- * @see https://en.wikipedia.org/wiki/BLAKE_(hash_function)#BLAKE3
120
- *
121
- * @param data - The data to hash.
122
- * @returns The hashed data.
123
- */
124
- export function hash(data: string): string {
125
- return Buffer.from(
126
- blake3(new TextEncoder().encode(data), {
127
- key: ${e.config.crypto.salt?`hexToBytes("${e.config.crypto.salt}")`:`new TextEncoder().encode("powerlines")`})
128
- })
129
- ).toString("hex");
130
- }
131
-
132
- // Export noble cipher and hash functions for advanced usage
133
-
134
- export * from "@noble/ciphers/chacha.js";
135
- export * from "@noble/ciphers/aes.js";
136
- export * from "@noble/ciphers/utils.js";
137
- export * from '@noble/hashes/blake3.js';
138
- export * from '@noble/hashes/pbkdf2.js';
139
- export * from '@noble/hashes/scrypt.js';
140
- export * from '@noble/hashes/utils.js';
141
-
142
- `}export{r as t};
@@ -1 +0,0 @@
1
- export{};
File without changes