rtty-soda 0.1.3__tar.gz → 0.1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rtty-soda might be problematic. Click here for more details.
- {rtty_soda-0.1.3 → rtty_soda-0.1.4}/PKG-INFO +3 -3
- {rtty_soda-0.1.3 → rtty_soda-0.1.4}/README.md +2 -2
- {rtty_soda-0.1.3 → rtty_soda-0.1.4}/pyproject.toml +1 -1
- {rtty_soda-0.1.3 → rtty_soda-0.1.4}/src/rtty_soda/cli_io.py +11 -1
- {rtty_soda-0.1.3 → rtty_soda-0.1.4}/src/rtty_soda/encoders/functions.py +3 -0
- {rtty_soda-0.1.3 → rtty_soda-0.1.4}/src/rtty_soda/__init__.py +0 -0
- {rtty_soda-0.1.3 → rtty_soda-0.1.4}/src/rtty_soda/archivers.py +0 -0
- {rtty_soda-0.1.3 → rtty_soda-0.1.4}/src/rtty_soda/cryptography/__init__.py +0 -0
- {rtty_soda-0.1.3 → rtty_soda-0.1.4}/src/rtty_soda/cryptography/kdf.py +0 -0
- {rtty_soda-0.1.3 → rtty_soda-0.1.4}/src/rtty_soda/cryptography/public.py +0 -0
- {rtty_soda-0.1.3 → rtty_soda-0.1.4}/src/rtty_soda/cryptography/secret.py +0 -0
- {rtty_soda-0.1.3 → rtty_soda-0.1.4}/src/rtty_soda/encoders/__init__.py +0 -0
- {rtty_soda-0.1.3 → rtty_soda-0.1.4}/src/rtty_soda/encoders/base26_encoder.py +0 -0
- {rtty_soda-0.1.3 → rtty_soda-0.1.4}/src/rtty_soda/encoders/base36_encoder.py +0 -0
- {rtty_soda-0.1.3 → rtty_soda-0.1.4}/src/rtty_soda/encoders/base94_encoder.py +0 -0
- {rtty_soda-0.1.3 → rtty_soda-0.1.4}/src/rtty_soda/main.py +0 -0
- {rtty_soda-0.1.3 → rtty_soda-0.1.4}/src/rtty_soda/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: rtty-soda
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: A CLI tool for Unix-like environments to encrypt a RTTY session using NaCl
|
|
5
5
|
Keywords: cli,encryption,libsodium,nacl,rtty
|
|
6
6
|
Author: Theo Saveliev
|
|
@@ -54,8 +54,8 @@ A CLI tool for Unix-like environments to encrypt a RTTY session using NaCl.
|
|
|
54
54
|
#### Docker
|
|
55
55
|
|
|
56
56
|
```
|
|
57
|
-
% docker run -it --rm -h rtty-soda -v .:/app/host nett/rtty-soda:0.1.
|
|
58
|
-
% docker run -it --rm -h rtty-soda -v .:/app/host nett/rtty-soda:0.1.
|
|
57
|
+
% docker run -it --rm -h rtty-soda -v .:/app/host nett/rtty-soda:0.1.4
|
|
58
|
+
% docker run -it --rm -h rtty-soda -v .:/app/host nett/rtty-soda:0.1.4-tools
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
|
|
@@ -29,8 +29,8 @@ A CLI tool for Unix-like environments to encrypt a RTTY session using NaCl.
|
|
|
29
29
|
#### Docker
|
|
30
30
|
|
|
31
31
|
```
|
|
32
|
-
% docker run -it --rm -h rtty-soda -v .:/app/host nett/rtty-soda:0.1.
|
|
33
|
-
% docker run -it --rm -h rtty-soda -v .:/app/host nett/rtty-soda:0.1.
|
|
32
|
+
% docker run -it --rm -h rtty-soda -v .:/app/host nett/rtty-soda:0.1.4
|
|
33
|
+
% docker run -it --rm -h rtty-soda -v .:/app/host nett/rtty-soda:0.1.4-tools
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import random
|
|
1
2
|
import re
|
|
3
|
+
import string
|
|
2
4
|
from pathlib import Path
|
|
3
5
|
from typing import TextIO, cast
|
|
4
6
|
|
|
@@ -14,6 +16,7 @@ __all__ = [
|
|
|
14
16
|
"read_plaintext_bytes",
|
|
15
17
|
"read_str",
|
|
16
18
|
"remove_whitespace",
|
|
19
|
+
"write_bytes_atomic",
|
|
17
20
|
"write_output",
|
|
18
21
|
]
|
|
19
22
|
|
|
@@ -51,6 +54,13 @@ def read_ciphertext_bytes(source: Path, in_enc: Encoder) -> bytes:
|
|
|
51
54
|
return read_clean_bytes(source)
|
|
52
55
|
|
|
53
56
|
|
|
57
|
+
def write_bytes_atomic(target: Path, data: bytes) -> None:
|
|
58
|
+
temp_name = "".join(random.choices(string.ascii_lowercase, k=10)) # noqa: S311
|
|
59
|
+
temp_path = target.parent / temp_name
|
|
60
|
+
temp_path.write_bytes(data)
|
|
61
|
+
temp_path.replace(target)
|
|
62
|
+
|
|
63
|
+
|
|
54
64
|
def write_output(target: Path | None, data: bytes, out_enc: Encoder) -> None:
|
|
55
65
|
if target is None or target.stem == "-":
|
|
56
66
|
if out_enc == RawEncoder:
|
|
@@ -67,7 +77,7 @@ def write_output(target: Path | None, data: bytes, out_enc: Encoder) -> None:
|
|
|
67
77
|
f"Overwrite the output file? ({target})", default=False, abort=True
|
|
68
78
|
)
|
|
69
79
|
|
|
70
|
-
target
|
|
80
|
+
write_bytes_atomic(target, data)
|
|
71
81
|
|
|
72
82
|
|
|
73
83
|
def print_stats(plaintext: bytes, ciphertext: bytes) -> None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|