Skip to content

Commit 75df6bd

Browse files
add
1 parent 7e1e966 commit 75df6bd

4 files changed

Lines changed: 311 additions & 69 deletions

File tree

src/cli/app.dist/Cryptodome/Util/.keep_dir.txt

Whitespace-only changes.

src/cli/app/main.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
from async_typer import AsyncTyper
2-
import os
3-
from cryptography.hazmat.primitives.ciphers.aead import ChaCha20Poly1305
2+
import py7zr
43

54
app = AsyncTyper()
65

76

8-
key = ChaCha20Poly1305.generate_key()
9-
chacha = ChaCha20Poly1305(key)
10-
11-
12-
nonce = os.urandom(12)
13-
14-
157
@app.async_command()
168
async def hello(name: str):
17-
ciphertext = chacha.encrypt(nonce, f"hello {name}".encode(), None)
18-
19-
print(ciphertext)
9+
filters = [
10+
{
11+
"id": py7zr.FILTER_LZMA2,
12+
"preset": 9,
13+
"dict_size": 1024 * 1024 * 512,
14+
}
15+
]
16+
with py7zr.SevenZipFile(
17+
"Archive.7z",
18+
"w",
19+
filters=filters,
20+
) as archive:
21+
archive.writeall("test/")

src/cli/pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ dependencies = [
1010
"async-typer>=0.1.10",
1111
# Asnyc loop implementation
1212
"uvloop>=0.22.1;sys_platform=='linux'",
13-
# Cryptography helper
14-
"cryptography>=46.0.3",
1513
# Http Client
1614
"httpx[http2]>=0.28.1",
15+
"py7zr>=1.1.2",
1716
]
1817

1918

0 commit comments

Comments
 (0)