Retired
Caesar Cipher (retired)
70 of 85deleted_account
Description:
In cryptography, a Caesar cipher is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of 3, D would be replaced by A, E would become B, and so on. The method is named after Julius Caesar, who used it in his private correspondence.
Your task is to write a function that takes exactly 2 arguments (string, shiftkey) and encrypts the given string. Any other character than isn't a letter should stay unchanged.
Assumption: shiftkey is integer from [-25, 25] interval.
For example:
- caesar("Abcd", 2) should return "Cdef"
- caesar("message", -1) should return "ldrrzfd"
- caesar("ZZ Top", 3) should return "CC Wrs"
and so on ...
Algorithms
Encryption
Cryptography
Logic
Security
Ciphers
Strings
Data Types
Functions
Control Flow
Basic Language Features
Fundamentals
Similar Kata:
Stats:
Created | Jan 13, 2015 |
Warriors Trained | 420 |
Total Skips | 8 |
Total Code Submissions | 304 |
Total Times Completed | 85 |
Python Completions | 70 |
Ruby Completions | 6 |
JavaScript Completions | 12 |
Total Stars | 7 |
% of votes with a positive feedback rating | 89% of 49 |
Total "Very Satisfied" Votes | 42 |
Total "Somewhat Satisfied" Votes | 3 |
Total "Not Satisfied" Votes | 4 |
Total Rank Assessments | 49 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 8 kyu |