des-PurePy 1.0.6__tar.gz → 1.0.8__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.
@@ -1,39 +1,39 @@
1
- # This workflow will install Python dependencies, run tests and lint with a single version of Python
2
- # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
-
4
- name: DES-Python
5
-
6
- on:
7
- push:
8
- branches: [ "main" ]
9
- pull_request:
10
- branches: [ "main" ]
11
-
12
- permissions:
13
- contents: read
14
-
15
- jobs:
16
- build:
17
-
18
- runs-on: ubuntu-latest
19
-
20
- steps:
21
- - uses: actions/checkout@v4
22
- - name: Set up Python 3.10
23
- uses: actions/setup-python@v3
24
- with:
25
- python-version: "3.10"
26
- - name: Install dependencies
27
- run: |
28
- python -m pip install --upgrade pip
29
- pip install flake8 pytest
30
- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31
- - name: Lint with flake8
32
- run: |
33
- # stop the build if there are Python syntax errors or undefined names
34
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35
- # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37
- - name: Test with pytest
38
- run: |
39
- pytest test.py
1
+ # This workflow will install Python dependencies, run tests and lint with a single version of Python
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
+
4
+ name: DES-Python
5
+
6
+ on:
7
+ push:
8
+ branches: [ "main" ]
9
+ pull_request:
10
+ branches: [ "main" ]
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ jobs:
16
+ build:
17
+
18
+ runs-on: ubuntu-latest
19
+
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ - name: Set up Python 3.10
23
+ uses: actions/setup-python@v3
24
+ with:
25
+ python-version: "3.10"
26
+ - name: Install dependencies
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+ pip install flake8 pytest des_PurePy
30
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31
+ - name: Lint with flake8
32
+ run: |
33
+ # stop the build if there are Python syntax errors or undefined names
34
+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36
+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37
+ - name: Test with pytest
38
+ run: |
39
+ pytest
@@ -0,0 +1,67 @@
1
+ Metadata-Version: 2.4
2
+ Name: des_PurePy
3
+ Version: 1.0.8
4
+ Summary: A pure python implementation of DES
5
+ Project-URL: Homepage, https://github.com/Perez-Herrera-Luna/DES-Python
6
+ Author-email: Luna Perez-Herrera <lunaperezherrer@gmail.com>
7
+ License-Expression: AGPL-3.0-only
8
+ License-File: LICENSE
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Programming Language :: Python :: 3
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown
13
+
14
+ # DES-Python
15
+
16
+ ![made-with-python](https://img.shields.io/badge/Made%20with-Python%203-1f425f.svg)
17
+ [![license: AGPL-3.0](https://img.shields.io/github/license/Perez-Herrera-Luna/DES-Python.svg)](https://github.com/Perez-Herrera-Luna/DES-Python/blob/main/LICENSE)
18
+ [![DES-Python](https://github.com/Perez-Herrera-Luna/DES-Python/actions/workflows/python-app.yml/badge.svg)](https://github.com/Perez-Herrera-Luna/DES-Python/actions/workflows/python-app.yml)
19
+
20
+ Data Encryption Standard (DES) implemented in pure Python
21
+
22
+ ![Demo](https://github.com/user-attachments/assets/aaa905df-d924-4d52-80f4-b06390c1b523)
23
+
24
+ ## Features
25
+
26
+ - **Encryption and Decryption**
27
+ - **PKCS5 Padding**
28
+ - **ECB Mode of Operation**
29
+ - **Hex String and Bytes Object Support**
30
+
31
+ ## Installation
32
+
33
+ Install using your Python package manager of choice:
34
+ ```bash
35
+ pip install des_PurePy
36
+ ```
37
+
38
+ ## Usage
39
+ ### Encrypting Hex Strings
40
+ Define a `DES` object while passing in your key. The key can be a hex string or a bytes object.
41
+ ```python
42
+ import des_PurePy
43
+ des = des_PurePy.DES("0x133457799bbcdff1")
44
+ ```
45
+ You can encrypt by calling `encrypt()` and passing in a hex string or bytes object.
46
+ ```python
47
+ des.encrypt("0x0123456789abcdef") # -> "0x85e813540f0ab405fdf2e174492922f8"
48
+ ```
49
+ You can simarly decrypt by calling `decrypt()` and passing in a hex string or bytes object.
50
+ ```python
51
+ des.decrypt("0x85e813540f0ab405fdf2e174492922f8") # -> "0x0123456789abcdef"
52
+ ```
53
+ By default, encryption input is padded to a multiple of the block size (8 bytes) according to PKCS5. Inputs that are multiple blocks long are encrypted using the Electronic Code Book (ECB) mode of operation.
54
+ ### Encrypting Bytes Objects and Text
55
+ Inputs can be hex strings or bytes objects. The key must always be 8 bytes but the encryption input can have any size.
56
+ Because of the bytes object support, with some work, you can encrypt and decrypt text.
57
+ ```python
58
+ import des_PurePy
59
+
60
+ key = b"password"
61
+ des = des_PurePy.DES(key)
62
+
63
+ ciphertext = des.encrypt(b"secret message") # -> "0x0d417ca7d23582bab5e2c9277f801591"
64
+ cleartext = des.decrypt(ciphertext) # -> "0x736563726574206d657373616765"
65
+ cleartext = bytes.fromhex(cleartext[2:]).decode("utf-8") # -> "secret message"
66
+ ```
67
+ Note that all input is validated so if you passing in an inapropriate input the module will raise a corresponding error.
@@ -0,0 +1,54 @@
1
+ # DES-Python
2
+
3
+ ![made-with-python](https://img.shields.io/badge/Made%20with-Python%203-1f425f.svg)
4
+ [![license: AGPL-3.0](https://img.shields.io/github/license/Perez-Herrera-Luna/DES-Python.svg)](https://github.com/Perez-Herrera-Luna/DES-Python/blob/main/LICENSE)
5
+ [![DES-Python](https://github.com/Perez-Herrera-Luna/DES-Python/actions/workflows/python-app.yml/badge.svg)](https://github.com/Perez-Herrera-Luna/DES-Python/actions/workflows/python-app.yml)
6
+
7
+ Data Encryption Standard (DES) implemented in pure Python
8
+
9
+ ![Demo](https://github.com/user-attachments/assets/aaa905df-d924-4d52-80f4-b06390c1b523)
10
+
11
+ ## Features
12
+
13
+ - **Encryption and Decryption**
14
+ - **PKCS5 Padding**
15
+ - **ECB Mode of Operation**
16
+ - **Hex String and Bytes Object Support**
17
+
18
+ ## Installation
19
+
20
+ Install using your Python package manager of choice:
21
+ ```bash
22
+ pip install des_PurePy
23
+ ```
24
+
25
+ ## Usage
26
+ ### Encrypting Hex Strings
27
+ Define a `DES` object while passing in your key. The key can be a hex string or a bytes object.
28
+ ```python
29
+ import des_PurePy
30
+ des = des_PurePy.DES("0x133457799bbcdff1")
31
+ ```
32
+ You can encrypt by calling `encrypt()` and passing in a hex string or bytes object.
33
+ ```python
34
+ des.encrypt("0x0123456789abcdef") # -> "0x85e813540f0ab405fdf2e174492922f8"
35
+ ```
36
+ You can simarly decrypt by calling `decrypt()` and passing in a hex string or bytes object.
37
+ ```python
38
+ des.decrypt("0x85e813540f0ab405fdf2e174492922f8") # -> "0x0123456789abcdef"
39
+ ```
40
+ By default, encryption input is padded to a multiple of the block size (8 bytes) according to PKCS5. Inputs that are multiple blocks long are encrypted using the Electronic Code Book (ECB) mode of operation.
41
+ ### Encrypting Bytes Objects and Text
42
+ Inputs can be hex strings or bytes objects. The key must always be 8 bytes but the encryption input can have any size.
43
+ Because of the bytes object support, with some work, you can encrypt and decrypt text.
44
+ ```python
45
+ import des_PurePy
46
+
47
+ key = b"password"
48
+ des = des_PurePy.DES(key)
49
+
50
+ ciphertext = des.encrypt(b"secret message") # -> "0x0d417ca7d23582bab5e2c9277f801591"
51
+ cleartext = des.decrypt(ciphertext) # -> "0x736563726574206d657373616765"
52
+ cleartext = bytes.fromhex(cleartext[2:]).decode("utf-8") # -> "secret message"
53
+ ```
54
+ Note that all input is validated so if you passing in an inapropriate input the module will raise a corresponding error.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "des_PurePy"
3
- version = "1.0.6"
3
+ version = "1.0.8"
4
4
  authors = [
5
5
  { name="Luna Perez-Herrera", email="lunaperezherrer@gmail.com" },
6
6
  ]
des_purepy-1.0.6/PKG-INFO DELETED
@@ -1,53 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: des_PurePy
3
- Version: 1.0.6
4
- Summary: A pure python implementation of DES
5
- Project-URL: Homepage, https://github.com/Perez-Herrera-Luna/DES-Python
6
- Author-email: Luna Perez-Herrera <lunaperezherrer@gmail.com>
7
- License-Expression: AGPL-3.0-only
8
- License-File: LICENSE
9
- Classifier: Operating System :: OS Independent
10
- Classifier: Programming Language :: Python :: 3
11
- Requires-Python: >=3.9
12
- Description-Content-Type: text/markdown
13
-
14
- # DES-Python
15
-
16
- ![made-with-python](https://img.shields.io/badge/Made%20with-Python%203-1f425f.svg)
17
- [![license: AGPL-3.0](https://img.shields.io/github/license/Perez-Herrera-Luna/DES-Python.svg)](https://github.com/Perez-Herrera-Luna/DES-Python/blob/main/LICENSE)
18
- [![DES-Python](https://github.com/Perez-Herrera-Luna/DES-Python/actions/workflows/python-app.yml/badge.svg)](https://github.com/Perez-Herrera-Luna/DES-Python/actions/workflows/python-app.yml)
19
-
20
- Data Encryption Standard (DES) implemented in pure Python
21
-
22
- ![Demo](https://github.com/user-attachments/assets/aaa905df-d924-4d52-80f4-b06390c1b523)
23
-
24
- ## Installation
25
-
26
- Install using your Python package manager of choice:
27
- ```bash
28
- pip install des_Py
29
- ```
30
-
31
- ```
32
- Plaintext: 0x0123456789abcdef
33
- Key: 0x133457799bbcdff1
34
- Ciphertext: 0x85e813540f0ab405
35
- Decrypted text: 0x0123456789abcdef
36
- ```
37
-
38
- ## Usage
39
-
40
- ### 1. DES
41
- Define a `DES` object while passing in your key. Key should be a hex string representing an 8 byte hexadecimal number.
42
- ```python
43
- import des_Py
44
- des = des_Py.DES("0x133457799bbcdff1")
45
- ```
46
- You can encrypt by calling `encrypt()` and passing in a hex string representing an 8 byte hexadecimal number
47
- ```python
48
- des.encrypt("0x0123456789abcdef") # -> "0x85e813540f0ab405"
49
- ```
50
- You can simarly decrypt by calling `decrypt()` and passing in a hex string to decrypt
51
- ```python
52
- des.decrypt("0x85e813540f0ab405") # -> "0x0123456789abcdef"
53
- ```
@@ -1,40 +0,0 @@
1
- # DES-Python
2
-
3
- ![made-with-python](https://img.shields.io/badge/Made%20with-Python%203-1f425f.svg)
4
- [![license: AGPL-3.0](https://img.shields.io/github/license/Perez-Herrera-Luna/DES-Python.svg)](https://github.com/Perez-Herrera-Luna/DES-Python/blob/main/LICENSE)
5
- [![DES-Python](https://github.com/Perez-Herrera-Luna/DES-Python/actions/workflows/python-app.yml/badge.svg)](https://github.com/Perez-Herrera-Luna/DES-Python/actions/workflows/python-app.yml)
6
-
7
- Data Encryption Standard (DES) implemented in pure Python
8
-
9
- ![Demo](https://github.com/user-attachments/assets/aaa905df-d924-4d52-80f4-b06390c1b523)
10
-
11
- ## Installation
12
-
13
- Install using your Python package manager of choice:
14
- ```bash
15
- pip install des_Py
16
- ```
17
-
18
- ```
19
- Plaintext: 0x0123456789abcdef
20
- Key: 0x133457799bbcdff1
21
- Ciphertext: 0x85e813540f0ab405
22
- Decrypted text: 0x0123456789abcdef
23
- ```
24
-
25
- ## Usage
26
-
27
- ### 1. DES
28
- Define a `DES` object while passing in your key. Key should be a hex string representing an 8 byte hexadecimal number.
29
- ```python
30
- import des_Py
31
- des = des_Py.DES("0x133457799bbcdff1")
32
- ```
33
- You can encrypt by calling `encrypt()` and passing in a hex string representing an 8 byte hexadecimal number
34
- ```python
35
- des.encrypt("0x0123456789abcdef") # -> "0x85e813540f0ab405"
36
- ```
37
- You can simarly decrypt by calling `decrypt()` and passing in a hex string to decrypt
38
- ```python
39
- des.decrypt("0x85e813540f0ab405") # -> "0x0123456789abcdef"
40
- ```
File without changes
File without changes
File without changes