Skip to main content

Questions tagged [cipher]

For challenges relating in some way to encoding messages using classical (pen and paper) ciphers. For modern ciphers, such as AES, use the [encryption] tag instead.

Filter by
Sorted by
Tagged with
14 votes
5 answers
2k views

Caesar ciphers A Caesar cipher with shift=N is the process of replacing any alphabetic character in a string with the letter which is N positions ahead in the alphabet (wrapping back at the beginning)....
Nicola Sap's user avatar
  • 3,823
11 votes
23 answers
2k views

I can't think of a better name. This is similar to this challenge, but a lot easier. Read three strings which contain only uppercase letters. The length of the first and second strings are the same. ...
None1's user avatar
  • 1,165
8 votes
10 answers
2k views

The autokey cipher is closely related to the Vigenère cipher (both were invented by Blaise de Vigenère). Decryption involves the encrypted message and the key. For simplicity, let us assume all ...
SquareFinder's user avatar
17 votes
18 answers
2k views

Description The Caesar cipher is a cipher, where every letter in the alphabet will be rotated by a secret number. If the rotation is \$7\$, then a -> ...
math scat's user avatar
  • 9,538
14 votes
8 answers
946 views

The Caesar cipher is a simple and famous cipher, where the letters of the alphabet are rotated by some secret amount. For example, if our secret rotation is 3, we ...
AnttiP's user avatar
  • 8,048
21 votes
17 answers
898 views

To shuffle a string \$s\$, Alice applies the following algorithm: She takes the ASCII code of each character, e.g. "GOLF" → \$[ 71, 79, 76, 70 ]\$ She ...
Arnauld's user avatar
  • 206k
19 votes
21 answers
2k views

Alienese refers to two "languages" in the show Futurama. In actuality, they are two ciphers of English text with a pictographic alphabet. The first is a simple substitution cipher, but the ...
caird coinheringaahing's user avatar
3 votes
5 answers
457 views

