xypriss-security 2.0.9 → 2.1.1

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.
Files changed (34) hide show
  1. package/README.md +10 -8
  2. package/dist/src/components/index.d.ts +1 -1
  3. package/dist/src/components/index.js +1 -1
  4. package/dist/src/core/PasswordManager.d.ts +205 -0
  5. package/dist/src/core/PasswordManager.d.ts.map +1 -0
  6. package/dist/src/core/PasswordManager.js +478 -0
  7. package/dist/src/core/PasswordManager.js.map +1 -0
  8. package/dist/src/core/SecureBuffer.d.ts +1 -1
  9. package/dist/src/core/SecureBuffer.js +1 -1
  10. package/dist/src/core/index.d.ts +3 -2
  11. package/dist/src/core/index.d.ts.map +1 -1
  12. package/dist/src/core/index.js +4 -3
  13. package/dist/src/core/index.js.map +1 -1
  14. package/dist/src/index.d.ts +3 -3
  15. package/dist/src/index.d.ts.map +1 -1
  16. package/dist/src/index.js +9 -5
  17. package/dist/src/index.js.map +1 -1
  18. package/dist/src/mods/PasswordMDict.d.ts +141 -0
  19. package/dist/src/mods/PasswordMDict.d.ts.map +1 -0
  20. package/dist/src/mods/PasswordMDict.js +464 -0
  21. package/dist/src/mods/PasswordMDict.js.map +1 -0
  22. package/dist/src/mods/eff_large_wordlist.txt +7776 -0
  23. package/dist/src/mods/eff_short_wordlist_2_0.txt +1296 -0
  24. package/dist/src/types/PasswordManagerOptions.d.ts +142 -0
  25. package/dist/src/types/PasswordManagerOptions.d.ts.map +1 -0
  26. package/dist/src/types/PasswordManagerOptions.js +4 -0
  27. package/dist/src/types/PasswordManagerOptions.js.map +1 -0
  28. package/dist/src/types/index.d.ts +1 -1
  29. package/dist/src/types/index.js +1 -1
  30. package/dist/src/utils/CryptoAlgorithmUtils.d.ts +1 -1
  31. package/dist/src/utils/CryptoAlgorithmUtils.js +1 -1
  32. package/dist/src/utils/index.d.ts +1 -1
  33. package/dist/src/utils/index.js +1 -1
  34. package/package.json +2 -2
