zora-cli 0.1.3__tar.gz → 0.2__tar.gz
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.
- {zora_cli-0.1.3/zora_cli.egg-info → zora_cli-0.2}/PKG-INFO +405 -125
- {zora_cli-0.1.3 → zora_cli-0.2}/README.md +404 -124
- {zora_cli-0.1.3 → zora_cli-0.2}/pyproject.toml +1 -1
- zora_cli-0.2/tests/test_args.py +205 -0
- zora_cli-0.2/tests/test_benchmark.py +161 -0
- zora_cli-0.2/tests/test_charset.py +213 -0
- zora_cli-0.2/tests/test_formatting.py +120 -0
- zora_cli-0.2/tests/test_generation.py +235 -0
- zora_cli-0.2/tests/test_output.py +359 -0
- zora_cli-0.2/tests/test_timer.py +119 -0
- zora_cli-0.2/zora/__init__.py +1 -0
- zora_cli-0.2/zora/cli.py +419 -0
- {zora_cli-0.1.3 → zora_cli-0.2}/zora/update.py +1 -1
- {zora_cli-0.1.3 → zora_cli-0.2/zora_cli.egg-info}/PKG-INFO +405 -125
- {zora_cli-0.1.3 → zora_cli-0.2}/zora_cli.egg-info/SOURCES.txt +7 -0
- zora_cli-0.1.3/zora/__init__.py +0 -1
- zora_cli-0.1.3/zora/cli.py +0 -243
- {zora_cli-0.1.3 → zora_cli-0.2}/LICENSE +0 -0
- {zora_cli-0.1.3 → zora_cli-0.2}/setup.cfg +0 -0
- {zora_cli-0.1.3 → zora_cli-0.2}/zora_cli.egg-info/dependency_links.txt +0 -0
- {zora_cli-0.1.3 → zora_cli-0.2}/zora_cli.egg-info/entry_points.txt +0 -0
- {zora_cli-0.1.3 → zora_cli-0.2}/zora_cli.egg-info/requires.txt +0 -0
- {zora_cli-0.1.3 → zora_cli-0.2}/zora_cli.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: zora-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2
|
|
4
4
|
Summary: Cryptographically secure generator of random keys with tons of options and customizations.
|
|
5
5
|
Author: zscopuv
|
|
6
6
|
License: ZORA SOURCE-AVAILABLE LICENSE
|
|
@@ -227,14 +227,16 @@ Requires-Dist: colorama==0.4.6
|
|
|
227
227
|
Requires-Dist: packaging>=24.0
|
|
228
228
|
Dynamic: license-file
|
|
229
229
|
|
|
230
|
-
# 
|
|
231
|
-
> **Early release (`v0.1.3`)**
|
|
230
|
+
# 
|
|
232
231
|
|
|
233
|
-
|
|
234
|
-
`secrets` module by default. It supports customizable character sets,
|
|
235
|
-
charset presets, prefixes, suffixes, grouping, multiple outputs, file
|
|
236
|
-
output, entropy estimation, and an optional deterministic PRNG mode.
|
|
232
|
+
> **Early release (`v0.2`)**
|
|
237
233
|
|
|
234
|
+
Zora is a command-line tool for generating random keys using Python's
|
|
235
|
+
cryptographically secure `secrets` module by default.
|
|
236
|
+
|
|
237
|
+
It supports customizable character sets, composable charset presets,
|
|
238
|
+
prefixes, suffixes, grouping, multiple output formats, file output,
|
|
239
|
+
entropy estimation, benchmarking, and an optional deterministic PRNG mode.
|
|
238
240
|
|
|
239
241
|
---
|
|
240
242
|
|
|
@@ -245,32 +247,66 @@ output, entropy estimation, and an optional deterministic PRNG mode.
|
|
|
245
247
|
- 🎲 **Deterministic generation** with `--seed` in unsafe mode
|
|
246
248
|
- 🔤 **Custom character sets**
|
|
247
249
|
- 🧩 **Composable charset presets** such as `@letters@digits`
|
|
248
|
-
-
|
|
250
|
+
- ⚡ **Fast charset shorthand** with `-x`
|
|
251
|
+
- 🔢 **28 built-in charset presets**
|
|
249
252
|
- ➕ Add **custom characters** to presets
|
|
250
253
|
- 📏 Configurable **key length**
|
|
251
254
|
- 📦 Generate **multiple keys** at once
|
|
252
255
|
- 🔗 Add **prefixes and suffixes**
|
|
253
256
|
- 📐 **Group keys with custom separators**
|
|
254
257
|
- 💾 Write generated **keys to a file**
|
|
258
|
+
- 📤 Multiple output formats: **Text, JSON, CSV, XML, YAML**
|
|
255
259
|
- 📊 Calculate **theoretical entropy**
|
|
256
260
|
- 💪 **Estimate key strength** from entropy
|
|
257
261
|
- ⏱️ Display **generation time**
|
|
262
|
+
- 🏁 **Benchmark key generation**
|
|
258
263
|
- 🤫 **Quiet mode** for scripting
|
|
259
264
|
- 📋 **Charset preset listing**
|
|
265
|
+
- 🔍 **Charset and argument validation**
|
|
266
|
+
- ℹ️ Display the installed version with `--version`
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
# Installation
|
|
271
|
+
|
|
272
|
+
## Requirements
|
|
273
|
+
|
|
274
|
+
Python 3.9 or newer is recommended.
|
|
275
|
+
|
|
276
|
+
Install Zora from PyPI:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
pip install zora-cli
|
|
280
|
+
````
|
|
281
|
+
|
|
282
|
+
Run Zora:
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
zora 32
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### Optional YAML support
|
|
260
289
|
|
|
290
|
+
YAML output requires PyYAML:
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
pip install pyyaml
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
---
|
|
261
297
|
|
|
262
298
|
# Usage
|
|
263
299
|
|
|
264
300
|
Basic usage:
|
|
265
301
|
|
|
266
302
|
```bash
|
|
267
|
-
|
|
303
|
+
zora LENGTH [OPTIONS]
|
|
268
304
|
```
|
|
269
305
|
|
|
270
306
|
For example:
|
|
271
307
|
|
|
272
308
|
```bash
|
|
273
|
-
|
|
309
|
+
zora 32
|
|
274
310
|
```
|
|
275
311
|
|
|
276
312
|
Example output:
|
|
@@ -279,6 +315,7 @@ Example output:
|
|
|
279
315
|
GxKqTnJpYwRzLhBcVfQmNsXeUaPkTdWr
|
|
280
316
|
|
|
281
317
|
Timer: 13ms elapsed
|
|
318
|
+
|
|
282
319
|
Charset: 52
|
|
283
320
|
Entropy: 182.41 bits
|
|
284
321
|
Strength: Very strong
|
|
@@ -294,51 +331,130 @@ Generator: CSPRNG
|
|
|
294
331
|
The length of the random portion of the generated key.
|
|
295
332
|
|
|
296
333
|
```bash
|
|
297
|
-
|
|
334
|
+
zora 32
|
|
298
335
|
```
|
|
299
336
|
|
|
300
337
|
The value must be greater than `0`.
|
|
301
338
|
|
|
302
339
|
---
|
|
303
340
|
|
|
304
|
-
## `--
|
|
341
|
+
## `--version`
|
|
305
342
|
|
|
306
|
-
|
|
343
|
+
Display the currently installed Zora version:
|
|
307
344
|
|
|
308
345
|
```bash
|
|
309
|
-
|
|
346
|
+
zora --version
|
|
310
347
|
```
|
|
311
348
|
|
|
312
|
-
|
|
349
|
+
Example:
|
|
350
|
+
|
|
351
|
+
```text
|
|
352
|
+
zora 0.2.0
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
## `--charset` / `-x`
|
|
358
|
+
|
|
359
|
+
Select the character set used to generate keys.
|
|
360
|
+
|
|
361
|
+
The default charset is:
|
|
313
362
|
|
|
314
363
|
```text
|
|
315
364
|
@letters
|
|
316
365
|
```
|
|
317
366
|
|
|
318
|
-
|
|
367
|
+
Long form:
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
zora 32 --charset @digits
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
Short form:
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
zora 32 -x @digits
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
The `-x` option is provided as a convenient shorthand for faster charset selection.
|
|
319
380
|
|
|
320
381
|
Zora supports both predefined charset presets and literal characters.
|
|
321
382
|
|
|
322
|
-
|
|
383
|
+
---
|
|
323
384
|
|
|
324
|
-
|
|
385
|
+
## Charset presets
|
|
386
|
+
|
|
387
|
+
Use:
|
|
325
388
|
|
|
326
389
|
```bash
|
|
327
|
-
|
|
390
|
+
zora --charset-list
|
|
328
391
|
```
|
|
329
392
|
|
|
330
|
-
|
|
393
|
+
to display all available presets.
|
|
331
394
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
|
335
|
-
|
|
|
336
|
-
| `@
|
|
337
|
-
| `@
|
|
338
|
-
| `@
|
|
339
|
-
| `@
|
|
340
|
-
| `@
|
|
341
|
-
|
|
395
|
+
## Basic
|
|
396
|
+
|
|
397
|
+
| Preset | Characters |
|
|
398
|
+
| ---------- | ----------------------- |
|
|
399
|
+
| `@digits` | `0-9` |
|
|
400
|
+
| `@letters` | `a-zA-Z` |
|
|
401
|
+
| `@lower` | `a-z` |
|
|
402
|
+
| `@upper` | `A-Z` |
|
|
403
|
+
| `@special` | Punctuation and symbols |
|
|
404
|
+
|
|
405
|
+
## Numeric
|
|
406
|
+
|
|
407
|
+
| Preset | Characters |
|
|
408
|
+
| --------- | ------------------------ |
|
|
409
|
+
| `@bin` | `01` |
|
|
410
|
+
| `@oct` | `01234567` |
|
|
411
|
+
| `@hex` | `0123456789ABCDEF` |
|
|
412
|
+
| `@lhex` | `0123456789abcdef` |
|
|
413
|
+
| `@allhex` | `0123456789ABCDEFabcdef` |
|
|
414
|
+
|
|
415
|
+
## URL / filename friendly
|
|
416
|
+
|
|
417
|
+
| Preset | Characters |
|
|
418
|
+
| ----------- | -------------------------------- |
|
|
419
|
+
| `@url` | URL-friendly characters |
|
|
420
|
+
| `@urlsafe` | URL-safe alphanumeric characters |
|
|
421
|
+
| `@filename` | Filename-safe characters |
|
|
422
|
+
|
|
423
|
+
## Human-friendly
|
|
424
|
+
|
|
425
|
+
These presets avoid characters that can easily be confused with one another.
|
|
426
|
+
|
|
427
|
+
| Preset | Description |
|
|
428
|
+
| ------------- | ----------------------------- |
|
|
429
|
+
| `@lowersafe` | Lowercase without `l` |
|
|
430
|
+
| `@uppersafe` | Uppercase without `I` and `O` |
|
|
431
|
+
| `@digitssafe` | Digits without `0` and `1` |
|
|
432
|
+
|
|
433
|
+
## Base encodings
|
|
434
|
+
|
|
435
|
+
| Preset | Description |
|
|
436
|
+
| ---------- | ------------------------- |
|
|
437
|
+
| `@base32` | Uppercase Base32 alphabet |
|
|
438
|
+
| `@base32x` | Lowercase Base32 alphabet |
|
|
439
|
+
| `@base36` | Uppercase Base36 alphabet |
|
|
440
|
+
| `@base36x` | Lowercase Base36 alphabet |
|
|
441
|
+
| `@base62` | Base62 alphabet |
|
|
442
|
+
|
|
443
|
+
## Base64
|
|
444
|
+
|
|
445
|
+
| Preset | Description |
|
|
446
|
+
| ------------ | ------------------------ |
|
|
447
|
+
| `@base64` | Standard Base64 alphabet |
|
|
448
|
+
| `@base64url` | URL-safe Base64 alphabet |
|
|
449
|
+
|
|
450
|
+
## Symbols
|
|
451
|
+
|
|
452
|
+
| Preset | Characters |
|
|
453
|
+
| ----------- | --------------------------- |
|
|
454
|
+
| `@symbols` | Punctuation and symbols |
|
|
455
|
+
| `@brackets` | `()[]{}<>` |
|
|
456
|
+
| `@quotes` | Quote characters |
|
|
457
|
+
| `@math` | Common mathematical symbols |
|
|
342
458
|
|
|
343
459
|
---
|
|
344
460
|
|
|
@@ -347,15 +463,15 @@ Currently available presets:
|
|
|
347
463
|
Presets can be combined:
|
|
348
464
|
|
|
349
465
|
```bash
|
|
350
|
-
|
|
466
|
+
zora 32 --charset @letters@digits
|
|
351
467
|
```
|
|
352
468
|
|
|
353
469
|
This creates an alphanumeric character set.
|
|
354
470
|
|
|
355
|
-
Multiple presets can be combined:
|
|
471
|
+
Multiple presets can also be combined:
|
|
356
472
|
|
|
357
473
|
```bash
|
|
358
|
-
|
|
474
|
+
zora 32 --charset @upper@lower@digits
|
|
359
475
|
```
|
|
360
476
|
|
|
361
477
|
Duplicate characters are automatically removed.
|
|
@@ -368,6 +484,12 @@ For example:
|
|
|
368
484
|
|
|
369
485
|
does not contain uppercase characters twice.
|
|
370
486
|
|
|
487
|
+
The short `-x` form can be used as well:
|
|
488
|
+
|
|
489
|
+
```bash
|
|
490
|
+
zora 32 -x @upper@lower@digits
|
|
491
|
+
```
|
|
492
|
+
|
|
371
493
|
---
|
|
372
494
|
|
|
373
495
|
## Custom characters
|
|
@@ -377,7 +499,7 @@ Literal characters can be included alongside presets.
|
|
|
377
499
|
For example:
|
|
378
500
|
|
|
379
501
|
```bash
|
|
380
|
-
|
|
502
|
+
zora 32 --charset @hexXYZ
|
|
381
503
|
```
|
|
382
504
|
|
|
383
505
|
This means:
|
|
@@ -389,7 +511,7 @@ This means:
|
|
|
389
511
|
Another example:
|
|
390
512
|
|
|
391
513
|
```bash
|
|
392
|
-
|
|
514
|
+
zora 32 --charset XYZ@hex
|
|
393
515
|
```
|
|
394
516
|
|
|
395
517
|
means:
|
|
@@ -398,56 +520,55 @@ means:
|
|
|
398
520
|
X + Y + Z + @hex
|
|
399
521
|
```
|
|
400
522
|
|
|
401
|
-
This allows arbitrary character sets without
|
|
523
|
+
This allows arbitrary character sets without requiring a new preset.
|
|
402
524
|
|
|
403
525
|
---
|
|
404
526
|
|
|
405
|
-
|
|
527
|
+
## `--charset-list`
|
|
406
528
|
|
|
407
|
-
Display
|
|
529
|
+
Display all available charset presets:
|
|
408
530
|
|
|
409
531
|
```bash
|
|
410
|
-
|
|
532
|
+
zora --charset-list
|
|
411
533
|
```
|
|
412
534
|
|
|
535
|
+
The output includes the preset name and its characters.
|
|
536
|
+
|
|
413
537
|
Example:
|
|
414
538
|
|
|
415
539
|
```text
|
|
416
540
|
Available charsets:
|
|
417
|
-
|
|
418
|
-
@
|
|
419
|
-
@
|
|
420
|
-
@
|
|
421
|
-
|
|
422
|
-
@hex
|
|
423
|
-
@oct
|
|
424
|
-
@bin
|
|
425
|
-
@special
|
|
541
|
+
@digits = 0123456789
|
|
542
|
+
@letters = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
|
|
543
|
+
@lower = abcdefghijklmnopqrstuvwxyz
|
|
544
|
+
@upper = ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
|
545
|
+
...
|
|
426
546
|
|
|
427
547
|
Use as:
|
|
428
|
-
|
|
429
548
|
zora --charset @digits
|
|
430
549
|
zora --charset @letters@digits
|
|
431
550
|
zora --charset @hexXYZ
|
|
432
551
|
```
|
|
433
552
|
|
|
553
|
+
This mode exits immediately after displaying the available presets.
|
|
554
|
+
|
|
434
555
|
---
|
|
435
556
|
|
|
436
557
|
# Multiple keys
|
|
437
558
|
|
|
438
|
-
Use `-n` or `--count
|
|
559
|
+
Use `-n` or `--count` to generate multiple keys:
|
|
439
560
|
|
|
440
561
|
```bash
|
|
441
|
-
|
|
562
|
+
zora 32 --count 10
|
|
442
563
|
```
|
|
443
564
|
|
|
444
565
|
or:
|
|
445
566
|
|
|
446
567
|
```bash
|
|
447
|
-
|
|
568
|
+
zora 32 -n 10
|
|
448
569
|
```
|
|
449
570
|
|
|
450
|
-
|
|
571
|
+
Each key is generated independently.
|
|
451
572
|
|
|
452
573
|
When using the secure default generator, each key is generated using the
|
|
453
574
|
cryptographically secure random generator.
|
|
@@ -459,7 +580,7 @@ cryptographically secure random generator.
|
|
|
459
580
|
Add a prefix:
|
|
460
581
|
|
|
461
582
|
```bash
|
|
462
|
-
|
|
583
|
+
zora 32 --prefix "AUTH_"
|
|
463
584
|
```
|
|
464
585
|
|
|
465
586
|
Example:
|
|
@@ -471,13 +592,13 @@ AUTH_GxKqTnJpYwRzLhBcVfQmNsXeUaPkTdWr
|
|
|
471
592
|
Add a suffix:
|
|
472
593
|
|
|
473
594
|
```bash
|
|
474
|
-
|
|
595
|
+
zora 32 --suffix "_KEY"
|
|
475
596
|
```
|
|
476
597
|
|
|
477
598
|
Both can be used together:
|
|
478
599
|
|
|
479
600
|
```bash
|
|
480
|
-
|
|
601
|
+
zora 32 --prefix "AUTH_" --suffix "_KEY"
|
|
481
602
|
```
|
|
482
603
|
|
|
483
604
|
> Prefixes and suffixes are not random and therefore do not contribute to
|
|
@@ -492,7 +613,7 @@ Use `--group` to insert a separator every N characters.
|
|
|
492
613
|
For example:
|
|
493
614
|
|
|
494
615
|
```bash
|
|
495
|
-
|
|
616
|
+
zora 32 --group 4
|
|
496
617
|
```
|
|
497
618
|
|
|
498
619
|
Output:
|
|
@@ -510,7 +631,7 @@ The default separator is:
|
|
|
510
631
|
Use `--sep` to change it:
|
|
511
632
|
|
|
512
633
|
```bash
|
|
513
|
-
|
|
634
|
+
zora 32 --group 4 --sep ":"
|
|
514
635
|
```
|
|
515
636
|
|
|
516
637
|
Output:
|
|
@@ -524,24 +645,96 @@ entropy.
|
|
|
524
645
|
|
|
525
646
|
---
|
|
526
647
|
|
|
527
|
-
#
|
|
648
|
+
# Output formats
|
|
649
|
+
|
|
650
|
+
Zora supports multiple output formats through `--format`.
|
|
651
|
+
|
|
652
|
+
Available formats:
|
|
653
|
+
|
|
654
|
+
* `text`
|
|
655
|
+
* `json`
|
|
656
|
+
* `csv`
|
|
657
|
+
* `xml`
|
|
658
|
+
* `yml`
|
|
659
|
+
|
|
660
|
+
The default format is `text`.
|
|
528
661
|
|
|
529
|
-
|
|
662
|
+
## Text
|
|
530
663
|
|
|
531
664
|
```bash
|
|
532
|
-
|
|
665
|
+
zora 32 --format text
|
|
533
666
|
```
|
|
534
667
|
|
|
535
|
-
|
|
668
|
+
This is the default output format.
|
|
669
|
+
|
|
670
|
+
## JSON
|
|
671
|
+
|
|
672
|
+
```bash
|
|
673
|
+
zora 32 -n 3 --format json
|
|
674
|
+
```
|
|
536
675
|
|
|
537
676
|
Example:
|
|
538
677
|
|
|
539
|
-
```
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
678
|
+
```json
|
|
679
|
+
{
|
|
680
|
+
"keys": [
|
|
681
|
+
"GxKqTnJpYwRzLhBcVfQmNsXeUaPkTdWr",
|
|
682
|
+
"...",
|
|
683
|
+
"..."
|
|
684
|
+
]
|
|
685
|
+
}
|
|
686
|
+
```
|
|
687
|
+
|
|
688
|
+
## CSV
|
|
689
|
+
|
|
690
|
+
```bash
|
|
691
|
+
zora 32 -n 3 --format csv
|
|
692
|
+
```
|
|
693
|
+
|
|
694
|
+
The generated CSV contains a `key` column.
|
|
695
|
+
|
|
696
|
+
## XML
|
|
697
|
+
|
|
698
|
+
```bash
|
|
699
|
+
zora 32 -n 3 --format xml
|
|
543
700
|
```
|
|
544
701
|
|
|
702
|
+
## YAML
|
|
703
|
+
|
|
704
|
+
```bash
|
|
705
|
+
zora 32 -n 3 --format yml
|
|
706
|
+
```
|
|
707
|
+
|
|
708
|
+
YAML output requires PyYAML:
|
|
709
|
+
|
|
710
|
+
```bash
|
|
711
|
+
pip install pyyaml
|
|
712
|
+
```
|
|
713
|
+
|
|
714
|
+
---
|
|
715
|
+
|
|
716
|
+
# File output
|
|
717
|
+
|
|
718
|
+
Use `-o` or `--output` to write generated output to a file:
|
|
719
|
+
|
|
720
|
+
```bash
|
|
721
|
+
zora 32 -n 10 --output keys.txt
|
|
722
|
+
```
|
|
723
|
+
|
|
724
|
+
The output format can be selected independently:
|
|
725
|
+
|
|
726
|
+
```bash
|
|
727
|
+
zora 32 -n 10 --format json -o keys.json
|
|
728
|
+
```
|
|
729
|
+
|
|
730
|
+
```bash
|
|
731
|
+
zora 32 -n 10 --format csv -o keys.csv
|
|
732
|
+
```
|
|
733
|
+
|
|
734
|
+
Generated files use UTF-8 encoding.
|
|
735
|
+
|
|
736
|
+
Text-based CLI output uses a conventional final newline.
|
|
737
|
+
|
|
545
738
|
---
|
|
546
739
|
|
|
547
740
|
# Secure generation
|
|
@@ -552,7 +745,7 @@ This is the recommended mode when generating authentication tokens,
|
|
|
552
745
|
API keys, secrets, or other security-sensitive random values.
|
|
553
746
|
|
|
554
747
|
```bash
|
|
555
|
-
|
|
748
|
+
zora 32
|
|
556
749
|
```
|
|
557
750
|
|
|
558
751
|
The output will report:
|
|
@@ -568,7 +761,7 @@ Generator: CSPRNG
|
|
|
568
761
|
Use:
|
|
569
762
|
|
|
570
763
|
```bash
|
|
571
|
-
|
|
764
|
+
zora 32 --unsafe
|
|
572
765
|
```
|
|
573
766
|
|
|
574
767
|
to use Python's normal pseudo-random number generator instead of the
|
|
@@ -603,7 +796,7 @@ This is intentional.
|
|
|
603
796
|
The following will fail:
|
|
604
797
|
|
|
605
798
|
```bash
|
|
606
|
-
|
|
799
|
+
zora 32 --seed example
|
|
607
800
|
```
|
|
608
801
|
|
|
609
802
|
because Zora's secure generator should not be made deterministic through
|
|
@@ -612,7 +805,7 @@ the normal CLI.
|
|
|
612
805
|
Instead:
|
|
613
806
|
|
|
614
807
|
```bash
|
|
615
|
-
|
|
808
|
+
zora 32 --unsafe --seed example
|
|
616
809
|
```
|
|
617
810
|
|
|
618
811
|
A seed can be useful for testing reproducibility.
|
|
@@ -620,7 +813,7 @@ A seed can be useful for testing reproducibility.
|
|
|
620
813
|
For example:
|
|
621
814
|
|
|
622
815
|
```bash
|
|
623
|
-
|
|
816
|
+
zora 32 --unsafe --seed test
|
|
624
817
|
```
|
|
625
818
|
|
|
626
819
|
will produce the same deterministic sequence when run with the same
|
|
@@ -631,12 +824,51 @@ rather than being reseeded for every key.
|
|
|
631
824
|
|
|
632
825
|
---
|
|
633
826
|
|
|
827
|
+
# Benchmarking
|
|
828
|
+
|
|
829
|
+
Use `--benchmark` to benchmark key generation:
|
|
830
|
+
|
|
831
|
+
```bash
|
|
832
|
+
zora 32 --benchmark
|
|
833
|
+
```
|
|
834
|
+
|
|
835
|
+
The benchmark reports:
|
|
836
|
+
|
|
837
|
+
* Generator
|
|
838
|
+
* Key length
|
|
839
|
+
* Number of keys
|
|
840
|
+
* Charset size
|
|
841
|
+
* Total characters generated
|
|
842
|
+
* Keys per second
|
|
843
|
+
* Characters per second
|
|
844
|
+
|
|
845
|
+
Example:
|
|
846
|
+
|
|
847
|
+
```text
|
|
848
|
+
Zora Benchmark
|
|
849
|
+
────────────────────────────────
|
|
850
|
+
Generator: CSPRNG
|
|
851
|
+
Length: 32
|
|
852
|
+
Count: 1
|
|
853
|
+
Charset: 52
|
|
854
|
+
Characters: 32
|
|
855
|
+
Keys/sec: ...
|
|
856
|
+
Characters/sec: ...
|
|
857
|
+
```
|
|
858
|
+
|
|
859
|
+
Benchmarking does not produce normal key output.
|
|
860
|
+
|
|
861
|
+
The benchmark respects `--unsafe`, `--seed`, `--count`, and the selected
|
|
862
|
+
charset.
|
|
863
|
+
|
|
864
|
+
---
|
|
865
|
+
|
|
634
866
|
# Quiet mode
|
|
635
867
|
|
|
636
868
|
Use `-q` or `--quiet` to suppress non-essential output:
|
|
637
869
|
|
|
638
870
|
```bash
|
|
639
|
-
|
|
871
|
+
zora 32 --quiet
|
|
640
872
|
```
|
|
641
873
|
|
|
642
874
|
This is useful when using Zora inside scripts or shell pipelines.
|
|
@@ -644,28 +876,34 @@ This is useful when using Zora inside scripts or shell pipelines.
|
|
|
644
876
|
For example:
|
|
645
877
|
|
|
646
878
|
```bash
|
|
647
|
-
|
|
879
|
+
zora 32 --quiet > key.txt
|
|
648
880
|
```
|
|
649
881
|
|
|
882
|
+
Quiet mode suppresses the timer, entropy, strength, generator information,
|
|
883
|
+
and update notification.
|
|
884
|
+
|
|
650
885
|
---
|
|
651
886
|
|
|
652
887
|
# Entropy
|
|
653
888
|
|
|
654
|
-
Zora calculates the theoretical entropy of the random portion of the
|
|
655
|
-
key.
|
|
889
|
+
Zora calculates the theoretical entropy of the random portion of the key.
|
|
656
890
|
|
|
657
891
|
The formula is:
|
|
658
892
|
|
|
659
|
-
|
|
893
|
+
```text
|
|
894
|
+
entropy = length × log₂(charset size)
|
|
895
|
+
```
|
|
660
896
|
|
|
661
897
|
For example, using 52 possible characters:
|
|
662
898
|
|
|
663
|
-
|
|
899
|
+
```text
|
|
900
|
+
32 × log₂(52)
|
|
901
|
+
```
|
|
664
902
|
|
|
665
903
|
produces approximately:
|
|
666
904
|
|
|
667
905
|
```text
|
|
668
|
-
182.
|
|
906
|
+
182.41 bits
|
|
669
907
|
```
|
|
670
908
|
|
|
671
909
|
The entropy calculation only considers random characters.
|
|
@@ -676,13 +914,13 @@ entropy.
|
|
|
676
914
|
For example:
|
|
677
915
|
|
|
678
916
|
```bash
|
|
679
|
-
|
|
917
|
+
zora 32 --prefix "AUTH_"
|
|
680
918
|
```
|
|
681
919
|
|
|
682
920
|
has the same theoretical entropy as:
|
|
683
921
|
|
|
684
922
|
```bash
|
|
685
|
-
|
|
923
|
+
zora 32
|
|
686
924
|
```
|
|
687
925
|
|
|
688
926
|
assuming the same charset and length.
|
|
@@ -720,108 +958,157 @@ PRNG
|
|
|
720
958
|
|
|
721
959
|
---
|
|
722
960
|
|
|
961
|
+
# Argument validation
|
|
962
|
+
|
|
963
|
+
Zora validates command-line arguments before generating keys.
|
|
964
|
+
|
|
965
|
+
Examples of invalid arguments include:
|
|
966
|
+
|
|
967
|
+
* A key length of `0` or less
|
|
968
|
+
* A key length missing when generation is requested
|
|
969
|
+
* A `--group` value greater than the key length
|
|
970
|
+
* Using `--seed` without `--unsafe`
|
|
971
|
+
* An unknown charset preset
|
|
972
|
+
* An empty final charset
|
|
973
|
+
* A charset containing fewer than two unique characters
|
|
974
|
+
|
|
975
|
+
Invalid arguments result in a clear command-line error instead of
|
|
976
|
+
attempting to generate invalid output.
|
|
977
|
+
|
|
978
|
+
---
|
|
979
|
+
|
|
723
980
|
# Example commands
|
|
724
981
|
|
|
725
982
|
### Basic key
|
|
726
983
|
|
|
727
984
|
```bash
|
|
728
|
-
|
|
985
|
+
zora 32
|
|
729
986
|
```
|
|
730
987
|
|
|
731
988
|
### Digits only
|
|
732
989
|
|
|
733
990
|
```bash
|
|
734
|
-
|
|
991
|
+
zora 32 -x @digits
|
|
735
992
|
```
|
|
736
993
|
|
|
737
994
|
### Lowercase only
|
|
738
995
|
|
|
739
996
|
```bash
|
|
740
|
-
|
|
997
|
+
zora 32 -x @lower
|
|
741
998
|
```
|
|
742
999
|
|
|
743
1000
|
### Uppercase only
|
|
744
1001
|
|
|
745
1002
|
```bash
|
|
746
|
-
|
|
1003
|
+
zora 32 -x @upper
|
|
747
1004
|
```
|
|
748
1005
|
|
|
749
1006
|
### Alphanumeric
|
|
750
1007
|
|
|
751
1008
|
```bash
|
|
752
|
-
|
|
1009
|
+
zora 32 -x @letters@digits
|
|
753
1010
|
```
|
|
754
1011
|
|
|
755
1012
|
### Hexadecimal
|
|
756
1013
|
|
|
757
1014
|
```bash
|
|
758
|
-
|
|
1015
|
+
zora 32 -x @hex
|
|
759
1016
|
```
|
|
760
1017
|
|
|
761
1018
|
### Hexadecimal plus custom characters
|
|
762
1019
|
|
|
763
1020
|
```bash
|
|
764
|
-
|
|
1021
|
+
zora 32 -x @hexXYZ
|
|
765
1022
|
```
|
|
766
1023
|
|
|
767
1024
|
### Uppercase, lowercase and digits
|
|
768
1025
|
|
|
769
1026
|
```bash
|
|
770
|
-
|
|
1027
|
+
zora 32 -x @upper@lower@digits
|
|
1028
|
+
```
|
|
1029
|
+
|
|
1030
|
+
### Human-friendly digits
|
|
1031
|
+
|
|
1032
|
+
```bash
|
|
1033
|
+
zora 32 -x @digitssafe
|
|
771
1034
|
```
|
|
772
1035
|
|
|
773
1036
|
### Symbols
|
|
774
1037
|
|
|
775
1038
|
```bash
|
|
776
|
-
|
|
1039
|
+
zora 32 -x @symbols
|
|
777
1040
|
```
|
|
778
1041
|
|
|
779
1042
|
### Group the output
|
|
780
1043
|
|
|
781
1044
|
```bash
|
|
782
|
-
|
|
1045
|
+
zora 32 --group 4
|
|
783
1046
|
```
|
|
784
1047
|
|
|
785
1048
|
### Custom separator
|
|
786
1049
|
|
|
787
1050
|
```bash
|
|
788
|
-
|
|
1051
|
+
zora 32 --group 4 --sep ":"
|
|
789
1052
|
```
|
|
790
1053
|
|
|
791
1054
|
### Generate multiple keys
|
|
792
1055
|
|
|
793
1056
|
```bash
|
|
794
|
-
|
|
1057
|
+
zora 32 -n 10
|
|
795
1058
|
```
|
|
796
1059
|
|
|
797
1060
|
### Save to a file
|
|
798
1061
|
|
|
799
1062
|
```bash
|
|
800
|
-
|
|
1063
|
+
zora 32 -n 100 -o keys.txt
|
|
1064
|
+
```
|
|
1065
|
+
|
|
1066
|
+
### JSON output
|
|
1067
|
+
|
|
1068
|
+
```bash
|
|
1069
|
+
zora 32 -n 10 --format json
|
|
1070
|
+
```
|
|
1071
|
+
|
|
1072
|
+
### Benchmark
|
|
1073
|
+
|
|
1074
|
+
```bash
|
|
1075
|
+
zora 32 --benchmark
|
|
1076
|
+
```
|
|
1077
|
+
|
|
1078
|
+
### Show available charsets
|
|
1079
|
+
|
|
1080
|
+
```bash
|
|
1081
|
+
zora --charset-list
|
|
1082
|
+
```
|
|
1083
|
+
|
|
1084
|
+
### Show version
|
|
1085
|
+
|
|
1086
|
+
```bash
|
|
1087
|
+
zora --version
|
|
801
1088
|
```
|
|
802
1089
|
|
|
803
1090
|
### Prefix
|
|
804
1091
|
|
|
805
1092
|
```bash
|
|
806
|
-
|
|
1093
|
+
zora 32 --prefix "AUTH_"
|
|
807
1094
|
```
|
|
808
1095
|
|
|
809
1096
|
### Secure generation
|
|
810
1097
|
|
|
811
1098
|
```bash
|
|
812
|
-
|
|
1099
|
+
zora 32
|
|
813
1100
|
```
|
|
814
1101
|
|
|
815
1102
|
### Reproducible testing
|
|
816
1103
|
|
|
817
1104
|
```bash
|
|
818
|
-
|
|
1105
|
+
zora 32 --unsafe --seed test
|
|
819
1106
|
```
|
|
820
1107
|
|
|
821
1108
|
### Quiet output
|
|
822
1109
|
|
|
823
1110
|
```bash
|
|
824
|
-
|
|
1111
|
+
zora 32 --quiet
|
|
825
1112
|
```
|
|
826
1113
|
|
|
827
1114
|
---
|
|
@@ -881,7 +1168,9 @@ random output space.
|
|
|
881
1168
|
For example, a 32-character key selected uniformly from 62 possible
|
|
882
1169
|
characters has:
|
|
883
1170
|
|
|
884
|
-
|
|
1171
|
+
```text
|
|
1172
|
+
32 × log₂(62)
|
|
1173
|
+
```
|
|
885
1174
|
|
|
886
1175
|
bits of theoretical entropy.
|
|
887
1176
|
|
|
@@ -890,7 +1179,7 @@ However, entropy alone does not prove that a generator is secure.
|
|
|
890
1179
|
For example:
|
|
891
1180
|
|
|
892
1181
|
```bash
|
|
893
|
-
|
|
1182
|
+
zora 32 --unsafe
|
|
894
1183
|
```
|
|
895
1184
|
|
|
896
1185
|
can still report a high entropy value because the theoretical output
|
|
@@ -902,8 +1191,8 @@ The generator is nevertheless explicitly marked:
|
|
|
902
1191
|
Generator: PRNG
|
|
903
1192
|
```
|
|
904
1193
|
|
|
905
|
-
and the entropy
|
|
906
|
-
used.
|
|
1194
|
+
and the entropy and strength display is visually marked when `--unsafe`
|
|
1195
|
+
is used.
|
|
907
1196
|
|
|
908
1197
|
---
|
|
909
1198
|
|
|
@@ -925,42 +1214,33 @@ pip install -r requirements.txt
|
|
|
925
1214
|
Run:
|
|
926
1215
|
|
|
927
1216
|
```bash
|
|
928
|
-
|
|
1217
|
+
zora 32
|
|
929
1218
|
```
|
|
930
1219
|
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
# Project structure
|
|
934
|
-
|
|
935
|
-
A minimal installation currently looks like:
|
|
1220
|
+
For YAML output, install PyYAML:
|
|
936
1221
|
|
|
937
|
-
```
|
|
938
|
-
|
|
939
|
-
├── zora.py
|
|
940
|
-
├── zora.jpg
|
|
941
|
-
├── LICENSE
|
|
942
|
-
├── README.md
|
|
943
|
-
└── requirements.txt
|
|
1222
|
+
```bash
|
|
1223
|
+
pip install pyyaml
|
|
944
1224
|
```
|
|
945
1225
|
|
|
946
|
-
Future versions may introduce a package structure and automated tests.
|
|
947
|
-
|
|
948
1226
|
---
|
|
949
1227
|
|
|
950
1228
|
# Roadmap
|
|
951
1229
|
|
|
952
1230
|
Possible future improvements include:
|
|
953
1231
|
|
|
954
|
-
* [
|
|
955
|
-
* [
|
|
956
|
-
* [
|
|
1232
|
+
* [x] More charset presets
|
|
1233
|
+
* [x] Improved documentation
|
|
1234
|
+
* [x] Installation through `pip`
|
|
1235
|
+
* [x] Packaging with `pyproject.toml`
|
|
1236
|
+
* [x] Better charset parsing errors
|
|
1237
|
+
* [x] Multiple output formats
|
|
1238
|
+
* [x] Benchmarking mode
|
|
1239
|
+
* [x] Version information
|
|
1240
|
+
* [x] Argument validation
|
|
1241
|
+
* [x] Automated test suite
|
|
957
1242
|
* [ ] Configuration files
|
|
958
|
-
* [ ] Packaging with `pyproject.toml`
|
|
959
|
-
* [ ] Installation through `pip`
|
|
960
1243
|
* [ ] Shell completion
|
|
961
|
-
* [ ] More output formats
|
|
962
|
-
* [ ] Benchmarking mode
|
|
963
|
-
* [ ] Improved documentation
|
|
964
1244
|
* [ ] Cross-platform terminal improvements
|
|
965
1245
|
* [ ] API/library usage
|
|
966
1246
|
* [ ] More extensive security testing
|
|
@@ -980,7 +1260,7 @@ MAJOR.MINOR.PATCH
|
|
|
980
1260
|
For example:
|
|
981
1261
|
|
|
982
1262
|
```text
|
|
983
|
-
v0.
|
|
1263
|
+
v0.2.0
|
|
984
1264
|
```
|
|
985
1265
|
|
|
986
1266
|
The `0.x` versions indicate that the CLI and features may still change
|