@sebastienrousseau/crypto-cli 0.0.1 → 0.0.8

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 (91) hide show
  1. package/README.md +228 -235
  2. package/dist/cli.js +67 -1
  3. package/dist/commands/decrypt.command.d.ts.map +1 -1
  4. package/dist/commands/decrypt.command.js +3 -4
  5. package/dist/commands/encrypt.command.d.ts.map +1 -1
  6. package/dist/commands/encrypt.command.js +2 -3
  7. package/dist/commands/generate.command.d.ts.map +1 -1
  8. package/dist/commands/generate.command.js +24 -25
  9. package/dist/commands/help.command.d.ts.map +1 -1
  10. package/dist/commands/index.d.ts +6 -0
  11. package/dist/commands/index.d.ts.map +1 -1
  12. package/dist/commands/index.js +7 -0
  13. package/dist/commands/modern/cbom.command.d.ts +10 -0
  14. package/dist/commands/modern/cbom.command.d.ts.map +1 -0
  15. package/dist/commands/modern/cbom.command.js +164 -0
  16. package/dist/commands/modern/encrypt.command.d.ts +3 -0
  17. package/dist/commands/modern/encrypt.command.d.ts.map +1 -0
  18. package/dist/commands/modern/encrypt.command.js +125 -0
  19. package/dist/commands/modern/hash.command.d.ts +3 -0
  20. package/dist/commands/modern/hash.command.d.ts.map +1 -0
  21. package/dist/commands/modern/hash.command.js +91 -0
  22. package/dist/commands/modern/index.d.ts +9 -0
  23. package/dist/commands/modern/index.d.ts.map +1 -0
  24. package/dist/commands/modern/index.js +21 -0
  25. package/dist/commands/modern/keygen.command.d.ts +3 -0
  26. package/dist/commands/modern/keygen.command.d.ts.map +1 -0
  27. package/dist/commands/modern/keygen.command.js +113 -0
  28. package/dist/commands/modern/password-hash.command.d.ts +3 -0
  29. package/dist/commands/modern/password-hash.command.d.ts.map +1 -0
  30. package/dist/commands/modern/password-hash.command.js +106 -0
  31. package/dist/commands/modern/sign.command.d.ts +3 -0
  32. package/dist/commands/modern/sign.command.d.ts.map +1 -0
  33. package/dist/commands/modern/sign.command.js +135 -0
  34. package/dist/commands/reformat.command.d.ts.map +1 -1
  35. package/dist/commands/reformat.command.js +2 -3
  36. package/dist/commands/revoke.command.d.ts.map +1 -1
  37. package/dist/commands/revoke.command.js +2 -3
  38. package/dist/commands/session.command.d.ts.map +1 -1
  39. package/dist/commands/session.command.js +2 -3
  40. package/dist/commands/sign.command.d.ts.map +1 -1
  41. package/dist/commands/sign.command.js +2 -3
  42. package/dist/commands/verify.command.d.ts.map +1 -1
  43. package/dist/commands/verify.command.js +12 -13
  44. package/dist/constants/en.d.ts.map +1 -1
  45. package/dist/constants/en.js +87 -87
  46. package/dist/constants/fr.d.ts +1 -1
  47. package/dist/constants/fr.d.ts.map +1 -1
  48. package/dist/constants/fr.js +24 -24
  49. package/dist/constants/index.d.ts +4 -2
  50. package/dist/constants/index.d.ts.map +1 -1
  51. package/dist/constants/index.js +25 -20
  52. package/dist/helpers/banner.d.ts +1 -1
  53. package/dist/helpers/banner.d.ts.map +1 -1
  54. package/dist/utils/version.utils.d.ts.map +1 -1
  55. package/dist/utils/write.utils.d.ts.map +1 -1
  56. package/dist/utils/write.utils.js +1 -1
  57. package/package.json +123 -126
  58. package/dist/.DS_Store +0 -0
  59. package/dist/COPYRIGHT +0 -15
  60. package/dist/Makefile +0 -122
  61. package/dist/Report.txt +0 -176
  62. package/dist/cli.js.map +0 -1
  63. package/dist/commands/decrypt.command.js.map +0 -1
  64. package/dist/commands/encrypt.command.js.map +0 -1
  65. package/dist/commands/generate.command.js.map +0 -1
  66. package/dist/commands/help.command.js.map +0 -1
  67. package/dist/commands/index.js.map +0 -1
  68. package/dist/commands/reformat.command.js.map +0 -1
  69. package/dist/commands/revoke.command.js.map +0 -1
  70. package/dist/commands/session.command.js.map +0 -1
  71. package/dist/commands/sign.command.js.map +0 -1
  72. package/dist/commands/verify.command.js.map +0 -1
  73. package/dist/constants/en.js.map +0 -1
  74. package/dist/constants/fr.js.map +0 -1
  75. package/dist/constants/index.js.map +0 -1
  76. package/dist/helpers/banner.js.map +0 -1
  77. package/dist/key/key.d.ts +0 -17
  78. package/dist/key/key.d.ts.map +0 -1
  79. package/dist/key/key.js +0 -19
  80. package/dist/key/key.js.map +0 -1
  81. package/dist/key/rsa-reformat.cert +0 -1
  82. package/dist/key/rsa-reformat.key +0 -1
  83. package/dist/key/rsa-reformat.pub +0 -1
  84. package/dist/key/rsa-revoke.key +0 -1
  85. package/dist/key/rsa-revoke.pub +0 -1
  86. package/dist/key/rsa.cert +0 -1
  87. package/dist/key/rsa.key +0 -1
  88. package/dist/key/rsa.pub +0 -1
  89. package/dist/package.json +0 -129
  90. package/dist/utils/version.utils.js.map +0 -1
  91. package/dist/utils/write.utils.js.map +0 -1
