7 kyu

GA-DE-RY-PO-LU-KI cypher

807 of 2,833dcieslak

Description:

Introduction

The GADERYPOLUKI is a simple substitution cypher used in scouting to encrypt messages. The encryption is based on short, easy to remember key. The key is written as paired letters, which are in the cipher simple replacement.

The most frequently used key is "GA-DE-RY-PO-LU-KI".

 G => A
 g => a
 a => g
 A => G
 D => E
  etc.

The letters, which are not on the list of substitutes, stays in the encrypted text without changes.

Task

Your task is to help scouts to encrypt and decrypt thier messages. Write the Encode and Decode functions.

Input/Output

The input string consists of lowercase and uperrcase characters and white . The substitution has to be case-sensitive.

Example

 Encode("ABCD")          // => GBCE 
 Encode("Ala has a cat") // => Gug hgs g cgt 
 Encode("gaderypoluki"); // => agedyropulik
 Decode("Gug hgs g cgt") // => Ala has a cat 
 Decode("agedyropulik")  // => gaderypoluki
 Decode("GBCE")          // => ABCD
 encode("ABCD")          // => GBCE 
 encode("Ala has a cat") // => Gug hgs g cgt 
 encode("gaderypoluki"); // => agedyropulik
 decode("Gug hgs g cgt") // => Ala has a cat 
 decode("agedyropulik")  // => gaderypoluki
 decode("GBCE")          // => ABCD
 encode("ABCD")          // => GBCE 
 encode("Ala has a cat") // => Gug hgs g cgt 
 encode("gaderypoluki"); // => agedyropulik
 decode("Gug hgs g cgt") // => Ala has a cat 
 decode("agedyropulik")  // => gaderypoluki
 decode("GBCE")          // => ABCD
 Encode("ABCD")          // => GBCE 
 Encode("Ala has a cat") // => Gug hgs g cgt 
 Encode("gaderypoluki")  // => agedyropulik
 Decode("Gug hgs g cgt") // => Ala has a cat 
 Decode("agedyropulik")  // => gaderypoluki
 Decode("GBCE")          // => ABCD
encode("ABCD")          // => GBCE 
encode("Ala has a cat") // => Gug hgs g cgt 
encode("gaderypoluki"); // => agedyropulik
decode("Gug hgs g cgt") // => Ala has a cat 
decode("agedyropulik")  // => gaderypoluki
decode("GBCE

GADERYPOLUKI collection

GADERYPOLUKI cypher vol 1
GADERYPOLUKI cypher vol 2
GADERYPOLUKI cypher vol 3 - Missing Key
GADERYPOLUKI cypher vol 4 - Missing key madness
Fundamentals
Ciphers
Cryptography

Stats:

CreatedMay 28, 2017
PublishedMay 28, 2017
Warriors Trained5367
Total Skips160
Total Code Submissions7658
Total Times Completed2833
JavaScript Completions807
C# Completions257
Ruby Completions108
Crystal Completions15
Python Completions1103
TypeScript Completions132
C++ Completions399
Go Completions94
Rust Completions60
Lua Completions9
Total Stars73
% of votes with a positive feedback rating90% of 514
Total "Very Satisfied" Votes427
Total "Somewhat Satisfied" Votes74
Total "Not Satisfied" Votes13
Total Rank Assessments11
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • dcieslak Avatar
  • GiacomoSorbi Avatar
  • kazk Avatar
  • adrian.eyre Avatar
  • Blind4Basics Avatar
  • Voile Avatar
  • hobovsky Avatar
  • Lixfeld Avatar
  • saudiGuy Avatar
  • PetitLu117 Avatar
  • estem8 Avatar
Ad