semvec/pypi-packages huggingface dataset:
icrypt 0.1.1
A simple pgp encryption and decryption module for Python 3.6+
License: MIT
Requires Python: >=3.5

# icrypt
A simple pgp encryption and decryption module for Python 3.6+

## Description
This module is a simple pgp module for Python 3.6+.
It is based on the pgpy module.



## Installation
```bash
pip install icrypt
```

## Usage

```python
# from icrypt import encrypt, decrypt
from icrypt import generate_key, encrypt, decrypt

# Generate a key pair and save it to a file
privkey = generate_key(name='Hi', email='hi@hi.com')
pubkey = privkey.pubkey
print(privkey)
print(pubkey)

# Save the private key and public key to a file
with open('privkey.txt', 'w') as f: f.write(str(privkey))
with open('pubkey.txt', 'w') as f: f.write(str(pubkey))

# Encrypt a message
message = 'Hello World'
encrypted = encrypt(pubkey_path='pubkey.txt', message=message)
print(encrypted)

# Save the encrypted message to a file
with open('encrypted.txt', 'w') as f: f.write(str(encrypted))

# Decrypt a message
decrypted = decrypt(privkey_path='privkey.txt', encrypted_file_path='encrypted.txt')
print(decrypted)
```

## License
MIT