libfcrypt 1.1.0__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.
- libfcrypt-1.1.0/.rumdl_cache/.gitignore +2 -0
- libfcrypt-1.1.0/.rumdl_cache/0.2.73/23a74fd7ca3e346967810622f2fa6a57642e8a96022bec585f3ac897dcc66904_d69683f784488ae1.json +98 -0
- libfcrypt-1.1.0/.rumdl_cache/CACHEDIR.TAG +2 -0
- libfcrypt-1.1.0/.rumdl_cache/workspace_index.bin +0 -0
- libfcrypt-1.1.0/LICENSE +21 -0
- libfcrypt-1.1.0/PKG-INFO +69 -0
- libfcrypt-1.1.0/README.md +55 -0
- libfcrypt-1.1.0/libfcrypt/__init__.py +5 -0
- libfcrypt-1.1.0/libfcrypt/base.py +19 -0
- libfcrypt-1.1.0/libfcrypt/file.py +8 -0
- libfcrypt-1.1.0/pyproject.toml +23 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"file_hash": "23a74fd7ca3e346967810622f2fa6a57642e8a96022bec585f3ac897dcc66904",
|
|
3
|
+
"config_hash": "760cce412e2e466cfe4e6c3405e8cf763f30b37e780c8849844abba783ad1dd0",
|
|
4
|
+
"rules_hash": "d69683f784488ae1fb4f02711b0a7b9c2d96863e15824e72d42e85754a5f834d",
|
|
5
|
+
"version": "0.2.73",
|
|
6
|
+
"warnings": [
|
|
7
|
+
{
|
|
8
|
+
"message": "Multiple consecutive blank lines between content",
|
|
9
|
+
"line": 5,
|
|
10
|
+
"column": 1,
|
|
11
|
+
"end_line": 5,
|
|
12
|
+
"end_column": 1,
|
|
13
|
+
"severity": "warning",
|
|
14
|
+
"fix": {
|
|
15
|
+
"range": {
|
|
16
|
+
"start": 81,
|
|
17
|
+
"end": 82
|
|
18
|
+
},
|
|
19
|
+
"replacement": ""
|
|
20
|
+
},
|
|
21
|
+
"rule_name": "MD012"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"message": "Line length 92 exceeds 80 characters",
|
|
25
|
+
"line": 9,
|
|
26
|
+
"column": 81,
|
|
27
|
+
"end_line": 9,
|
|
28
|
+
"end_column": 93,
|
|
29
|
+
"severity": "warning",
|
|
30
|
+
"fix": null,
|
|
31
|
+
"rule_name": "MD013"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"message": "Unexpected blank line between list items",
|
|
35
|
+
"line": 11,
|
|
36
|
+
"column": 1,
|
|
37
|
+
"end_line": 11,
|
|
38
|
+
"end_column": 1,
|
|
39
|
+
"severity": "warning",
|
|
40
|
+
"fix": {
|
|
41
|
+
"range": {
|
|
42
|
+
"start": 325,
|
|
43
|
+
"end": 326
|
|
44
|
+
},
|
|
45
|
+
"replacement": ""
|
|
46
|
+
},
|
|
47
|
+
"rule_name": "MD076"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"message": "Line length 107 exceeds 80 characters",
|
|
51
|
+
"line": 12,
|
|
52
|
+
"column": 81,
|
|
53
|
+
"end_line": 12,
|
|
54
|
+
"end_column": 108,
|
|
55
|
+
"severity": "warning",
|
|
56
|
+
"fix": null,
|
|
57
|
+
"rule_name": "MD013"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"message": "Line length 101 exceeds 80 characters",
|
|
61
|
+
"line": 13,
|
|
62
|
+
"column": 81,
|
|
63
|
+
"end_line": 13,
|
|
64
|
+
"end_column": 102,
|
|
65
|
+
"severity": "warning",
|
|
66
|
+
"fix": null,
|
|
67
|
+
"rule_name": "MD013"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"message": "Line length 87 exceeds 80 characters",
|
|
71
|
+
"line": 22,
|
|
72
|
+
"column": 81,
|
|
73
|
+
"end_line": 22,
|
|
74
|
+
"end_column": 88,
|
|
75
|
+
"severity": "warning",
|
|
76
|
+
"fix": null,
|
|
77
|
+
"rule_name": "MD013"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"message": "No blank line before fenced code block",
|
|
81
|
+
"line": 23,
|
|
82
|
+
"column": 1,
|
|
83
|
+
"end_line": 23,
|
|
84
|
+
"end_column": 10,
|
|
85
|
+
"severity": "warning",
|
|
86
|
+
"fix": {
|
|
87
|
+
"range": {
|
|
88
|
+
"start": 757,
|
|
89
|
+
"end": 757
|
|
90
|
+
},
|
|
91
|
+
"replacement": "\n"
|
|
92
|
+
},
|
|
93
|
+
"rule_name": "MD031"
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"dependency_fingerprint": "8a4e967d8f4f38d64b4bbe3551c0ae69a6eb75a991ffcd7e9ff8b6bba91d0a4c",
|
|
97
|
+
"timestamp": 1789611022
|
|
98
|
+
}
|
|
Binary file
|
libfcrypt-1.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Franco
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
libfcrypt-1.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: libfcrypt
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: Simple, symmetric encryption. Courtesy of Fernet.
|
|
5
|
+
Project-URL: Homepage, https://www.github.com/SrFluff/libfcrypt
|
|
6
|
+
Project-URL: Issues, https://www.github.com/SrFluff/libfcrypt/issues
|
|
7
|
+
Author-email: Franco Magnano <fluffins009@gmail.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Requires-Python: >=3.9.1
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# LibFcrypt
|
|
16
|
+
|
|
17
|
+
Simple, symmetric encryption. Courtesy of cryptography and Fernet.
|
|
18
|
+
|
|
19
|
+
## Functions
|
|
20
|
+
|
|
21
|
+
### Base
|
|
22
|
+
|
|
23
|
+
- `base.gen_key()`: Generate a bytes object key.
|
|
24
|
+
- `base.passwd_gen_key(passwd)`: Generate a bytes object key derived from a string.
|
|
25
|
+
- `base.encrypts(key,string)`: Encrypt a string using a key (bytes), returns a bytes object.
|
|
26
|
+
- `base.decrypts(key,string)`: Decrypt a string using a key (bytes), returns a string.
|
|
27
|
+
|
|
28
|
+
### File
|
|
29
|
+
|
|
30
|
+
- `file.encryptf(key,filePtr)`: Encrypt the contents of a file using a key (bytes), returns a bytes object.
|
|
31
|
+
- `file.decryptf(key,filePtr)`: Decrypt the contents of a file using a key (bytes), returns a string.
|
|
32
|
+
|
|
33
|
+
## Variables
|
|
34
|
+
|
|
35
|
+
- `VERSION`: Module version information, string.
|
|
36
|
+
- `LICENSE`: Module licensing information, string.
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
Copy the `libfcrypt/` directory to your `$PYTHONPATH` directory, and import it like so:
|
|
41
|
+
```python
|
|
42
|
+
import libfcrypt
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
import libfcrypt
|
|
50
|
+
|
|
51
|
+
# Generate a key
|
|
52
|
+
key = libfcrypt.base.gen_key()
|
|
53
|
+
|
|
54
|
+
# Encrypt a string
|
|
55
|
+
secrets = libfcrypt.encrypts(key,"I have so many secrets muahaha!")
|
|
56
|
+
|
|
57
|
+
# Write secrets to a file
|
|
58
|
+
with open("Secrets.txt","wb") as f:
|
|
59
|
+
f.write(secrets)
|
|
60
|
+
|
|
61
|
+
# Read secrets from a file
|
|
62
|
+
|
|
63
|
+
f = open("Secrets.txt","rb")
|
|
64
|
+
spilled_secrets = libfcrypt.file.decryptf(key,f)
|
|
65
|
+
|
|
66
|
+
# Spill secrets!
|
|
67
|
+
|
|
68
|
+
print(spilled_secrets)
|
|
69
|
+
```
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# LibFcrypt
|
|
2
|
+
|
|
3
|
+
Simple, symmetric encryption. Courtesy of cryptography and Fernet.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
### Base
|
|
8
|
+
|
|
9
|
+
- `base.gen_key()`: Generate a bytes object key.
|
|
10
|
+
- `base.passwd_gen_key(passwd)`: Generate a bytes object key derived from a string.
|
|
11
|
+
- `base.encrypts(key,string)`: Encrypt a string using a key (bytes), returns a bytes object.
|
|
12
|
+
- `base.decrypts(key,string)`: Decrypt a string using a key (bytes), returns a string.
|
|
13
|
+
|
|
14
|
+
### File
|
|
15
|
+
|
|
16
|
+
- `file.encryptf(key,filePtr)`: Encrypt the contents of a file using a key (bytes), returns a bytes object.
|
|
17
|
+
- `file.decryptf(key,filePtr)`: Decrypt the contents of a file using a key (bytes), returns a string.
|
|
18
|
+
|
|
19
|
+
## Variables
|
|
20
|
+
|
|
21
|
+
- `VERSION`: Module version information, string.
|
|
22
|
+
- `LICENSE`: Module licensing information, string.
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
Copy the `libfcrypt/` directory to your `$PYTHONPATH` directory, and import it like so:
|
|
27
|
+
```python
|
|
28
|
+
import libfcrypt
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
import libfcrypt
|
|
36
|
+
|
|
37
|
+
# Generate a key
|
|
38
|
+
key = libfcrypt.base.gen_key()
|
|
39
|
+
|
|
40
|
+
# Encrypt a string
|
|
41
|
+
secrets = libfcrypt.encrypts(key,"I have so many secrets muahaha!")
|
|
42
|
+
|
|
43
|
+
# Write secrets to a file
|
|
44
|
+
with open("Secrets.txt","wb") as f:
|
|
45
|
+
f.write(secrets)
|
|
46
|
+
|
|
47
|
+
# Read secrets from a file
|
|
48
|
+
|
|
49
|
+
f = open("Secrets.txt","rb")
|
|
50
|
+
spilled_secrets = libfcrypt.file.decryptf(key,f)
|
|
51
|
+
|
|
52
|
+
# Spill secrets!
|
|
53
|
+
|
|
54
|
+
print(spilled_secrets)
|
|
55
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import base64
|
|
2
|
+
import hashlib
|
|
3
|
+
|
|
4
|
+
from cryptography.fernet import Fernet
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def gen_key() -> bytes:
|
|
8
|
+
return Fernet.generate_key()
|
|
9
|
+
|
|
10
|
+
def passwd_gen_key(passwd:str) -> bytes:
|
|
11
|
+
hashed_passwd = hashlib.sha256(passwd.encode()).digest()
|
|
12
|
+
encoded_passwd = base64.urlsafe_b64encode(hashed_passwd)
|
|
13
|
+
return encoded_passwd
|
|
14
|
+
|
|
15
|
+
def encrypts(key:bytes,string:str) -> bytes:
|
|
16
|
+
return Fernet(key).encrypt(string.encode())
|
|
17
|
+
|
|
18
|
+
def decrypts(key:bytes,bytestring:bytes) -> str:
|
|
19
|
+
return Fernet(key).decrypt(bytestring).decode()
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling >= 1.26"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "libfcrypt"
|
|
7
|
+
version = "1.1.0"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name="Franco Magnano", email="fluffins009@gmail.com" },
|
|
10
|
+
]
|
|
11
|
+
description = "Simple, symmetric encryption. Courtesy of Fernet."
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=3.9.1"
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"Operating System :: POSIX :: Linux",
|
|
17
|
+
]
|
|
18
|
+
license = "MIT"
|
|
19
|
+
license-files = ["LICEN[CS]E*"]
|
|
20
|
+
|
|
21
|
+
[project.urls]
|
|
22
|
+
Homepage = "https://www.github.com/SrFluff/libfcrypt"
|
|
23
|
+
Issues = "https://www.github.com/SrFluff/libfcrypt/issues"
|