Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/finsberg/caesar_cipher_in1910

Repo for IN1910 to illustrate testing with caesar cipher as a use case
https://github.com/finsberg/caesar_cipher_in1910

Last synced: 3 days ago
JSON representation

Repo for IN1910 to illustrate testing with caesar cipher as a use case

Awesome Lists containing this project

README

        

[![CI](https://github.com/finsberg/caesar_cipher_in1910/actions/workflows/main.yml/badge.svg)](https://github.com/finsberg/caesar_cipher_in1910/actions/workflows/main.yml)
[![codecov](https://codecov.io/gh/finsberg/caesar_cipher_in1910/branch/master/graph/badge.svg?token=9VRTVLANGL)](https://codecov.io/gh/finsberg/caesar_cipher_in1910)

# Learn testing using Caesar Cipher

In this repo we implement a simple Caesar Cipher algorithm and test some functionality. For more info on how the Caesar Cipher is working check out [Wikipedia](https://en.wikipedia.org/wiki/Caesar_cipher)

## Install
You need python3. No additional packages are required

## Usage
Select a secret key, i.e a shift.

### Encryption
```python
import caesar_cipher
secret_shift = 5
message = "hello"
encypted_message = caesar_cipher.encrypt(message, shift=secret_shift)
```

### Decryption
```python
import caesar_cipher
secret_shift = 5
message = caesar_cipher.decrypt(decrypted_message, shift=secret_shift)
```

## Automated tests
You can run the tests using `pytest`
```
python -m pytest test_caesar_cipher.py
```

## Limitations
This code has quite a lot of limitations
- It only support letters and all letters are converted to lower case. This mean that you cannot encrypt / decrypt messages containing numbers or special characters
- You can only encrypt / decrypt single word, not sentences

## Contributing
Contributions are welcomed, see [CONTRIBUTING.md](CONTRIBUTING.md) for more info