Crypto is a sample practice project for the swift python programming material, swift-python that implements the Cesar-cipher. Isn't that great?
- Run test,
python -m pytest test.py
or justpython test.py
pytest
- pip install pytest
Create an encrypted text.
from crypto import Crypto
plane_text = "Hello there"
shift = 2
crypto_obj = Crypto(shift, plane_text)
encrypted_text = crypto_obj.encrypt()
print(encrypted_text)
Deciper an encrypted text.
from crypto import Crypto
ciphered_text = "jgnnq vjgtg"
shift = 2
crypto_obj = Crypto(shift, ciphered_text)
plane_text = crypto_obj.decrypt()
print(plane_text)