@@ -0,0 +1,142 @@
1
+ import { PasswordHashOptions } from ".";
2
+ /**
3
+ * Constructor options for `PasswordManager`.
4
+ * These become the permanent defaults for every `hash()` and `verify()` call.
5
+ */
6
+ export interface PasswordManagerOptions extends PasswordHashOptions {
7
+ /**
8
+ * Hashing algorithm to use.
9
+ * @default "argon2id"
10
+ */
11
+ algorithm?: "argon2id" | "scrypt" | "pbkdf2" | string;
12
+ /**
13
+ * Memory cost in KiB (Argon2id).
14
+ * Higher = more resistant to brute-force at the cost of RAM.
15
+ * @default 65536 (64 MiB)
16
+ */
17
+ memoryCost?: number;
18
+ /**
19
+ * Number of time iterations (Argon2id / PBKDF2).
20
+ * @default 3
21
+ */
22
+ iterations?: number;
23
+ /**
24
+ * Degree of parallelism / thread count (Argon2id).
25
+ * @default 4
26
+ */
27
+ parallelism?: number;
28
+ /**
29
+ * Secret pepper appended to every password before hashing.
30
+ * Store separately from the database (e.g., an environment variable).
31
+ */
32
+ pepper?: string;
33
+ }
34
+ /**
35
+ * Criteria for generating a secure random password.
36
+ */
37
+ export interface PasswordGenerateOptions {
38
+ /**
39
+ * Total length of the generated password.
40
+ * Must be between 8 and 512 inclusive.
41
+ * @default 20
42
+ */
43
+ length?: number;
44
+ /** Include uppercase letters (A-Z). @default true */
45
+ uppercase?: boolean;
46
+ /** Include lowercase letters (a-z). @default true */
47
+ lowercase?: boolean;
48
+ /** Include digits (0-9). @default true */
49
+ numbers?: boolean;
50
+ /** Include special symbols. @default true */
51
+ symbols?: boolean;
52
+ /** Remove visually similar characters (e.g. 0, O, l, 1). @default false */
53
+ excludeSimilar?: boolean;
54
+ /**
55
+ * Custom characters to inject into the password (guarantee at least one
56
+ * occurrence of each char in this string).
57
+ * Extra chars are *injected* at random positions, not appended.
58
+ */
59
+ extra?: string;
60
+ }
61
+ /**
62
+ * Criteria for generating a memorable passphrase.
63
+ */
64
+ export interface PassphraseOptions {
65
+ /**
66
+ * Number of words in the passphrase.
67
+ * Must be between 3 and 20 inclusive.
68
+ * @default 5
69
+ */
70
+ wordCount?: number;
71
+ /** Word separator. @default "-" */
72
+ separator?: string;
73
+ /** Capitalize the first letter of each word. @default true */
74
+ capitalize?: boolean;
75
+ /**
76
+ * Append a random number block at the end (e.g. "-4827").
77
+ * Significantly increases entropy.
78
+ * @default true
79
+ */
80
+ appendNumbers?: boolean;
81
+ /**
82
+ * EFF wordlist variant to use.
83
+ * - `"large"` (default): 7 776 words, ~12.9 bits/word
84
+ * - `"short1"`: 1 296 words, ~10.3 bits/word
85
+ * - `"short2"`: 1 296 words, ~10.3 bits/word (uniquely decodable)
86
+ * @default "large"
87
+ */
88
+ variant?: "large" | "short1" | "short2";
89
+ /**
90
+ * Directory containing the EFF `.txt` wordlist files.
91
+ * Defaults to the `src/mods/` directory bundled with the package.
92
+ */
93
+ dir?: string;
94
+ /**
95
+ * Custom file path to an EFF-formatted wordlist.
96
+ * Takes precedence over `dir` + `variant`.
97
+ */
98
+ filePath?: string;
99
+ /**
100
+ * Fallback behaviour if the EFF file cannot be loaded.
101
+ * - `"silent"` (default): use built-in 256-word list silently.
102
+ * - `"warn"`: use built-in list but print a console warning.
103
+ * - `false`: throw an error instead of falling back.
104
+ * @default "silent"
105
+ */
106
+ allowFallback?: "silent" | "warn" | false;
107
+ }
108
+ /**
109
+ * Result of a password strength analysis.
110
+ */
111
+ export interface PasswordStrengthResult {
112
+ /** Score from 0 (very weak) to 100 (extremely strong). */
113
+ score: number;
114
+ /** Human-readable label. */
115
+ label: "very-weak" | "weak" | "fair" | "strong" | "very-strong";
116
+ /** Specific improvement suggestions. */
117
+ suggestions: string[];
118
+ /** Detailed breakdown of the analysis. */
119
+ analysis: {
120
+ length: number;
121
+ hasUppercase: boolean;
122
+ hasLowercase: boolean;
123
+ hasNumbers: boolean;
124
+ hasSymbols: boolean;
125
+ hasRepeats: boolean;
126
+ hasSequences: boolean;
127
+ entropy: number;
128
+ };
129
+ }
130
+ /**
131
+ * Result of a HaveIBeenPwned breach check.
132
+ */
133
+ export interface BreachCheckResult {
134
+ /** Whether the password was found in any known breach corpus. */
135
+ breached: boolean;
136
+ /**
137
+ * Number of times the password appeared across all known breaches.
138
+ * `0` means no match was found.
139
+ */
140
+ occurrences: number;
141
+ }
142
+ //# sourceMappingURL=PasswordManagerOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordManagerOptions.d.ts","sourceRoot":"","sources":["../../../src/types/PasswordManagerOptions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,GAAG,CAAC;AAExC;;;GAGG;AACH,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IACjE;;;OAGG;IACH,SAAS,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;IAEtD;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,qDAAqD;IACrD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2EAA2E;IAC3E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAGxB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACxC;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,aAAa,CAAC;IAChE,wCAAwC;IACxC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,0CAA0C;IAC1C,QAAQ,EAAE;QACR,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,EAAE,OAAO,CAAC;QACtB,YAAY,EAAE,OAAO,CAAC;QACtB,UAAU,EAAE,OAAO,CAAC;QACpB,UAAU,EAAE,OAAO,CAAC;QACpB,UAAU,EAAE,OAAO,CAAC;QACpB,YAAY,EAAE,OAAO,CAAC;QACtB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,iEAAiE;IACjE,QAAQ,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // ─── Types ────────────────────────────────────────────────────────────────────
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=PasswordManagerOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordManagerOptions.js","sourceRoot":"","sources":["../../../src/types/PasswordManagerOptions.ts"],"names":[],"mappings":";AAAA,iFAAiF"}
@@ -5,7 +5,7 @@
5
5
  * XyPriss Security framework. It ensures consistent data structures and
