@sebastienrousseau/crypto-cli 0.0.1 ā 0.0.7
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 +228 -235
- package/dist/cli.js +67 -1
- package/dist/commands/decrypt.command.d.ts.map +1 -1
- package/dist/commands/decrypt.command.js +3 -4
- package/dist/commands/encrypt.command.d.ts.map +1 -1
- package/dist/commands/encrypt.command.js +2 -3
- package/dist/commands/generate.command.d.ts.map +1 -1
- package/dist/commands/generate.command.js +24 -25
- package/dist/commands/help.command.d.ts.map +1 -1
- package/dist/commands/index.d.ts +6 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +7 -0
- package/dist/commands/modern/cbom.command.d.ts +10 -0
- package/dist/commands/modern/cbom.command.d.ts.map +1 -0
- package/dist/commands/modern/cbom.command.js +164 -0
- package/dist/commands/modern/encrypt.command.d.ts +3 -0
- package/dist/commands/modern/encrypt.command.d.ts.map +1 -0
- package/dist/commands/modern/encrypt.command.js +125 -0
- package/dist/commands/modern/hash.command.d.ts +3 -0
- package/dist/commands/modern/hash.command.d.ts.map +1 -0
- package/dist/commands/modern/hash.command.js +91 -0
- package/dist/commands/modern/index.d.ts +9 -0
- package/dist/commands/modern/index.d.ts.map +1 -0
- package/dist/commands/modern/index.js +21 -0
- package/dist/commands/modern/keygen.command.d.ts +3 -0
- package/dist/commands/modern/keygen.command.d.ts.map +1 -0
- package/dist/commands/modern/keygen.command.js +113 -0
- package/dist/commands/modern/password-hash.command.d.ts +3 -0
- package/dist/commands/modern/password-hash.command.d.ts.map +1 -0
- package/dist/commands/modern/password-hash.command.js +106 -0
- package/dist/commands/modern/sign.command.d.ts +3 -0
- package/dist/commands/modern/sign.command.d.ts.map +1 -0
- package/dist/commands/modern/sign.command.js +135 -0
- package/dist/commands/reformat.command.d.ts.map +1 -1
- package/dist/commands/reformat.command.js +2 -3
- package/dist/commands/revoke.command.d.ts.map +1 -1
- package/dist/commands/revoke.command.js +2 -3
- package/dist/commands/session.command.d.ts.map +1 -1
- package/dist/commands/session.command.js +2 -3
- package/dist/commands/sign.command.d.ts.map +1 -1
- package/dist/commands/sign.command.js +2 -3
- package/dist/commands/verify.command.d.ts.map +1 -1
- package/dist/commands/verify.command.js +12 -13
- package/dist/constants/en.d.ts.map +1 -1
- package/dist/constants/en.js +87 -87
- package/dist/constants/fr.d.ts +1 -1
- package/dist/constants/fr.d.ts.map +1 -1
- package/dist/constants/fr.js +24 -24
- package/dist/constants/index.d.ts +4 -2
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +25 -20
- package/dist/helpers/banner.d.ts +1 -1
- package/dist/helpers/banner.d.ts.map +1 -1
- package/dist/utils/version.utils.d.ts.map +1 -1
- package/dist/utils/write.utils.d.ts.map +1 -1
- package/dist/utils/write.utils.js +1 -1
- package/package.json +123 -126
- package/dist/.DS_Store +0 -0
- package/dist/COPYRIGHT +0 -15
- package/dist/Makefile +0 -122
- package/dist/Report.txt +0 -176
- package/dist/cli.js.map +0 -1
- package/dist/commands/decrypt.command.js.map +0 -1
- package/dist/commands/encrypt.command.js.map +0 -1
- package/dist/commands/generate.command.js.map +0 -1
- package/dist/commands/help.command.js.map +0 -1
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/reformat.command.js.map +0 -1
- package/dist/commands/revoke.command.js.map +0 -1
- package/dist/commands/session.command.js.map +0 -1
- package/dist/commands/sign.command.js.map +0 -1
- package/dist/commands/verify.command.js.map +0 -1
- package/dist/constants/en.js.map +0 -1
- package/dist/constants/fr.js.map +0 -1
- package/dist/constants/index.js.map +0 -1
- package/dist/helpers/banner.js.map +0 -1
- package/dist/key/key.d.ts +0 -17
- package/dist/key/key.d.ts.map +0 -1
- package/dist/key/key.js +0 -19
- package/dist/key/key.js.map +0 -1
- package/dist/key/rsa-reformat.cert +0 -1
- package/dist/key/rsa-reformat.key +0 -1
- package/dist/key/rsa-reformat.pub +0 -1
- package/dist/key/rsa-revoke.key +0 -1
- package/dist/key/rsa-revoke.pub +0 -1
- package/dist/key/rsa.cert +0 -1
- package/dist/key/rsa.key +0 -1
- package/dist/key/rsa.pub +0 -1
- package/dist/package.json +0 -129
- package/dist/utils/version.utils.js.map +0 -1
- package/dist/utils/write.utils.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,274 +1,267 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- SPDX-License-Identifier: Apache-2.0 OR MIT -->
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
6
|
-
[](https://coveralls.io/github/sebastienrousseau/crypto-service?branch=main)
|
|
7
|
-
[](https://lerna.js.org/)
|
|
8
|
-
[](https://opensource.org/licenses/MIT)
|
|
9
|
-

|
|
7
|
+
<h1 align="center">@sebastienrousseau/crypto-cli</h1>
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
62
|
+
<p align="right"><a href="#contents">Back to Top</a></p>
|
|
63
|
+
|
|
64
|
+
---
|
|
167
65
|
|
|
168
|
-
|
|
66
|
+
## Requirements
|
|
169
67
|
|
|
170
|
-
|
|
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
|
-
>
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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
|
-
|
|
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
|
-
|
|
127
|
+
<p align="right"><a href="#contents">Back to Top</a></p>
|
|
182
128
|
|
|
183
|
-
|
|
129
|
+
---
|
|
184
130
|
|
|
185
|
-
|
|
186
|
-
and other parameters that can control the behavior of the Crypto CLI as a
|
|
187
|
-
whole.
|
|
131
|
+
## Overview
|
|
188
132
|
|
|
189
|
-
|
|
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
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
|
198
|
-
|
|
|
199
|
-
|
|
|
200
|
-
|
|
|
201
|
-
|
|
|
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
|
-
|
|
223
|
+
All 18 packages in the Crypto Service workspace maintain a **100% coverage floor** across statements, branches, functions, and lines.
|
|
204
224
|
|
|
205
|
-
|
|
225
|
+
<p align="right"><a href="#contents">Back to Top</a></p>
|
|
206
226
|
|
|
207
|
-
|
|
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
|
-
|
|
229
|
+
## Security
|
|
212
230
|
|
|
213
|
-
|
|
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
|
-
- [
|
|
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
|
-
|
|
235
|
+
<p align="right"><a href="#contents">Back to Top</a></p>
|
|
218
236
|
|
|
219
|
-
|
|
237
|
+
---
|
|
220
238
|
|
|
221
|
-
|
|
222
|
-
you can give it a star ā on [GitHub][5].
|
|
239
|
+
## Documentation
|
|
223
240
|
|
|
224
|
-
|
|
225
|
-
|
|
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
|
-
|
|
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
|
-
|
|
249
|
+
---
|
|
234
250
|
|
|
235
|
-
##
|
|
251
|
+
## Stability guarantees
|
|
236
252
|
|
|
237
|
-
|
|
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
|
-
|
|
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
|
-
|
|
257
|
+
<p align="right"><a href="#contents">Back to Top</a></p>
|
|
242
258
|
|
|
243
|
-
|
|
259
|
+
---
|
|
244
260
|
|
|
245
|
-
|
|
246
|
-
these people and a bunch of awesome [contributors][17].
|
|
261
|
+
## License
|
|
247
262
|
|
|
248
|
-
|
|
249
|
-
|---------|
|
|
250
|
-
|[](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
|
-
|
|
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
|
-
|
|
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:
|
|
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":"
|
|
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
|
|
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
|
-
|
|
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
|
|
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":"
|
|
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
|
|
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
|
|
37
|
+
await (0, encrypt_1.default)(data);
|
|
39
38
|
}
|
|
40
39
|
};
|
|
41
40
|
exports.default = handleEncrypt;
|