package/README.md CHANGED
@@ -1,274 +1,267 @@
1
- # āÆ Crypto CLI
1
+ <!-- SPDX-License-Identifier: Apache-2.0 OR MIT -->
2
2
 
3
- ![Banner representing the Crypto Command Line Interface (CLI)](https://raw.githubusercontent.com/sebastienrousseau/crypto-service/master/assets/crypto-cli-logo.svg)
3
+ <p align="center">
4
+ <img src="https://raw.githubusercontent.com/sebastienrousseau/crypto-service/main/assets/crypto-cli-logo.svg" alt="crypto-cli logo" width="360" />
5
+ </p>
4
6
 
5
- [![NPM Version](https://img.shields.io/npm/v/solid-js.svg?style=for-the-badge)](https://www.npmjs.com/package/@sebastienrousseau/crypto-cli)
6
- [![Coverage Status](https://img.shields.io/coveralls/github/sebastienrousseau/crypto-service/solid.svg?branch=main&style=for-the-badge\&color=blueviolet)](https://coveralls.io/github/sebastienrousseau/crypto-service?branch=main)
7
- [![Maintained with Lerna](https://img.shields.io/badge/maintained%20with-lerna-blue?style=for-the-badge)](https://lerna.js.org/)
8
- [![License](https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge&logo=)](https://opensource.org/licenses/MIT)
9
- ![Made with Love](https://raw.githubusercontent.com/sebastienrousseau/crypto-service/master/assets/made-with-love.svg)
7
+ <h1 align="center">@sebastienrousseau/crypto-cli</h1>
10
8
 
11
- **[Website](https://cryptocli.io) • [Documentation](https://cryptocli.io/docs/)
12
- • [Submit an Issue](https://github.com/sebastienrousseau/crypto-service/issues)
13
- • [Contributing Guidelines](https://github.com/sebastienrousseau/crypto-service/blob/master/.github/CONTRIBUTING.md)**
9
+ <p align="center">
10
+ An interactive command-line interface for cryptographic operations, supporting both legacy OpenPGP and modern post-quantum algorithms.
11
+ </p>
14
12
 
15
- ***
16
-
17
- ## šŸ‘‹ Welcome to Crypto CLI
18
-
19
- Crypto CLI is a simple, yet powerful, command line interface that can be used to
20
- perform common cryptographic operations from the command prompt or terminal.
21
-
22
- ![Crypto CLI][crypto-cli]
23
-
24
- [![Getting Started][getting started]](#getting-started)
25
- [![Download Crypto CLI][download]][13]
26
-
27
- ![divider][divider]
28
-
29
- ## ✨ Key Features
30
-
31
- The cryptographic operations include:
32
-
33
- - Authentication via Digital Signature,
34
- - Confidentiality via Encryption and Decryption,
35
- - Compression,
36
- - Key Generation,
37
- - Key Management,
38
- - Pseudorandom Number Generation,
39
- - Signature Verification.
40
-
41
- This library is based on [OpenPGP.js][1] - a JavaScript implementation of the
42
- OpenPGP protocol. It implements [RFC4880][2] and parts of [RFC4880bis][3].
43
-
44
- Development of this library is hosted by [GitHub][4] at the [following page][5].
45
- Source code is available to everyone under the standard [MIT license][6].
46
-
47
- ![divider][divider]
48
-
49
- ## Getting Started
50
-
51
- šŸ‘‰ Note: Ā» Crypto CLI is a [Node.js][7] module available through the
52
- [npm registry][8]. Before installing, [download and install Node.js][7].
53
- Node.js 12.20.0 or or later.
54
-
55
- This allows you to always be on the latest version when we release new builds
56
- with automatic upgrades.
57
-
58
- ![divider][divider]
59
-
60
- ## šŸ”§ Installation
61
-
62
- The first step to using Crypto CLI is to download and install the
63
- application and other required components.
64
-
65
- 1ļøāƒ£ Install the Crypto CLI via [`npm`][8], [`yarn`][9] or [`pnpm`][10] package
66
- managers:
67
-
68
- - `npm i @sebastienrousseau/crypto-cli`
69
- - `yarn add @sebastienrousseau/crypto-cli`
70
- - `pnpm add @sebastienrousseau/crypto-cli`
71
-
72
- For users who are unable to install the Crypto CLI, released builds can be
73
- manually downloaded from this repository's
74
- [Releases page](https://github.com/sebastienrousseau/crypto-service/releases/).
75
-
76
- ### What's included
77
-
78
- Within the download you'll find all the crypto lib source files grouped into
79
- the *dist* folder.
80
-
81
- You'll see something like this:
82
-
83
- ```shell
84
- .
85
- ā”œā”€ā”€ COPYRIGHT
86
- ā”œā”€ā”€ Makefile
87
- ā”œā”€ā”€ Report.txt
88
- ā”œā”€ā”€ cli.d.ts
89
- ā”œā”€ā”€ cli.d.ts.map
90
- ā”œā”€ā”€ cli.js
91
- ā”œā”€ā”€ cli.js.map
92
- ā”œā”€ā”€ commands
93
- │   ā”œā”€ā”€ decrypt.command.d.ts
94
- │   ā”œā”€ā”€ decrypt.command.d.ts.map
95
- │   ā”œā”€ā”€ decrypt.command.js
96
- │   ā”œā”€ā”€ decrypt.command.js.map
97
- │   ā”œā”€ā”€ encrypt.command.d.ts
98
- │   ā”œā”€ā”€ encrypt.command.d.ts.map
99
- │   ā”œā”€ā”€ encrypt.command.js
100
- │   ā”œā”€ā”€ encrypt.command.js.map
101
- │   ā”œā”€ā”€ generate.command.d.ts
102
- │   ā”œā”€ā”€ generate.command.d.ts.map
103
- │   ā”œā”€ā”€ generate.command.js
104
- │   ā”œā”€ā”€ generate.command.js.map
105
- │   ā”œā”€ā”€ help.command.d.ts
106
- │   ā”œā”€ā”€ help.command.d.ts.map
107
- │   ā”œā”€ā”€ help.command.js
108
- │   ā”œā”€ā”€ help.command.js.map
109
- │   ā”œā”€ā”€ index.d.ts
110
- │   ā”œā”€ā”€ index.d.ts.map
111
- │   ā”œā”€ā”€ index.js
112
- │   ā”œā”€ā”€ index.js.map
113
- │   ā”œā”€ā”€ reformat.command.d.ts
114
- │   ā”œā”€ā”€ reformat.command.d.ts.map
115
- │   ā”œā”€ā”€ reformat.command.js
116
- │   ā”œā”€ā”€ reformat.command.js.map
117
- │   ā”œā”€ā”€ revoke.command.d.ts
118
- │   ā”œā”€ā”€ revoke.command.d.ts.map
119
- │   ā”œā”€ā”€ revoke.command.js
120
- │   ā”œā”€ā”€ revoke.command.js.map
121
- │   ā”œā”€ā”€ session.command.d.ts
122
- │   ā”œā”€ā”€ session.command.d.ts.map
123
- │   ā”œā”€ā”€ session.command.js
124
- │   ā”œā”€ā”€ session.command.js.map
125
- │   ā”œā”€ā”€ sign.command.d.ts
126
- │   ā”œā”€ā”€ sign.command.d.ts.map
127
- │   ā”œā”€ā”€ sign.command.js
128
- │   ā”œā”€ā”€ sign.command.js.map
129
- │   ā”œā”€ā”€ verify.command.d.ts
130
- │   ā”œā”€ā”€ verify.command.d.ts.map
131
- │   ā”œā”€ā”€ verify.command.js
132
- │   └── verify.command.js.map
133
- ā”œā”€ā”€ helpers
134
- │   ā”œā”€ā”€ banner.d.ts
135
- │   ā”œā”€ā”€ banner.d.ts.map
136
- │   ā”œā”€ā”€ banner.js
137
- │   └── banner.js.map
138
- ā”œā”€ā”€ key
139
- │   ā”œā”€ā”€ key.d.ts
140
- │   ā”œā”€ā”€ key.d.ts.map
141
- │   ā”œā”€ā”€ key.js
142
- │   ā”œā”€ā”€ key.js.map
143
- │   ā”œā”€ā”€ rsa-reformat.cert
144
- │   ā”œā”€ā”€ rsa-reformat.key
145
- │   ā”œā”€ā”€ rsa-reformat.pub
146
- │   ā”œā”€ā”€ rsa-revoke.key
147
- │   ā”œā”€ā”€ rsa-revoke.pub
148
- │   ā”œā”€ā”€ rsa.cert
149
- │   ā”œā”€ā”€ rsa.key
150
- │   └── rsa.pub
151
- ā”œā”€ā”€ package.json
152
- └── utils
153
- ā”œā”€ā”€ version.utils.d.ts
154
- ā”œā”€ā”€ version.utils.d.ts.map
155
- ā”œā”€ā”€ version.utils.js
156
- ā”œā”€ā”€ version.utils.js.map
157
- ā”œā”€ā”€ write.utils.d.ts
158
- ā”œā”€ā”€ write.utils.d.ts.map
159
- ā”œā”€ā”€ write.utils.js
160
- └── write.utils.js.map
161
-
162
- 4 directories, 72 files
13
+ <p align="center">
14
+ <a href="https://github.com/sebastienrousseau/crypto-service/actions"><img src="https://img.shields.io/github/actions/workflow/status/sebastienrousseau/crypto-service/ci.yml?branch=main&style=for-the-badge&logo=github" alt="Build" /></a>
15
+ <a href="https://coveralls.io/github/sebastienrousseau/crypto-service?branch=main"><img src="https://img.shields.io/coveralls/github/sebastienrousseau/crypto-service?branch=main&style=for-the-badge" alt="Coverage" /></a>
16
+ <a href="https://www.npmjs.com/package/@sebastienrousseau/crypto-cli"><img src="https://img.shields.io/npm/v/@sebastienrousseau/crypto-cli.svg?style=for-the-badge&color=f14041&logo=npm" alt="Registry" /></a>
17
+ <a href="https://sebastienrousseau.github.io/crypto-service/"><img src="https://img.shields.io/badge/docs-TypeDoc-blue.svg?style=for-the-badge&labelColor=555555&logo=typescript" alt="Docs" /></a>
18
+ <a href="https://scorecard.dev/viewer/?uri=github.com/sebastienrousseau/crypto-service" title="ossf-scorecard"><img src="https://img.shields.io/badge/OpenSSF-Scorecard-blue?style=for-the-badge&logo=openssf" alt="OpenSSF Scorecard" /></a>
19
+ <a href="https://github.com/sebastienrousseau/crypto-service/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0%20OR%20MIT-blue.svg?style=for-the-badge" alt="License: Apache-2.0 OR MIT" /></a>
20
+ <a href="https://github.com/sebastienrousseau/crypto-service/blob/main/docs/POLICIES.md"><img src="https://img.shields.io/badge/Node.js-%3E%3D22-93450a.svg?style=for-the-badge&logo=node.js" alt="Node.js 22 or newer" /></a>
21
+ </p>
163
22
 
23
+ ---
24
+
25
+ ## Contents
26
+
27
+ **Getting started**
28
+
29
+ - [Install](#install) — installation via pnpm, npm, or yarn
30
+ - [Requirements](#requirements) — runtime floor and environment prerequisites
31
+ - [Quick Start](#quick-start) — minimal working usage sample
32
+
33
+ **The Crypto Service ecosystem**
34
+
35
+ - [The Crypto Service ecosystem](#the-crypto-service-ecosystem) — full 14-package suite overview
36
+
37
+ **Package reference**
38
+
39
+ - [Reference & Usage](#overview) — features, configuration, and capabilities
40
+ - [Examples](#examples) — runnable sample code
41
+
42
+ **Operational**
43
+
44
+ - [Development](#development) — build, lint, format, and test targets
45
+ - [Security](#security) — vulnerability disclosure and cryptographic invariants
46
+ - [Documentation](#documentation) — TypeDoc API docs and ecosystem guides
47
+ - [Stability guarantees](#stability-guarantees) — SemVer axis and release policy
48
+ - [License](#license)
49
+
50
+ ---
51
+
52
+ ## Install
53
+
54
+ ```bash
55
+ pnpm add @sebastienrousseau/crypto-cli
56
+ # or
57
+ npm install @sebastienrousseau/crypto-cli
58
+ # or
59
+ yarn add @sebastienrousseau/crypto-cli
164
60
  ```
165
61
 
166
- 2ļøāƒ£ Set up your app
62
+ <p align="right"><a href="#contents">Back to Top</a></p>
63
+
64
+ ---
167
65
 
168
- You can get started with a simple app by running the following in your terminal:
66
+ ## Requirements
169
67
 
170
- ```shell
68
+ - **Node.js**: `^22.0.0` or `>=24.0.0` (active and maintenance LTS releases)
69
+ - **Package Manager**: `pnpm >=9` (recommended) or `npm >=10`
70
+ - **TypeScript**: `>=5.0` (when compiling with TypeScript)
171
71
 
172
- > mkdir my-app
173
- > cd my-app
174
- > yarn add @sebastienrousseau/crypto-cli -D
175
- > yarn start
72
+ <p align="right"><a href="#contents">Back to Top</a></p>
73
+
74
+ ---
75
+
76
+ ## Quick Start
77
+
78
+ Launch the interactive menu:
79
+
80
+ ```bash
81
+ cryptocli
82
+ ```
83
+
84
+ You will be presented with a selection prompt:
176
85
 
177
86
  ```
87
+ ? Select a function to execute.
88
+
89
+ Generate -- Generate a new OpenPGP key pair
90
+ Encrypt -- Encrypt a message (OpenPGP)
91
+ Decrypt -- Decrypt a message (OpenPGP)
92
+ Modern Keygen -- Generate keys (Ed25519, ML-DSA, ML-KEM, etc.)
93
+ Modern Hash -- Hash data (SHA-2, SHA-3, BLAKE2b, BLAKE3)
94
+ Modern Encrypt -- Encrypt (XChaCha20, AES-GCM, AES-GCM-SIV)
95
+ Modern Sign -- Sign/verify (Ed25519, ECDSA, Schnorr, ML-DSA)
96
+ Password Hash -- Hash/verify passwords (Argon2id/i/d)
97
+ Help -- Get help on a command
98
+ ```
99
+
100
+ Use arrow keys to navigate, then press Enter to select a command.
101
+
102
+ <p align="right"><a href="#contents">Back to Top</a></p>
103
+
104
+ ---
105
+
106
+ ## The Crypto Service ecosystem
107
+
108
+ Crypto Service provides a complete cryptography stack across 14 specialized packages:
178
109
 
179
- 3ļøāƒ£ Try it out and let us know what you think!
110
+ | Package | Role | Description |
111
+ | :-------------------------------------------------------------------- | :--------------- | :----------------------------------------------------------------------------------------------------------------------------------------- |
112
+ | [`@sebastienrousseau/crypto-api`](../crypto-api) | API Schemas | Shared TypeScript types and utilities for the Crypto Service Suite, defining the canonical API surface. |
113
+ | **[`@sebastienrousseau/crypto-cli`](../crypto-cli)** _(this package)_ | **Terminal CLI** | **An interactive command-line interface for cryptographic operations, supporting both legacy OpenPGP and modern post-quantum algorithms.** |
114
+ | [`@sebastienrousseau/crypto-edge`](../crypto-edge) | Edge Runtime | Edge-runtime cryptographic operations using the Web Crypto API, optimized for Cloudflare Workers, Vercel Edge, and Deno. |
115
+ | [`@sebastienrousseau/crypto-kms`](../crypto-kms) | Cloud KMS | Unified Key Management Service interface for AWS KMS, GCP Cloud KMS, Azure Key Vault, and HashiCorp Vault. |
116
+ | [`@sebastienrousseau/crypto-lib`](../crypto-lib) | Core Library | A modern cryptographic library for TypeScript, with post-quantum support, zero unsafe dependencies, and 100% test coverage. |
117
+ | [`@sebastienrousseau/crypto-middleware`](../crypto-middleware) | Middleware | Framework-agnostic cryptographic middleware for Express, Fastify, and Koa applications. |
118
+ | [`@sebastienrousseau/crypto-prisma`](../crypto-prisma) | ORM Adapter | Transparent field-level encryption extension for Prisma Client, using XChaCha20-Poly1305. |
119
+ | [`@sebastienrousseau/crypto-react`](../crypto-react) | React Hooks | React hooks and context provider for client-side cryptographic operations with zero boilerplate. |
120
+ | [`@sebastienrousseau/crypto-sdk`](../crypto-sdk) | Client SDK | A zero-dependency, typed HTTP client for the Crypto Service REST API, with full post-quantum support. |
121
+ | [`@sebastienrousseau/crypto-server`](../crypto-server) | HTTP API | A hardened Fastify REST API for cryptographic operations, with rate limiting, OpenAPI schemas, and post-quantum endpoints. |
122
+ | [`@sebastienrousseau/crypto-testing`](../crypto-testing) | Test Support | Deterministic keys, fast mocks, and test fixtures for crypto-lib |
123
+ | [`@sebastienrousseau/crypto-typeorm`](../crypto-typeorm) | ORM Adapter | TypeORM column-level encryption with a single decorator, powered by crypto-lib. |
124
+ | [`@sebastienrousseau/crypto-vue`](../crypto-vue) | Vue Composables | Vue 3 composables for client-side cryptography |
125
+ | [`@sebastienrousseau/crypto-wasm`](../crypto-wasm) | Acceleration | WebAssembly performance accelerator for crypto-lib |
180
126
 
181
- ![divider][divider]
127
+ <p align="right"><a href="#contents">Back to Top</a></p>
182
128
 
183
- ## āÆ Crypto Command Line Interface (CLI) syntax
129
+ ---
184
130
 
185
- The Crypto CLI accepts multiple types of options. Options are a list of flags
186
- and other parameters that can control the behavior of the Crypto CLI as a
187
- whole.
131
+ ## Overview
188
132
 
189
- Below is the full list of supported options for the Crypto CLI.
133
+ crypto-cli is the command-line interface for the Crypto Service
134
+ Suite. It offers both legacy OpenPGP commands (key generation,
135
+ encryption, decryption, signing, verification, revocation) and
136
+ modern v2 commands using `@noble/*` primitives with post-quantum
137
+ algorithm support. All operations run interactively via a guided
138
+ prompt menu.
190
139
 
191
- | Option | Description |
192
- |---|---|
193
- | help | Displays the help message. |
194
- | decrypt | Decrypts a message. |
195
- | encrypt | Encrypts a message. |
196
- | generate | Generates a new OpenPGP key pair. Supports RSA and ECC keys. |
197
- | reformat | Reformats signature packets for a key. |
198
- | revoke | Revokes a key. |
199
- | session | Generate a new session key object. |
200
- | sign | Signs a message. |
201
- | verify | Verifies signatures of clear text signed message. |
140
+ <p align="right"><a href="#contents">Back to Top</a></p>
141
+
142
+ ## Commands Reference
143
+
144
+ ### Legacy Commands (OpenPGP)
145
+
146
+ | Command | Description |
147
+ | :--------- | :------------------------------------------------------------- |
148
+ | `Generate` | Generate a new OpenPGP key pair (RSA or ECC) |
149
+ | `Encrypt` | Encrypt a message using public keys, passwords, or both |
150
+ | `Decrypt` | Decrypt a message with a private key, session key, or password |
151
+ | `Sign` | Sign a message with an OpenPGP private key |
152
+ | `Verify` | Verify signatures of a cleartext signed message |
153
+ | `Revoke` | Revoke an OpenPGP key with a reason |
154
+ | `Reformat` | Reformat signature packets and rewrap a key object |
155
+ | `Session` | Generate a new session key object from public key preferences |
156
+
157
+ ### Modern Commands (v2)
158
+
159
+ | Command | Description |
160
+ | :--------------- | :---------------------------------------------------------- |
161
+ | `Modern Keygen` | Generate key pairs for 12 algorithms including post-quantum |
162
+ | `Modern Hash` | Hash data with 7 algorithms (SHA-2, SHA-3, BLAKE) |
163
+ | `Modern Encrypt` | Encrypt/decrypt with 5 AEAD ciphers |
164
+ | `Modern Sign` | Sign and verify with 8 algorithms including ML-DSA |
165
+ | `Password Hash` | Hash and verify passwords with 3 Argon2 variants |
166
+
167
+ <p align="right"><a href="#contents">Back to Top</a></p>
168
+
169
+ ## Configuration
170
+
171
+ The CLI respects the following environment variables:
172
+
173
+ | Variable | Default | Description |
174
+ | :------------------- | :----------- | :---------------------------------------- |
175
+ | `CRYPTO_KEY_DIR` | `./keys` | Directory for reading key files |
176
+ | `CRYPTO_DATA_DIR` | `./data` | Directory for reading data files |
177
+ | `CRYPTO_KEY_OUT_DIR` | `./keys/out` | Directory for writing generated key files |
178
+
179
+ ```bash
180
+ export CRYPTO_KEY_DIR="$HOME/.crypto/keys"
181
+ export CRYPTO_DATA_DIR="$HOME/.crypto/data"
182
+ export CRYPTO_KEY_OUT_DIR="$HOME/.crypto/keys/out"
183
+ cryptocli
184
+ ```
185
+
186
+ <p align="right"><a href="#contents">Back to Top</a></p>
187
+
188
+ ## Examples
189
+
190
+ Runnable shell scripts are provided in the [`examples/`](examples/)
191
+ directory:
192
+
193
+ | Category | Example | Purpose |
194
+ | :--------- | :---------------------------------- | :---------------------------------------- |
195
+ | Keygen | [keygen.sh](examples/keygen.sh) | Generate Ed25519, P-256, and ML-KEM keys |
196
+ | Hashing | [hash.sh](examples/hash.sh) | Hash data with various algorithms |
197
+ | Encryption | [encrypt.sh](examples/encrypt.sh) | Encrypt and decrypt with modern ciphers |
198
+ | Signing | [sign.sh](examples/sign.sh) | Sign and verify with modern algorithms |
199
+ | Passwords | [password.sh](examples/password.sh) | Hash and verify passwords with Argon2 |
200
+ | Legacy | [legacy.sh](examples/legacy.sh) | Legacy OpenPGP key generation and signing |
201
+
202
+ Run any example:
203
+
204
+ ```bash
205
+ bash examples/keygen.sh
206
+ ```
207
+
208
+ <p align="right"><a href="#contents">Back to Top</a></p>
209
+
210
+ <p align="right"><a href="#contents">Back to Top</a></p>
211
+
212
+ ---
213
+
214
+ ## Development
215
+
216
+ ```bash
217
+ pnpm --filter @sebastienrousseau/crypto-cli run build
218
+ pnpm --filter @sebastienrousseau/crypto-cli run test
219
+ pnpm --filter @sebastienrousseau/crypto-cli run lint
220
+ pnpm --filter @sebastienrousseau/crypto-cli run format
221
+ ```
202
222
 
203
- ![divider][divider]
223
+ All 18 packages in the Crypto Service workspace maintain a **100% coverage floor** across statements, branches, functions, and lines.
204
224
 
205
- ## 🚄 Semantic Versioning Policy
225
+ <p align="right"><a href="#contents">Back to Top</a></p>
206
226
 
207
- For transparency into our release cycle and in striving to maintain backward
208
- compatibility, `crypto-cli` follows [semantic versioning](http://semver.org/)
209
- and [ESLint's Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy).
227
+ ---
210
228
 
211
- ![divider][divider]
229
+ ## Security
212
230
 
213
- ## āœ… Changelog
231
+ Report vulnerabilities privately via [GitHub Security Advisories](https://github.com/sebastienrousseau/crypto-service/security/advisories) or according to [`SECURITY.md`](../../SECURITY.md). Never report security issues publicly.
214
232
 
215
- - [GitHub Releases](https://github.com/sebastienrousseau/crypto-service/releases)
233
+ Cryptographic operations use the `@noble/*` libraries, Node.js `crypto` and OpenPGP.js. `@noble/post-quantum` has not been independently audited and does not guarantee constant-time execution, and no module in this suite is FIPS 140-3 validated. Key zeroization is limited: JavaScript strings and garbage-collected buffers cannot be reliably wiped. See [`SECURITY.md`](../../SECURITY.md).
216
234
 
217
- ![divider][divider]
235
+ <p align="right"><a href="#contents">Back to Top</a></p>
218
236
 
219
- ## ā¤ļø Contributing
237
+ ---
220
238
 
221
- Thank you for using Crypto CLI! If you like the library, it would be great if
222
- you can give it a star ⭐ on [GitHub][5].
239
+ ## Documentation
223
240
 
224
- There are also many ways in which you can participate in this project, for
225
- example:
241
+ - [Full Suite Documentation](https://sebastienrousseau.github.io/crypto-service/)
242
+ - [API Reference (TypeDoc)](https://sebastienrousseau.github.io/crypto-service/)
243
+ - [Developer Guide](../../DEVELOPMENT.md)
244
+ - [Security Policy](../../SECURITY.md)
245
+ - [Architecture & Design](../../ARCHITECTURE.md)
226
246
 
227
- - [Submit bugs and feature requests][14], and help us verify as they are checked
228
- in,
229
- - Review [source code changes][15], and help us improve our code quality,
230
- - Review the [documentation][16] and make pull requests for anything from typos
231
- to additional and new content.
247
+ <p align="right"><a href="#contents">Back to Top</a></p>
232
248
 
233
- ![divider][divider]
249
+ ---
234
250
 
235
- ## šŸ„‚ License
251
+ ## Stability guarantees
236
252
 
237
- Copyright (c) Sebastien Rousseau. All rights reserved.
253
+ Versions advance strictly one step at a time on the `0.0.x` line (`v0.0.1` → `v0.0.2` → `v0.0.3` ... → `v0.0.999` → `v0.1.0`). Work for every release iteration begins on a dedicated `feat/v<version>` branch.
238
254
 
239
- Licensed under the [MIT](LICENSE) license.
255
+ All 18 packages in the workspace move in lockstep. Public API signatures, cipher output formats, and serialization schemas are strictly versioned. Breaking changes to serialized formats or algorithm defaults are considered major breaking changes. Minimum toolchain upgrades (e.g. Node.js LTS floor) are governed by [POLICIES.md](../../docs/POLICIES.md).
240
256
 
241
- ![divider][divider]
257
+ <p align="right"><a href="#contents">Back to Top</a></p>
242
258
 
243
- ## šŸ¢ Acknowledgements
259
+ ---
244
260
 
245
- [Crypto Service Suite](https://crypto-service.co) is beautifully crafted by
246
- these people and a bunch of awesome [contributors][17].
261
+ ## License
247
262
 
248
- | Contributors |
249
- |---------|
250
- |[![Sebastien Rousseau](https://avatars0.githubusercontent.com/u/1394998?s=117)](https://sebastienrousseau.co.uk)|
251
- |[Sebastien Rousseau](https://github.com/sebastienrousseau)|
263
+ Dual-licensed under [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) or [MIT](https://opensource.org/licenses/MIT), at your option.
252
264
 
253
- [1]: https://openpgpjs.org/
254
- [2]: https://tools.ietf.org/html/rfc4880
255
- [3]: https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-10
256
- [4]: https://github.com
257
- [5]: https://github.com/sebastienrousseau/crypto-service
258
- [6]: https://github.com/sebastienrousseau/crypto-service/blob/main/LICENSE
259
- [7]: https://nodejs.org/en/
260
- [8]: https://www.npmjs.com/
261
- [9]: https://yarnpkg.com/getting-started
262
- [10]: https://pnpm.io/motivation
263
- [11]: https://en.wikipedia.org/wiki/RSA_(cryptosystem)
264
- [12]: https://en.wikipedia.org/wiki/Elliptic-curve_cryptography
265
- [13]: https://github.com/sebastienrousseau/crypto-service/packages/
266
- [14]: https://github.com/sebastienrousseau/crypto-service/issues/new
267
- [15]: https://github.com/sebastienrousseau/crypto-service/pulls
268
- [16]: https://github.com/sebastienrousseau/crypto-service/docs
269
- [17]: https://github.com/sebastienrousseau/crypto-service/graphs/contributors
265
+ Copyright (c) 2022-2026 Sebastien Rousseau and The Crypto Service Suite contributors.
270
266
 
271
- [divider]: https://raw.githubusercontent.com/sebastienrousseau/crypto-service/master/assets/divider.svg
272
- [crypto-cli]: https://raw.githubusercontent.com/sebastienrousseau/crypto-service/main/assets/crypto-cli.svg "Crypto CLI"
273
- [getting started]: https://raw.githubusercontent.com/sebastienrousseau/crypto-service/master/assets/button-primary.svg
274
- [download]: https://raw.githubusercontent.com/sebastienrousseau/crypto-service/master/assets/button-secondary.svg
267
+ <p align="right"><a href="#contents">Back to Top</a></p>
package/dist/cli.js CHANGED
@@ -19,7 +19,7 @@ write_utils_1.writeUtils.writeLn(index_2.constants.CLI_DESCRIPTION);
19
19
  write_utils_1.writeUtils.writeLn("");
20
20
  (async () => {
21
21
  const response = await (0, prompts_1.default)({
22
- type: 'select',
22
+ type: "select",
23
23
  name: index_2.constants.PROMPT_SELECT_TTL,
24
24
  message: index_2.constants.PROMPT_SELECT_DES + "\n\n",
25
25
  choices: [
@@ -63,6 +63,36 @@ write_utils_1.writeUtils.writeLn("");
63
63
  description: index_2.constants.CLI_FN_8_DES,
64
64
  value: index_2.constants.CLI_FN_8_TTL,
65
65
  },
66
+ {
67
+ title: "Modern Keygen",
68
+ description: "Generate keys (Ed25519, ML-DSA, ML-KEM, P-256, etc.)",
69
+ value: "Modern Keygen",
70
+ },
71
+ {
72
+ title: "Modern Hash",
73
+ description: "Hash data (SHA-2, SHA-3, BLAKE2b, BLAKE3)",
74
+ value: "Modern Hash",
75
+ },
76
+ {
77
+ title: "Modern Encrypt",
78
+ description: "Encrypt (XChaCha20, AES-GCM, AES-GCM-SIV)",
79
+ value: "Modern Encrypt",
80
+ },
81
+ {
82
+ title: "Modern Sign",
83
+ description: "Sign/verify (Ed25519, ECDSA, Schnorr, ML-DSA)",
84
+ value: "Modern Sign",
85
+ },
86
+ {
87
+ title: "Password Hash",
88
+ description: "Hash/verify passwords (Argon2id/i/d)",
89
+ value: "Password Hash",
90
+ },
91
+ {
92
+ title: "CBOM",
93
+ description: "Generate or audit Cryptographic Bill of Materials",
94
+ value: "CBOM",
95
+ },
66
96
  {
67
97
  title: index_2.constants.CLI_FN_9_TTL,
68
98
  description: index_2.constants.CLI_FN_9_DES,
@@ -119,6 +149,42 @@ write_utils_1.writeUtils.writeLn("");
119
149
  index_1.Command.handleVerify();
120
150
  break;
121
151
  }
152
+ case "Modern Keygen": {
153
+ write_utils_1.writeUtils.writeLn("");
154
+ write_utils_1.writeUtils.writeLn(kleur_1.default.green("Modern Key Generation"));
155
+ index_1.Command.handleModernKeygen();
156
+ break;
157
+ }
158
+ case "Modern Hash": {
159
+ write_utils_1.writeUtils.writeLn("");
160
+ write_utils_1.writeUtils.writeLn(kleur_1.default.green("Modern Hashing"));
161
+ index_1.Command.handleModernHash();
162
+ break;
163
+ }
164
+ case "Modern Encrypt": {
165
+ write_utils_1.writeUtils.writeLn("");
166
+ write_utils_1.writeUtils.writeLn(kleur_1.default.green("Modern Encryption"));
167
+ index_1.Command.handleModernEncrypt();
168
+ break;
169
+ }
170
+ case "Modern Sign": {
171
+ write_utils_1.writeUtils.writeLn("");
172
+ write_utils_1.writeUtils.writeLn(kleur_1.default.green("Modern Signing"));
173
+ index_1.Command.handleModernSign();
174
+ break;
175
+ }
176
+ case "Password Hash": {
177
+ write_utils_1.writeUtils.writeLn("");
178
+ write_utils_1.writeUtils.writeLn(kleur_1.default.green("Password Hashing (Argon2)"));
179
+ index_1.Command.handlePasswordHash();
180
+ break;
181
+ }
182
+ case "CBOM": {
183
+ write_utils_1.writeUtils.writeLn("");
184
+ write_utils_1.writeUtils.writeLn(kleur_1.default.green("Cryptographic Bill of Materials (CBOM)"));
185
+ index_1.Command.handleModernCbom();
186
+ break;
187
+ }
122
188
  case index_2.constants.CLI_FN_9_TTL: {
123
189
  write_utils_1.writeUtils.writeLn("");
124
190
  write_utils_1.writeUtils.writeLn(kleur_1.default.green(index_2.constants.CLI_FN_9_TTL));
@@ -1 +1 @@
1
- {"version":3,"file":"decrypt.command.d.ts","sourceRoot":"","sources":["../../src/commands/decrypt.command.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,aAAa,qBAsClB,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"decrypt.command.d.ts","sourceRoot":"","sources":["../../src/commands/decrypt.command.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,aAAa,qBAuClB,CAAC;AAGF,eAAe,aAAa,CAAC"}
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const crypto_lib_1 = __importDefault(require("@sebastienrousseau/crypto-lib"));
6
+ const decrypt_1 = __importDefault(require("@sebastienrousseau/crypto-lib/dist/lib/decrypt"));
7
7
  const prompts_1 = __importDefault(require("prompts"));
8
8
  const handleDecrypt = async () => {
9
9
  const responseDecrypt = await (0, prompts_1.default)([
@@ -23,10 +23,9 @@ const handleDecrypt = async () => {
23
23
  message: "Provide a public key in base64 format",
24
24
  },
25
25
  ]);
26
- console.log(responseDecrypt);
27
26
  const data = {
28
27
  passphrase: responseDecrypt.passphrase,
29
- encryptedMessage: responseDecrypt.message,
28
+ message: responseDecrypt.message,
30
29
  publicKey: responseDecrypt.publicKey,
31
30
  };
32
31
  if (responseDecrypt.passphrase === "" ||
@@ -35,7 +34,7 @@ const handleDecrypt = async () => {
35
34
  console.error("\nšŸ”” You must provide a value for each of the properties.\n");
36
35
  }
37
36
  else {
38
- await crypto_lib_1.default.decrypt(data);
37
+ await (0, decrypt_1.default)(data);
39
38
  }
40
39
  };
41
40
  exports.default = handleDecrypt;
@@ -1 +1 @@
1
- {"version":3,"file":"encrypt.command.d.ts","sourceRoot":"","sources":["../../src/commands/encrypt.command.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,aAAa,qBAsClB,CAAC;AACF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"encrypt.command.d.ts","sourceRoot":"","sources":["../../src/commands/encrypt.command.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,aAAa,qBAuClB,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const crypto_lib_1 = __importDefault(require("@sebastienrousseau/crypto-lib"));
6
+ const encrypt_1 = __importDefault(require("@sebastienrousseau/crypto-lib/dist/lib/encrypt"));
7
7
  const prompts_1 = __importDefault(require("prompts"));
8
8
  const handleEncrypt = async () => {
9
9
  const responseEncrypt = await (0, prompts_1.default)([
@@ -23,7 +23,6 @@ const handleEncrypt = async () => {
23
23
  message: "Provide a public key in base64 format",
24
24
  },
25
25
  ]);
26
- console.log(responseEncrypt);
27
26
  const data = {
28
27
  passphrase: responseEncrypt.passphrase,
29
28
  message: responseEncrypt.message,
@@ -35,7 +34,7 @@ const handleEncrypt = async () => {
35
34
  console.error("\nšŸ”” You must provide a value for each of the properties.\n");
36
35
  }
37
36
  else {
38
- await crypto_lib_1.default.encrypt(data);
37
+ await (0, encrypt_1.default)(data);
39
38
  }
40
39
  };
41
40
  exports.default = handleEncrypt;