7 kyu

Decoding a message

1,044 of 2,577samhstn

Description:

You have managed to intercept an important message and you are trying to read it.

You realise that the message has been encoded and can be decoded by switching each letter with a corresponding letter.

You also notice that each letter is paired with the letter that it coincides with when the alphabet is reversed.

For example: "a" is encoded with "z", "b" with "y", "c" with "x", etc

You read the first sentence:

"r slkv mlylwb wvxlwvh gsrh nvhhztv"

After a few minutes you manage to decode it:

"i hope nobody decodes this message"

Create a function that will instantly decode any of these messages

You can assume no punctuation or capitals, only lower case letters, but remember spaces!

Puzzles
Algorithms
Cryptography
Security
Games

More By Author:

Check out these other kata created by samhstn

Stats:

CreatedNov 30, 2015
PublishedNov 30, 2015
Warriors Trained4100
Total Skips56
Total Code Submissions8309
Total Times Completed2577
JavaScript Completions1044
Ruby Completions154
Python Completions1335
C Completions92
COBOL Completions8
Total Stars85
% of votes with a positive feedback rating93% of 443
Total "Very Satisfied" Votes385
Total "Somewhat Satisfied" Votes55
Total "Not Satisfied" Votes3
Ad
Contributors
  • samhstn Avatar
  • GiacomoSorbi Avatar
  • mcelearr Avatar
  • myjinxin2015 Avatar
  • monadius Avatar
  • trashy_incel Avatar
  • saudiGuy Avatar
Ad