rtty-soda 0.1.6__py3-none-any.whl → 0.2.0__py3-none-any.whl

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.

Potentially problematic release.


This version of rtty-soda might be problematic. Click here for more details.

rtty_soda/main.pyi CHANGED
@@ -1,9 +1,26 @@
1
1
  from pathlib import Path
2
2
 
3
3
  def cli() -> None: ...
4
- def genkey_cmd(encoding: str) -> None: ...
5
- def pubkey_cmd(private_key_file: Path, encoding: str) -> None: ...
6
- def kdf_cmd(password_file: Path, encoding: str, profile: str) -> None: ...
4
+ def genkey_cmd(
5
+ encoding: str, output_file: Path | None, group_len: int, line_len: int, padding: int
6
+ ) -> None: ...
7
+ def pubkey_cmd(
8
+ private_key_file: Path,
9
+ encoding: str,
10
+ output_file: Path | None,
11
+ group_len: int,
12
+ line_len: int,
13
+ padding: int,
14
+ ) -> None: ...
15
+ def kdf_cmd(
16
+ password_file: Path,
17
+ encoding: str,
18
+ profile: str,
19
+ output_file: Path | None,
20
+ group_len: int,
21
+ line_len: int,
22
+ padding: int,
23
+ ) -> None: ...
7
24
  def encrypt_public_cmd(
8
25
  private_key_file: Path,
9
26
  public_key_file: Path,
@@ -12,6 +29,10 @@ def encrypt_public_cmd(
12
29
  data_encoding: str,
13
30
  compression: str,
14
31
  output_file: Path | None,
32
+ group_len: int,
33
+ line_len: int,
34
+ padding: int,
35
+ verbose: bool,
15
36
  ) -> None: ...
16
37
  def encrypt_secret_cmd(
17
38
  key_file: Path,
@@ -20,6 +41,10 @@ def encrypt_secret_cmd(
20
41
  data_encoding: str,
21
42
  compression: str,
22
43
  output_file: Path | None,
44
+ group_len: int,
45
+ line_len: int,
46
+ padding: int,
47
+ verbose: bool,
23
48
  ) -> None: ...
24
49
  def encrypt_password_cmd(
25
50
  password_file: Path,
@@ -28,6 +53,10 @@ def encrypt_password_cmd(
28
53
  data_encoding: str,
29
54
  compression: str,
30
55
  output_file: Path | None,
56
+ group_len: int,
57
+ line_len: int,
58
+ padding: int,
59
+ verbose: bool,
31
60
  ) -> None: ...
32
61
  def decrypt_public_cmd(
33
62
  private_key_file: Path,
@@ -37,6 +66,8 @@ def decrypt_public_cmd(
37
66
  data_encoding: str,
38
67
  compression: str,
39
68
  output_file: Path | None,
69
+ padding: int,
70
+ verbose: bool,
40
71
  ) -> None: ...
41
72
  def decrypt_secret_cmd(
42
73
  key_file: Path,
@@ -45,6 +76,8 @@ def decrypt_secret_cmd(
45
76
  data_encoding: str,
46
77
  compression: str,
47
78
  output_file: Path | None,
79
+ padding: int,
80
+ verbose: bool,
48
81
  ) -> None: ...
49
82
  def decrypt_password_cmd(
50
83
  password_file: Path,
@@ -53,7 +86,15 @@ def decrypt_password_cmd(
53
86
  data_encoding: str,
54
87
  compression: str,
55
88
  output_file: Path | None,
89
+ padding: int,
90
+ verbose: bool,
56
91
  ) -> None: ...
57
92
  def encode_cmd(
58
- in_encoding: str, out_encoding: str, file: Path, output_file: Path | None
93
+ in_encoding: str,
94
+ out_encoding: str,
95
+ file: Path,
96
+ output_file: Path | None,
97
+ group_len: int,
98
+ line_len: int,
99
+ padding: int,
59
100
  ) -> None: ...
@@ -0,0 +1,333 @@
1
+ Metadata-Version: 2.3
2
+ Name: rtty-soda
3
+ Version: 0.2.0
4
+ Summary: A CLI tool for Unix-like environments to encrypt a RTTY session using NaCl
5
+ Keywords: cli,encryption,libsodium,nacl,rtty
6
+ Author: Theo Saveliev
7
+ Author-email: Theo Saveliev <89431871+theosaveliev@users.noreply.github.com>
8
+ License: MIT
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Programming Language :: Python :: 3.14
11
+ Classifier: Operating System :: POSIX
12
+ Classifier: Environment :: Console
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Topic :: Security :: Cryptography
15
+ Classifier: Topic :: Utilities
16
+ Requires-Dist: click-aliases>=1.0.5,<2.0.0
17
+ Requires-Dist: click>=8.3.0,<9.0.0
18
+ Requires-Dist: pynacl>=1.6.0,<2.0.0
19
+ Requires-Python: >=3.14, <4.0
20
+ Project-URL: github, https://github.com/theosaveliev/rtty-soda
21
+ Project-URL: issues, https://github.com/theosaveliev/rtty-soda/issues
22
+ Description-Content-Type: text/markdown
23
+
24
+ # rtty-soda
25
+
26
+ A CLI tool for Unix-like environments to encrypt a RTTY session using NaCl.
27
+
28
+
29
+ #### Features
30
+
31
+ - Public Key encryption (Curve25519-XSalsa20-Poly1305)
32
+ - Secret Key encryption (XSalsa20-Poly1305)
33
+ - Key derivation (Argon2id-Blake2b)
34
+ - Text compression (zstd, zlib, bz2, lzma)
35
+ - Custom encodings:
36
+ - Base26 (Latin)
37
+ - Base31 (Cyrillic)
38
+ - Base36 (Latin with numbers)
39
+ - Base64 (RFC 3548)
40
+ - Base94 (ASCII printable)
41
+ - Binary
42
+
43
+
44
+ ## Installation
45
+ #### Package manager
46
+
47
+ 1. [Install uv](https://docs.astral.sh/uv/getting-started/installation/)
48
+ 2. Install rtty-soda:
49
+ ```
50
+ % uv tool install rtty-soda
51
+ ```
52
+ 3. Remove rtty-soda:
53
+ ```
54
+ % uv tool uninstall rtty-soda
55
+ ```
56
+
57
+ #### Docker
58
+
59
+ ```
60
+ % docker run -it --rm -h rtty-soda -v .:/app/host nett/rtty-soda:0.2.0
61
+ % docker run -it --rm -h rtty-soda -v .:/app/host nett/rtty-soda:0.2.0-tools
62
+ ```
63
+
64
+
65
+ ## Getting help
66
+
67
+ All commands have `[-h | --help]` option.
68
+
69
+ ```
70
+ % soda
71
+ Usage: soda [OPTIONS] COMMAND [ARGS]...
72
+
73
+ Options:
74
+ --version Show the version and exit.
75
+ -h, --help Show this message and exit.
76
+
77
+ Commands:
78
+ decrypt-password (dp) Decrypt Message (Password).
79
+ decrypt-public (d) Decrypt Message (Public).
80
+ decrypt-secret (ds) Decrypt Message (Secret).
81
+ encode Encode File.
82
+ encrypt-password (ep) Encrypt Message (Password).
83
+ encrypt-public (e) Encrypt Message (Public).
84
+ encrypt-secret (es) Encrypt Message (Secret).
85
+ genkey Generate Private Key.
86
+ kdf Key Derivation Function.
87
+ pubkey Get Public Key.
88
+ ```
89
+
90
+ Some commands have aliases, so `% soda encrypt-password ...` and `% soda ep ...`
91
+ are equivalent.
92
+
93
+
94
+ ## Public Key encryption
95
+ #### Key generation
96
+
97
+ ```
98
+ % soda genkey | tee alice | soda pubkey - | tee alice_pub
99
+ R5xUCEhvkRRwQD+iWo2hV65fIsWucUZtiFJGKy6pTyA=
100
+
101
+ % soda genkey | tee bob | soda pubkey - | tee bob_pub
102
+ woNtqALnGLzp8VBuzJ8T13E4OZRv5YZy6kXMBpV8/mI=
103
+
104
+ % soda genkey -h
105
+ Usage: soda genkey [OPTIONS]
106
+
107
+ Generate Private Key.
108
+
109
+ Encoding: base26 | base31 | base36 | base64 | base94 | binary
110
+
111
+ Options:
112
+ -e, --encoding TEXT [default: base64]
113
+ -o, --output-file FILE Write output to file.
114
+ --group-len INTEGER [default: 0]
115
+ --line-len INTEGER [default: 0]
116
+ --padding INTEGER [default: 0]
117
+ -h, --help Show this message and exit.
118
+ ```
119
+
120
+ #### Encryption
121
+
122
+ Alice sends the message to Bob:
123
+
124
+ ```
125
+ % cat message
126
+ A telegraph key is a specialized electrical switch used by a trained operator to
127
+ transmit text messages in Morse code in a telegraphy system.
128
+ The first telegraph key was invented by Alfred Vail, an associate of Samuel Morse.
129
+ (c) Wikipedia
130
+
131
+ % soda encrypt-public alice bob_pub message --line-len 80 | tee encrypted
132
+ cCipniCmJVAb2mc3JLoDo/DAun7cMunWS5bMqtKRPc/e3d2vfRm8wnqTsYjOXVOCZRj78/GqcVweBV0
133
+ mE43X7xO8B0OVyKKgqPAqnAJxwggTLPmWtKFrTwKi0utf7n6fIQuDaCths0qO6FF5rm0znc/3KYKP3D
134
+ /WbgE/IBrTOAV6P+mLUnGlzO6U/HdtDCjk1ZB45EN0Q76dDzYav+bliCrVWiAUfZUCtEQ/6B4fi9Aqn
135
+ KRDC4XSnd7nLs/ZkhL8hkM13xJ+1MBGbIvEjaY=
136
+
137
+ % soda encrypt-public -h
138
+ Usage: soda encrypt-public [OPTIONS] PRIVATE_KEY_FILE PUBLIC_KEY_FILE
139
+ MESSAGE_FILE
140
+
141
+ Encrypt Message (Public).
142
+
143
+ Encoding: base26 | base31 | base36 | base64 | base94 | binary
144
+
145
+ Compression: zstd | zlib | bz2 | lzma | raw
146
+
147
+ Options:
148
+ --key-encoding TEXT [default: base64]
149
+ -e, --data-encoding TEXT [default: base64]
150
+ -c, --compression TEXT [default: zstd]
151
+ -o, --output-file FILE Write output to file.
152
+ --group-len INTEGER [default: 0]
153
+ --line-len INTEGER [default: 0]
154
+ --padding INTEGER [default: 0]
155
+ -v, --verbose Show verbose output.
156
+ -h, --help Show this message and exit.
157
+ ```
158
+
159
+ #### Decryption
160
+
161
+ ```
162
+ % soda decrypt-public bob alice_pub encrypted
163
+ A telegraph key is a specialized electrical switch used by a trained operator to
164
+ transmit text messages in Morse code in a telegraphy system.
165
+ The first telegraph key was invented by Alfred Vail, an associate of Samuel Morse.
166
+ (c) Wikipedia
167
+
168
+ % soda decrypt-public -h
169
+ Usage: soda decrypt-public [OPTIONS] PRIVATE_KEY_FILE PUBLIC_KEY_FILE
170
+ MESSAGE_FILE
171
+
172
+ Decrypt Message (Public).
173
+
174
+ Encoding: base26 | base31 | base36 | base64 | base94 | binary
175
+
176
+ Compression: zstd | zlib | bz2 | lzma | raw
177
+
178
+ Options:
179
+ --key-encoding TEXT [default: base64]
180
+ -e, --data-encoding TEXT [default: base64]
181
+ -c, --compression TEXT [default: zstd]
182
+ -o, --output-file FILE Write output to file.
183
+ --padding INTEGER [default: 0]
184
+ -v, --verbose Show verbose output.
185
+ -h, --help Show this message and exit.
186
+ ```
187
+
188
+
189
+ ## Secret Key encryption
190
+
191
+ Alice and Bob share a key for symmetric encryption:
192
+
193
+ ```
194
+ % soda genkey > shared
195
+ % soda encrypt-secret shared message -o encrypted
196
+ % soda decrypt-secret shared encrypted -o message
197
+
198
+ % soda encrypt-secret -h
199
+ Usage: soda encrypt-secret [OPTIONS] KEY_FILE MESSAGE_FILE
200
+
201
+ Encrypt Message (Secret).
202
+
203
+ Encoding: base26 | base31 | base36 | base64 | base94 | binary
204
+
205
+ Compression: zstd | zlib | bz2 | lzma | raw
206
+
207
+ Options:
208
+ --key-encoding TEXT [default: base64]
209
+ -e, --data-encoding TEXT [default: base64]
210
+ -c, --compression TEXT [default: zstd]
211
+ -o, --output-file FILE Write output to file.
212
+ --group-len INTEGER [default: 0]
213
+ --line-len INTEGER [default: 0]
214
+ --padding INTEGER [default: 0]
215
+ -v, --verbose Show verbose output.
216
+ -h, --help Show this message and exit.
217
+ ```
218
+
219
+ Another day, they share a password:
220
+
221
+ ```
222
+ % echo qwerty | soda encrypt-password - message -p interactive -o encrypted
223
+ % echo qwerty | soda decrypt-password - encrypted -p interactive -o message
224
+
225
+ % soda encrypt-password -h
226
+ Usage: soda encrypt-password [OPTIONS] PASSWORD_FILE MESSAGE_FILE
227
+
228
+ Encrypt Message (Password).
229
+
230
+ KDF profile: interactive | moderate | sensitive
231
+
232
+ Encoding: base26 | base31 | base36 | base64 | base94 | binary
233
+
234
+ Compression: zstd | zlib | bz2 | lzma | raw
235
+
236
+ Options:
237
+ -p, --kdf-profile TEXT [default: sensitive]
238
+ -e, --data-encoding TEXT [default: base64]
239
+ -c, --compression TEXT [default: zstd]
240
+ -o, --output-file FILE Write output to file.
241
+ --group-len INTEGER [default: 0]
242
+ --line-len INTEGER [default: 0]
243
+ --padding INTEGER [default: 0]
244
+ -v, --verbose Show verbose output.
245
+ -h, --help Show this message and exit.
246
+ ```
247
+
248
+
249
+ ## Key derivation
250
+
251
+ The KDF function derives the key from the password.
252
+ It accepts different profiles: interactive, moderate, and sensitive.
253
+
254
+ ```
255
+ % echo qwerty | soda kdf --profile interactive -
256
+ HqbvUXflAG+no3YS9njezZ3leyr8IwERAyeNoG2l41U=
257
+
258
+ % soda kdf -h
259
+ Usage: soda kdf [OPTIONS] PASSWORD_FILE
260
+
261
+ Key Derivation Function.
262
+
263
+ Encoding: base26 | base31 | base36 | base64 | base94 | binary
264
+
265
+ Profile: interactive | moderate | sensitive
266
+
267
+ Options:
268
+ -e, --encoding TEXT [default: base64]
269
+ -p, --profile TEXT [default: sensitive]
270
+ -o, --output-file FILE Write output to file.
271
+ --group-len INTEGER [default: 0]
272
+ --line-len INTEGER [default: 0]
273
+ --padding INTEGER [default: 0]
274
+ -h, --help Show this message and exit.
275
+ ```
276
+
277
+
278
+ ## Text compression
279
+
280
+ That works as follows:
281
+ 1. The plaintext is compressed with the compression lib
282
+ 2. The 16-byte MAC and 24-byte nonce are added
283
+ 3. The result is encoded with Base64, which adds ~25% overhead
284
+
285
+ ```
286
+ % soda es shared message -c zstd -v > /dev/null
287
+ Plaintext: 239
288
+ Ciphertext: 276
289
+ Overhead: 1.155
290
+ % soda es shared message -c zlib -v > /dev/null
291
+ Plaintext: 239
292
+ Ciphertext: 280
293
+ Overhead: 1.172
294
+ % soda es shared message -c bz2 -v > /dev/null
295
+ Plaintext: 239
296
+ Ciphertext: 340
297
+ Overhead: 1.423
298
+ % soda es shared message -c lzma -v > /dev/null
299
+ Plaintext: 239
300
+ Ciphertext: 324
301
+ Overhead: 1.356
302
+ % soda es shared message -c raw -v > /dev/null
303
+ Plaintext: 239
304
+ Ciphertext: 372
305
+ Overhead: 1.556
306
+ ```
307
+
308
+
309
+ ## Encoding
310
+
311
+ The rtty-soda supports various encodings:
312
+
313
+ ```
314
+ % soda encrypt-public alice bob_pub message --data-encoding base36 --group-len 5 --line-len 80
315
+ 9TPUZ T8OA3 PNC2Z XEH87 EPMCN NDQJJ GX0DE YW16D OJ2FC D3PCM B148K 6UZFN 9RQX7
316
+ 8C83X 6O8WS MQ4CX 26C7H 35EK5 CVSIX IFSVN KPV6A TRV1F 573WI JFFGE I7N3Z Z4N6D
317
+ FSSOB DJUBK PC2YW Z6RG0 SUD2N OIYH8 WHJMN YYSKQ EBEVJ ZT0M1 DYJ7E NJ25J FMXNE
318
+ 7LHUQ N5UIH SK5O7 96LWM IZ7BA R8SIV 6G55R Q50L4 PJH5Z 2JQNX JZTPK BG140 AKXOB
319
+ DKR4K POW9A HCQSQ JLSJ1 11AZY P8BM4 F3GUC SFX04 RMD0G 4V0PL RLRHN G8D8
320
+ ```
321
+
322
+
323
+ ## Compatibility
324
+
325
+ During the initial development (versions prior to 1.0.0),
326
+ I can break backwards compatibility.
327
+
328
+
329
+ ## Releases
330
+
331
+ This project follows a rolling release cycle.
332
+ Each version bump represents where I completed a full test cycle.
333
+ When testing passes successfully, I commit and release - so every release is a verified stable point.
@@ -0,0 +1,23 @@
1
+ rtty_soda/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ rtty_soda/archivers.py,sha256=b-qZ6-MAY1rm1Jsosi2XEfjNjkU7acAedHmnSzthf-A,1343
3
+ rtty_soda/cli_io.py,sha256=5c0Jt51zVgLHZMppj9sXl5x8nZsdpeTx7rglHE4w0wg,3170
4
+ rtty_soda/cryptography/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ rtty_soda/cryptography/kdf.py,sha256=HymfTiK7BD7lhZu0OdtFW_i-v0r7e8XedT8_Q84ClJc,1529
6
+ rtty_soda/cryptography/public.py,sha256=6gwsT4ilaMDHwtdYPOEYlX8IfwHPew8lMIbxRva1mLs,612
7
+ rtty_soda/cryptography/secret.py,sha256=N5ytktC2oxYfTFew0utytEClWK2rMvcnxlqeppR7wDQ,529
8
+ rtty_soda/encoders/__init__.py,sha256=y2_dw7PQRadBKZ6CSPOSqjHyxdiGJ_KmxXSsyQytugk,737
9
+ rtty_soda/encoders/base26_encoder.py,sha256=E8JD9CKBNsANDi6-7RXobiB-GrWOJX0ThN8A7YtxjzM,459
10
+ rtty_soda/encoders/base31_encoder.py,sha256=23mxVPJSJqrxzlTmGGaV7pvMxnJCArqO-_ZsVAl4UHA,486
11
+ rtty_soda/encoders/base36_encoder.py,sha256=3mPM4nTy_a1BRBqZD5tCjcZGtgUjU3Ew2y4ro9qq-jg,475
12
+ rtty_soda/encoders/base64_encoder.py,sha256=K1y7zVyb4d_YTrP5iONxtJ8hfJpCUcdCAOAoLppcPYk,294
13
+ rtty_soda/encoders/base94_encoder.py,sha256=TP9OYBF9tzIvqbOr5YRRAQt1SCxvnrL1FVOsIbrX8jc,463
14
+ rtty_soda/encoders/encoder.py,sha256=z-NPAqoxl5VlYLED_Zh0OaE7DR2BkStF10_YSaH1fOM,199
15
+ rtty_soda/encoders/functions.py,sha256=JxtgbZg3kdbFqAhjm59QwJS6zEXYsR1m02k7cg_rFI4,1385
16
+ rtty_soda/encoders/raw_encoder.py,sha256=wvOzPG9SvoEaOOOsLfHR8KIdAbSs_6RMAhIyuVmlNFw,237
17
+ rtty_soda/main.py,sha256=g_IHKlQMpv4gquw8NfQVRxV5mv84dp0PsXQAwL49Vjo,16298
18
+ rtty_soda/main.pyi,sha256=1_ahHQ89q7lC2cQ0Vgk4QXwsP0G9c10XYGvrVsO1U0s,2203
19
+ rtty_soda/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
+ rtty_soda-0.2.0.dist-info/WHEEL,sha256=ELhySV62sOro8I5wRaLaF3TWxhBpkcDkdZUdAYLy_Hk,78
21
+ rtty_soda-0.2.0.dist-info/entry_points.txt,sha256=tFROKkaDoE_p5tM2ko7MoAjWBFurchcw3j-MdObxBU0,45
22
+ rtty_soda-0.2.0.dist-info/METADATA,sha256=Kt9mN0FEH1aPDnVuOwoWT-29hJFa6hH_Y7qt53qEsfE,9657
23
+ rtty_soda-0.2.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.8.22
2
+ Generator: uv 0.9.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,254 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: rtty-soda
3
- Version: 0.1.6
4
- Summary: A CLI tool for Unix-like environments to encrypt a RTTY session using NaCl
5
- Keywords: cli,encryption,libsodium,nacl,rtty
6
- Author: Theo Saveliev
7
- Author-email: Theo Saveliev <89431871+theosaveliev@users.noreply.github.com>
8
- License: MIT
9
- Classifier: Development Status :: 4 - Beta
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Operating System :: POSIX
12
- Classifier: Environment :: Console
13
- Classifier: Intended Audience :: End Users/Desktop
14
- Classifier: License :: OSI Approved :: MIT License
15
- Classifier: Topic :: Communications
16
- Classifier: Topic :: Security :: Cryptography
17
- Classifier: Topic :: Utilities
18
- Requires-Dist: click>=8.2.1,<9.0.0
19
- Requires-Dist: click-aliases>=1.0.5,<2.0.0
20
- Requires-Dist: pynacl>=1.5.0,<2.0.0
21
- Requires-Python: >=3.13, <4.0
22
- Project-URL: github, https://github.com/theosaveliev/rtty-soda
23
- Project-URL: issues, https://github.com/theosaveliev/rtty-soda/issues
24
- Description-Content-Type: text/markdown
25
-
26
- # rtty-soda
27
-
28
- A CLI tool for Unix-like environments to encrypt a RTTY session using NaCl.
29
-
30
-
31
- #### Features
32
-
33
- - Public Key encryption (Curve25519-XSalsa20-Poly1305)
34
- - Secret Key encryption (XSalsa20-Poly1305)
35
- - Key derivation (Argon2id-Blake2b)
36
- - Password encryption
37
- - Text compression (zlib, bz2, lzma)
38
- - Custom encodings
39
-
40
-
41
- ## Installation
42
- #### Package manager
43
-
44
- 1. [Install uv](https://docs.astral.sh/uv/getting-started/installation/)
45
- 2. Install rtty-soda:
46
- ```
47
- % uv tool install rtty-soda
48
- ```
49
- 3. Remove rtty-soda:
50
- ```
51
- % uv tool uninstall rtty-soda
52
- ```
53
-
54
- #### Docker
55
-
56
- ```
57
- % docker run -it --rm -h rtty-soda -v .:/app/host nett/rtty-soda:0.1.6
58
- % docker run -it --rm -h rtty-soda -v .:/app/host nett/rtty-soda:0.1.6-tools
59
- ```
60
-
61
-
62
- ## Getting help
63
-
64
- All commands have `[-h | --help]` option.
65
-
66
- ```
67
- % soda
68
- Usage: soda [OPTIONS] COMMAND [ARGS]...
69
-
70
- Options:
71
- --version Show the version and exit.
72
- -h, --help Show this message and exit.
73
-
74
- Commands:
75
- decrypt-password (dp) Decrypt Message (Password).
76
- decrypt-public (d) Decrypt Message (Public).
77
- decrypt-secret (ds) Decrypt Message (Secret).
78
- encode Encode File.
79
- encrypt-password (ep) Encrypt Message (Password).
80
- encrypt-public (e) Encrypt Message (Public).
81
- encrypt-secret (es) Encrypt Message (Secret).
82
- genkey Generate Private Key.
83
- kdf Key Derivation Function.
84
- pubkey Get Public Key.
85
- ```
86
-
87
- Some commands have aliases, so `% soda encrypt-password ...` and `% soda ep ...`
88
- are equivalent.
89
-
90
-
91
- ## Public Key encryption
92
- #### Key generation
93
-
94
- ```
95
- % soda genkey | tee alice | soda pubkey - | tee alice_pub
96
- R5xUCEhvkRRwQD+iWo2hV65fIsWucUZtiFJGKy6pTyA=
97
-
98
- % soda genkey | tee bob | soda pubkey - | tee bob_pub
99
- woNtqALnGLzp8VBuzJ8T13E4OZRv5YZy6kXMBpV8/mI=
100
- ```
101
-
102
- #### Encryption
103
-
104
- Alice sends the message to Bob:
105
-
106
- ```
107
- % cat message
108
- A telegraph key is a specialized electrical switch used by a trained operator to
109
- transmit text messages in Morse code in a telegraphy system.
110
- The first telegraph key was invented by Alfred Vail, an associate of Samuel Morse.
111
- (c) Wikipedia
112
-
113
- % soda encrypt-public alice bob_pub message --output-file encrypted
114
- Plaintext: 239
115
- Ciphertext: 280
116
- Overhead: 1.172
117
-
118
- % cat encrypted
119
- xaLTAu3qD/h7cUspHL2HP0HVASovUE84WnWBj+uHgIqNPzxVhUoObILvDlb2WBJqiXmhMHSXpdMBMSiewdXtU9m
120
- YlNumkJ8qq+pzsBL3Lrrjdg3jdoeMkweyR9xUY2QytR91Qi9Cga5GM5tTO+rHB6yriThUp2XGEQ1Bap358AT8u/
121
- dJ7dOzaAv2ei5LfgqtlGmetACfXqxG5SunrOqWvmxpi2QI3FqWUkOLUl00Rj/ZnISmZRsDjekKgJcknKit498cL
122
- 7AVUKQA5PxFm4ZN9Q==
123
- ```
124
-
125
- #### Decryption
126
-
127
- ```
128
- $ soda decrypt-public bob alice_pub encrypted
129
-
130
- A telegraph key is a specialized electrical switch used by a trained operator to
131
- transmit text messages in Morse code in a telegraphy system.
132
- The first telegraph key was invented by Alfred Vail, an associate of Samuel Morse.
133
- (c) Wikipedia
134
-
135
- Plaintext: 239
136
- Ciphertext: 280
137
- Overhead: 1.172
138
- ```
139
-
140
-
141
- ## Secret Key encryption
142
-
143
- Alice and Bob share a key for symmetric encryption:
144
-
145
- ```
146
- % soda genkey > shared
147
- % soda encrypt-secret shared message > encrypted
148
- Plaintext: 239
149
- Ciphertext: 280
150
- Overhead: 1.172
151
-
152
- % soda decrypt-secret shared encrypted -o message
153
- Overwrite the output file? (message) [y/N]: y
154
- Plaintext: 239
155
- Ciphertext: 280
156
- Overhead: 1.172
157
- ```
158
-
159
- Another day, they share a password:
160
-
161
- ```
162
- % echo qwerty | soda encrypt-password - message -p interactive > encrypted
163
- Plaintext: 239
164
- Ciphertext: 280
165
- Overhead: 1.172
166
-
167
- % echo qwerty | soda decrypt-password - encrypted -p interactive > plain
168
- Plaintext: 239
169
- Ciphertext: 280
170
- Overhead: 1.172
171
- ```
172
-
173
-
174
- ## Key derivation
175
-
176
- The KDF function derives the key from the password.
177
- It accepts different profiles: interactive, moderate, and sensitive.
178
-
179
- ```
180
- % echo qwerty > password
181
- % time soda kdf password
182
- jNLXU8/Ne5ZC8KuhDYqPUBg7xrxwv8J6yDJgCcFib9g=
183
- real 0m7.850s
184
- user 0m7.386s
185
- sys 0m0.461s
186
-
187
- % time soda kdf password --profile interactive
188
- HqbvUXflAG+no3YS9njezZ3leyr8IwERAyeNoG2l41U=
189
- real 0m0.295s
190
- user 0m0.279s
191
- sys 0m0.014s
192
- ```
193
-
194
-
195
- ## Text compression
196
-
197
- That works as follows:
198
- 1. The plaintext is compressed with the compression lib
199
- 2. The 16-byte MAC and 24-byte nonce are added
200
- 3. The result is encoded with Base64, which adds ~25% overhead
201
-
202
- Aside from the default zlib, there are more compression options. \
203
- For a short message, the raw option provides smaller output.
204
- For a long text, the bz2 showed the best results. \
205
- Overall, encrypting a letter into 1.172 letters is a working solution.
206
-
207
- ```
208
- % soda encrypt-public alice bob_pub message --compression zlib > /dev/null
209
- Plaintext: 239
210
- Ciphertext: 280
211
- Overhead: 1.172
212
- % soda encrypt-public alice bob_pub message --compression bz2 > /dev/null
213
- Plaintext: 239
214
- Ciphertext: 344
215
- Overhead: 1.439
216
- % soda encrypt-public alice bob_pub message --compression lzma > /dev/null
217
- Plaintext: 239
218
- Ciphertext: 324
219
- Overhead: 1.356
220
- % soda encrypt-public alice bob_pub message --compression raw > /dev/null
221
- Plaintext: 239
222
- Ciphertext: 372
223
- Overhead: 1.556
224
- ```
225
-
226
-
227
- ## Encoding
228
-
229
- The rtty-soda supports various encodings:
230
-
231
- - Base26 (Latin)
232
- - Base36 (Latin with numbers)
233
- - Base64 (RFC 3548)
234
- - Base94 (ASCII printable)
235
- - Binary
236
-
237
- ```
238
- % soda encrypt-public alice bob_pub message --data-encoding base36
239
-
240
- 67EG0R6HNKWJCVWF76SXDVXBUVR2L1CZ5WNZ2O1GHVM6488OGHZGIVX6GQE19V7VMSHFWOQD09GRIOOFSUXFRVG
241
- M2UNVG9NN9X2113FA6JNQ8082WQ38YNQ5KUXHB82SD7HK4YHQDODYTA3O8WY93T6EG5ZX5JB9W1IETKC4D7TOHT
242
- K7ZROL69IYLZVT9MCIPX7V6IX259F4RGC6PRKVNTP8HRLYZZVU4B1V5Y1HZV0AFGLEIPYECEKN7WC7ZL1YVTWJQ
243
- 458E5E9ZK4E731MCFO8USWBHJ7SM9PTK4IP5NFFB28WWS6KVWU9RBV1WL11MT
244
-
245
- Plaintext: 239
246
- Ciphertext: 322
247
- Overhead: 1.347
248
- ```
249
-
250
-
251
- ## Compatibility
252
-
253
- During the initial development (versions prior to 1.0.0),
254
- I can break backwards compatibility.