Metadata-Version: 2.4
Name: cryptid
Version: 0.0.3
Summary: Python tools for encrypt and decrypt
Project-URL: Homepage, https://github.com/syxhri/cryptid
Project-URL: Issues, https://github.com/syxhri/cryptid/issues
Project-URL: Repository, https://github.com/syxhri/cryptid.git
Author-email: Alfi Syahri <alfisyahri.official@gmail.com>
License: MIT License
        
        Copyright (c) 2024 syxhri
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Requires-Dist: cryptography
Requires-Dist: pillow
Description-Content-Type: text/markdown

# PyCryptid

PyCryptid is a Python library for encrypt and decrypt object, text, or image

## Installation
```bash
pip install cryptid
```

## Usage Examples
### Cryptid
This class can encrypt most of python object to bytes and decrypt it back to python object (using pickle)

```python
from cryptid import Cryptid

password = 'mykey'
# or generate a new one
password = Cryptid.generate_key()

cryptid = Cryptid(password)

# encrypt and decrypt dict
normal_dict = {'name': 'John Doe', 'age': 20}
enc_dict = cryptid.encrypt(normal_dict)
dec_dict = cryptid.decrypt(enc_dict)

print(enc_dict) # encrypted <class 'bytes'>
print(dec_dict) # {'name': 'John Doe', 'age': 20}

# encrypt and decrypt function
enc_func = cryptid.encrypt(print)
dec_func = cryptid.decrypt(enc_func)

print(enc_func) # encrypted <class 'bytes'>
dec_func('John Doe') # John Doe
```

### Cryptext
Encrypt text using AES

```python
from cryptid import Cryptext

cryptext = Cryptext(password)
text = 'Hello World'
enc_text = cryptext.encrypt(text) # encrypted string
dec_text = cryptext.decrypt(enc_text)
print(dec_text) # Hello World
```

### Steganography
Hide secret message in image

```python
from cryptid import Steganography

st = Steganography()
input_image = '/path/to/image'
output_image = 'output.png'
message = 'Hello World'

# encode image with message
st.encode(input_image, message, output_image) # True
# or using password to encrypt the message
st.encode(input_image, message, output_image, password)

# decode message from image
original_message = st.decode('output.png')
# or
original_message = st.decode('output.png', password)

print(original_message) # Hello World
```

## Buy me tanghulu
https://trakteer.id/alfi-syahri
