Sha256: c978cb1e08dbb21002c05c265551c3ef27d00a92c467f0a68d73e2da6a3c3d30

Contents?: true

Size: 1.83 KB

Versions: 56

Compression:

Stored size: 1.83 KB

Contents

# Rotational Cipher

Create an implementation of the rotational cipher, also sometimes called the Caesar cipher.

The Caesar cipher is a simple shift cipher that relies on
transposing all the letters in the alphabet using an integer key
between `0` and `26`. Using a key of `0` or `26` will always yield
the same output due to modular arithmetic. The letter is shifted
for as many values as the value of the key.

The general notation for rotational ciphers is `ROT + <key>`.
The most commonly used rotational cipher is `ROT13`.

A `ROT13` on the Latin alphabet would be as follows:

```plain
Plain:  abcdefghijklmnopqrstuvwxyz
Cipher: nopqrstuvwxyzabcdefghijklm
```

It is stronger than the Atbash cipher because it has 27 possible keys, and 25 usable keys.

Ciphertext is written out in the same formatting as the input including spaces and punctuation.

## Examples
- ROT5  `omg` gives `trl`
- ROT0  `c` gives `c`
- ROT26 `Cool` gives `Cool`
- ROT13 `The quick brown fox jumps over the lazy dog.` gives `Gur dhvpx oebja sbk whzcf bire gur ynml qbt.`
- ROT13 `Gur dhvpx oebja sbk whzcf bire gur ynml qbt.` gives `The quick brown fox jumps over the lazy dog.`

### Submitting Exercises

Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.

For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.


For more detailed information about running tests, code style and linting,
please see the [help page](http://exercism.io/languages/python).

## Source

Wikipedia [https://en.wikipedia.org/wiki/Caesar_cipher](https://en.wikipedia.org/wiki/Caesar_cipher)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
trackler-2.2.1.53 tracks/python/exercises/rotational-cipher/README.md
trackler-2.2.1.52 tracks/python/exercises/rotational-cipher/README.md
trackler-2.2.1.51 tracks/python/exercises/rotational-cipher/README.md
trackler-2.2.1.50 tracks/python/exercises/rotational-cipher/README.md
trackler-2.2.1.49 tracks/python/exercises/rotational-cipher/README.md
trackler-2.2.1.48 tracks/python/exercises/rotational-cipher/README.md
trackler-2.2.1.47 tracks/python/exercises/rotational-cipher/README.md
trackler-2.2.1.46 tracks/python/exercises/rotational-cipher/README.md
trackler-2.2.1.45 tracks/python/exercises/rotational-cipher/README.md
trackler-2.2.1.44 tracks/python/exercises/rotational-cipher/README.md
trackler-2.2.1.43 tracks/python/exercises/rotational-cipher/README.md
trackler-2.2.1.42 tracks/python/exercises/rotational-cipher/README.md
trackler-2.2.1.41 tracks/python/exercises/rotational-cipher/README.md
trackler-2.2.1.40 tracks/python/exercises/rotational-cipher/README.md
trackler-2.2.1.39 tracks/python/exercises/rotational-cipher/README.md
trackler-2.2.1.38 tracks/python/exercises/rotational-cipher/README.md
trackler-2.2.1.37 tracks/python/exercises/rotational-cipher/README.md
trackler-2.2.1.36 tracks/python/exercises/rotational-cipher/README.md
trackler-2.2.1.35 tracks/python/exercises/rotational-cipher/README.md
trackler-2.2.1.34 tracks/python/exercises/rotational-cipher/README.md