https://github.com/ddc/ddccryptography
Encode and Decode strings with Cryptography
https://github.com/ddc/ddccryptography
cryptography ddccryptography decode decoder encode encoder python python-3 python3
Last synced: 4 months ago
JSON representation
Encode and Decode strings with Cryptography
- Host: GitHub
- URL: https://github.com/ddc/ddccryptography
- Owner: ddc
- License: mit
- Created: 2024-06-05T19:14:39.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-19T20:47:11.000Z (over 1 year ago)
- Last Synced: 2024-12-22T15:55:58.350Z (over 1 year ago)
- Topics: cryptography, ddccryptography, decode, decoder, encode, encoder, python, python-3, python3
- Language: Python
- Homepage: https://pypi.org/project/ddcCryptography
- Size: 95.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Encode and Decode strings with Cryptography
[](https://www.paypal.com/ncp/payment/6G9Z78QHUD4RJ)
[](https://opensource.org/licenses/MIT)
[](https://pypi.python.org/pypi/ddcCryptography)
[](https://pepy.tech/projects/ddcCryptography)
[](https://codecov.io/gh/ddc/ddcCryptography)
[](https://github.com/ddc/ddcCryptography/actions/workflows/workflow.yml)
[](https://sonarcloud.io/dashboard?id=ddc_ddcCryptography)
[](https://actions-badge.atrox.dev/ddc/ddcCryptography/goto?ref=main)
[](https://github.com/psf/black)
[](https://www.python.org/downloads)
[](https://github.com/sponsors/ddc)
## Table of Contents
- [Install](#install)
- [Cryptography](#cryptography)
- [Generate Private Key](#generate-private-key)
- [Encode](#encode)
- [Decode](#decode)
- [Development](#development)
- [Building from Source](#building-from-source)
- [Running Tests](#running-tests)
- [License](#license)
- [Support](#support)
# Install
```shell
pip install ddcCryptography
```
# Cryptography
## Generate Private Key
+ Generates a private key to be used instead of default one
+ But keep in mind that this private key WILL BE NEEDED TO DECODE FURTHER STRINGS
+ Example of custom private key as "my_private_key" bellow
```python
from ddcCryptography import Cryptography
cp = Cryptography()
cp.generate_private_key()
```
## Encode
+ Encodes a given string
```python
from ddcCryptography import Cryptography
str_to_encode = "test_str"
cp = Cryptography()
cp.encode(str_to_encode)
```
```python
from ddcCryptography import Cryptography
str_to_encode = "test_str"
cp = Cryptography("my_private_key")
cp.encode(str_to_encode)
```
## Decode
+ Decode a given string
```python
from ddcCryptography import Cryptography
str_to_decode = "gAAAAABnSdKi5V81C_8FkM_I1rW_zTuyfnxCvvZPGFoAoHWwKzceue8NopSpWm-pDAp9pwAIW3xPbACuOz_6AhZOcjs3NM7miw=="
cp = Cryptography()
cp.decode(str_to_decode)
```
```python
from ddcCryptography import Cryptography
str_to_decode = "gAAAAABnSdKi5V81C_8FkM_I1rW_zTuyfnxCvvZPGFoAoHWwKzceue8NopSpWm-pDAp9pwAIW3xPbACuOz_6AhZOcjs3NM7miw=="
cp = Cryptography("my_private_key")
cp.decode(str_to_decode)
```
# Development
### Building from Source
```shell
poetry build -f wheel
```
### Running Tests
```shell
poetry update --with test
poe tests
```
# License
Released under the [MIT License](LICENSE)
# Support
If you find this project helpful, consider supporting development:
- [GitHub Sponsor](https://github.com/sponsors/ddc)
- [ko-fi](https://ko-fi.com/ddcsta)
- [PayPal](https://www.paypal.com/ncp/payment/6G9Z78QHUD4RJ)