Skip to content

Commit

Permalink
Update to v4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Amis Shokoohi committed Feb 23, 2023
1 parent 67bd4ca commit b947995
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 22 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [4.0.0]

### Changed

- `1ba75a5` Bumped cryptography from 39.0.0 to 39.0.1

## [4.0.0-rc.2]

### Added
Expand Down
62 changes: 42 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<p align="center">
<img src="https://user-images.githubusercontent.com/24605263/214285260-80aed843-17e6-4a2f-98bf-bfb21f900dff.png">
</p>
<div align="center">
<img
src="https://user-images.githubusercontent.com/24605263/214285260-80aed843-17e6-4a2f-98bf-bfb21f900dff.png"
alt="kapak - A simple-to-use file encryption script"
>
</div>
<div align="center">

[![tests](https://github.com/amis-shokoohi/kapak/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/amis-shokoohi/kapak/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/amis-shokoohi/kapak/branch/main/graph/badge.svg?token=6W2V3QOZKP)](https://codecov.io/gh/amis-shokoohi/kapak)
Expand All @@ -10,9 +15,13 @@
![GitHub Repo stars](https://img.shields.io/github/stars/amis-shokoohi/kapak)
![GitHub forks](https://img.shields.io/github/forks/amis-shokoohi/kapak)

# kapak: A simple-to-use file encryption script
</div>

**Kapak** is a simple-to-use **file encryption** script/library.<br>
It uses `AES_256_CBC` as its encryption cipher.

> If you are wondering what _kapak_ means, it means _mold_.
- [Description](#description)
- [Installation](#installation)
- [CLI Usage](#cli-usage)
- [Encrypt file](#cli-usage-encrypt-file)
Expand All @@ -21,21 +30,14 @@
- [Integration](#integration)
- [Encrypt file](#integration-encrypt-file)
- [Encrypt stdin](#integration-encrypt-stdin)

<span id="description"></span>

## Description

Kapak is a simple-to-use **file encryption** script.<br>
It uses `AES_256_CBC` as its encryption cipher and <br>
`scrypt` key derivation algorithm to generate a 256 bit key.

> If you are wondering what _kapak_ means, it means _mold_.
- [Encrypt anything](#integration-encrypt-anything)

<span id="installation"></span>

## Installation

Installing with `pip`:

```
pip install kapak
```
Expand Down Expand Up @@ -156,12 +158,11 @@ with input_file.open("rb") as src, output_file.open("wb") as dst:
### Encrypt stdin

```py
import io
import sys
import base64
from io import BytesIO
from kapak.aes import encrypt

with io.BytesIO() as dst:
with BytesIO() as dst:
for _ in encrypt(
src=sys.stdin.buffer,
dst=dst,
Expand All @@ -170,6 +171,27 @@ with io.BytesIO() as dst:
):
pass
encrypted_data = dst.getvalue()
encrypted_data_base64 = base64.standard_b64encode(encrypted_data)
print(encrypted_data_base64.decode("utf-8"))
print(encrypted_data.hex())
```

<span id="integration-encrypt-anything"></span>

### Encrypt anything

```py
from io import BytesIO
from kapak.aes import encrypt

anything = b"anything"

with BytesIO(anything) as src, BytesIO() as dst:
for _ in encrypt(
src=src,
dst=dst,
password="P@ssw0rd",
buffer_size=1024
):
pass
encrypted_data = dst.getvalue()
print(encrypted_data.hex())
```
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "kapak"
version = "4.0.0-rc.2"
version = "4.0.0"
description = "A simple-to-use file encryption script"
authors = ["Amis Shokoohi <[email protected]>"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/kapak/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "4.0.0-rc.2"
__version__ = "4.0.0"

0 comments on commit b947995

Please sign in to comment.