6
6
  * type safety across all security-related operations.
7
7
  *
8
- * @author NEHONIX (iDevo - https://github.com/iDevo-ll)
8
+ * @author NEHONIX (Nehonix-Team - https://github.com/Nehonix-Team)
9
9
  * @license Nehonix Open Source License (NOSL)
10
10
  ****************************************************************************/
11
11
  /**
@@ -6,7 +6,7 @@
6
6
  * XyPriss Security framework. It ensures consistent data structures and
7
7
  * type safety across all security-related operations.
8
8
  *
9
- * @author NEHONIX (iDevo - https://github.com/iDevo-ll)
9
+ * @author NEHONIX (Nehonix-Team - https://github.com/Nehonix-Team)
10
10
  * @license Nehonix Open Source License (NOSL)
11
11
  ****************************************************************************/
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Provides professional metadata and classification for supported algorithms.
5
5
  *
6
- * @author NEHONIX (iDevo - https://github.com/iDevo-ll)
6
+ * @author NEHONIX (Nehonix-Team - https://github.com/Nehonix-Team)
7
7
  * @license Nehonix Open Source License (NOSL)
8
8
  ****************************************************************************/
9
9
  import { AlgorithmInfo } from "../types";
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * Provides professional metadata and classification for supported algorithms.
6
6
  *
7
- * @author NEHONIX (iDevo - https://github.com/iDevo-ll)
7
+ * @author NEHONIX (Nehonix-Team - https://github.com/Nehonix-Team)
8
8
  * @license Nehonix Open Source License (NOSL)
9
9
  ****************************************************************************/
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  /***************************************************************************
2
2
  * XyPriss Security - Unified Utility Hub
3
3
  *
4
- * @author NEHONIX (iDevo - https://github.com/iDevo-ll)
4
+ * @author NEHONIX (Nehonix-Team - https://github.com/Nehonix-Team)
5
5
  * @license Nehonix Open Source License (NOSL)
6
6
  ****************************************************************************/
7
7
  export * from "./encoding";
@@ -2,7 +2,7 @@
2
2
  /***************************************************************************
3
3
  * XyPriss Security - Unified Utility Hub
4
4
  *
5
- * @author NEHONIX (iDevo - https://github.com/iDevo-ll)
5
+ * @author NEHONIX (Nehonix-Team - https://github.com/Nehonix-Team)
6
6
  * @license Nehonix Open Source License (NOSL)
7
7
  ****************************************************************************/
8
8
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xypriss-security",
3
- "version": "2.0.9",
3
+ "version": "2.1.1",
4
4
  "description": "Advanced High-Performance Security Framework powered by a Go Core. Military-grade encryption, post-quantum resilience, and fortified data structures.",
5
5
  "author": {
6
6
  "name": "NEHONIX",
@@ -15,7 +15,7 @@
15
15
  "scripts": {
16
16
  "build": "xfpm run build:ts",
17
17
  "build:core": "node scripts/build-core.js",
18
- "build:ts": "rimraf dist && tsc",
18
+ "build:ts": "rimraf dist && tsc && mkdir -p dist/src/mods && cp src/mods/*.txt dist/src/mods/",
19
19
  "build:release": "bash scripts/release-build.sh",
20
20
  "build:all": "npm run build && npm run build:release",
21
21
  "postinstall": "node scripts/build-core.js",