Introduction Book cipher A Book cipher is a very unique method of a encipher. Here's how's it done: You have a book / a document or a article (something full of text, the more pages of text the ...
Jane's user avatar
  • 133
11 votes
8 answers
714 views

Challenge The challenge is to implement the bottom encoding (only encoding, not decoding). There is a wide variety of existing implementations in the bottom-software-foundation org. Bottom is a text ...
Orangutan's user avatar
  • 817
7 votes
2 answers
330 views

You know those riddles where every letter is swapped for another letter? E.g. you get a text like ...
Zsolt Szilagy's user avatar
17 votes
19 answers
3k views

Introduction: I have loads of different ciphers stored in a document I once compiled as a kid, I picked a few of the ones I thought were best suitable for challenges (not too trivial, and not too ...
Kevin Cruijssen's user avatar
19 votes
13 answers
2k views

Introduction: I have loads of different ciphers stored in a document I once compiled as a kid, I picked a few of the ones I thought were best suitable for challenges (not too trivial, and not too hard)...
Kevin Cruijssen's user avatar
16 votes
14 answers
2k views

Introduction: I have loads of different ciphers stored in a document I once compiled as a kid, I picked a few of the ones I thought were best suitable for challenges (not too trivial, and not too hard)...
Kevin Cruijssen's user avatar
33 votes
20 answers
4k views

The problem with the Caesar cipher is the resulting words are often unpronounceable. The problem with Pig Latin is that it is easy to decode. Why not combine them? Input A word consisting of the ...
qazwsx's user avatar
  • 1,194
15 votes
14 answers
3k views

Your task is to decipher a non-empty string consisting of printable ASCII characters in the range [32..126]. Reading the string character per character: each time you encounter a letter in lowercase, ...
Arnauld's user avatar
  • 206k
21 votes
15 answers
15k views

Given the following input: An integer n where n > 0. A string s where ...
Magic Octopus Urn's user avatar
0 votes
5 answers
327 views

Your task: Create a program that encrypts a string with another string using a key, using the vigenere cipher. What a vigenere cipher does ...
bleh's user avatar
  • 181
38 votes
14 answers
5k views

Your task is to translate a 103-smooth number into an English word, using the method described below. How? Generate the list of prime factors (with repetition) of the input number. Sort the list: If ...
Arnauld's user avatar
  • 206k
19 votes
9 answers
1k views

You know how you get a voicemail message and the person's connection wasn't great, and you're trying to figure out how to call them back, but you're not sure if that was a "5" or an "8" they said? ...
Draco18s no longer trusts SE's user avatar
18 votes
16 answers
2k views

This task is rather simple, and makes use of three distinct "operator" characters. Your task is, given a simple sequence of letters, perform the following task to encode it using ...
Magic Octopus Urn's user avatar
37 votes
17 answers
2k views

This is the inverse of Let's do some "deciph4r4ng" In this challenge, your task is to encipher a string. Luckily, the algorithm is pretty simple: reading from left to right, each ...
Engineer Toast's user avatar
62 votes
37 answers
5k views

In this challenge, your task is to decipher a string. Luckily, the algorithm is pretty simple: reading from left to right, each encountered digit N (0 to 9) must be replaced with the character which ...
Arnauld's user avatar
  • 206k
4 votes
4 answers
524 views

Given a string of text that contains lowercase letters, encode it as follows: (I will be using abcdef) First, encode the alphabet cipher, but this time, 0-indexed. <...
Oliver Ni's user avatar
  • 10.7k
2 votes
0 answers
164 views

Review First, let's review the Simple Substitution Cipher. To encode a string in the Simple Substitution Cipher, replace each letter in your string with another letter. A letter may not be used to ...
Oliver Ni's user avatar
  • 10.7k
27 votes
16 answers
2k views

When babies open their mouths, they're not just spewing gibberish. They're actually talking in a highly advanced, adult-proof cipher... The Baby-talk Cipher When a baby talks, it could look ...
FlipTack's user avatar
  • 14.7k
8 votes
25 answers
943 views

Given a string to encode, and a number of columns (the key), encode the string as follows: I will be using the example Hello, world! and the key ...
Oliver Ni's user avatar
  • 10.7k
28 votes
64 answers
3k views

Given a string that contains only lowercase letters, encode that string with the alphabet cipher. To encode with the alphabet cipher (I will be using the example ...
Oliver Ni's user avatar
  • 10.7k
14 votes
10 answers
2k views

We'll define the ASCII Odd/Even Cipher via the below pseudocode: ...
AdmBorkBork's user avatar
  • 43.7k
10 votes
2 answers
392 views

As if this challenge could be any more Pythonesque in spirit... No prior knowledge of Markov chains or encryption techniques is required. You are a spy who needs to obtain some crucial information ...
Andreï V. Kostyrka's user avatar
8 votes
10 answers
2k views

Columnar Transposition Cipher While I have plenty of programs I have written for more advanced ciphers, I just realised I don't actually have one for one of the simplest: Columnar Transposition. The ...
user avatar
7 votes
2 answers
654 views

ADFGX cipher encryption The ADFGX cipher was used by the German army in WWI. Write a program to encipher with it! It works as follows: Create a 5x5 Polybius square with a mixed alphabet. The ...
user avatar
22 votes
16 answers
3k views

A Caesar shift is probably something we're all familiar with. (You might be even doing it as a homework task. If so, please don't copy these answers, your teacher almost certainly doesn't want ...
Blue's user avatar
  • 28.8k
11 votes
5 answers
8k views

Write two programs: - One which reads a string and a key and encodes the string into a rail-fence cipher using that key. - Similarly, write a program for the reverse function: deciphering a rail fence ...
ShuklaSannidhya's user avatar
30 votes
20 answers
5k views

The Vigenère cipher was a simple polyalphabetic cipher that basically applied one of several Caesar ciphers, according to a key. Basically the letters in the key indicate which shifted alphabet to use....
Joey's user avatar
  • 13.2k