Noob cipher
Description
Discuss (27 comments)
A simple cipher that makes messages quite unreadable is the substitution cipher. The substitution cipher replace one alphabet letter with another alphabet letter. The goal of this puzzle is to decrypt a message encoded with a substitution cipher.
We'll use the term substitution table to describe the table used for replacing characters.
For example, the following table:
The substitution table is
For the previous example, the output should be:
We'll use the term substitution table to describe the table used for replacing characters.
For example, the following table:
ZYXWVUTSRQPONMLKJIHGFEDCBAMeans that during the encryption phase the letters will be replaced following this substitution:
Original ABCDEFGHIJKLMNOPQRSTUVWXYZ -------- |||||||||||||||||||||||||| Replaced ZYXWVUTSRQPONMLKJIHGFEDCBA
Input Specifications
Your program must take 2 arguments:- the substitution table (it is a string argument) used to encrypt the message
- the file containing the encrypted message
The substitution table is
BCDEFGHIJKLMNOPQRSTUVWXYZAThe file containing the encrypted message is
XFMDPNF UP DPEFS DIBSUT
Output Specifications
The output must contain the decrypted message. The output result must be printed on the standard output.For the previous example, the output should be:
WELCOME TO CODER CHARTS
© CoderCharts - All Rights Reserved
| Type | Puzzle | Pass | 685 | Fail | 169 | ||
| Scoring | Language | Level | Easy | Points | 100 | ||
| Tags | cryptography, string manipulation | ||||||
Unit Tests
| Name | CPU Unit | Memory Unit |
|---|---|---|
A short messageThis test has at most 200 characters |
||
A long messageThis test has at most 3000 characters |
Confirm that you want to switch languages
Your current edits will be lost.
Confirm that you wish to load a previous submission
Your current edits will be lost.