For challenges involving cryptography: encryption or decryption.

learn more… | top users | synonyms

3
votes
2answers
99 views

ADFGX Cipher Encryption

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 ...
26
votes
19answers
1k views

Atbash Self Palindromes

Consider the Atbash transformation: A|B|C|D|E|F|G|H|I|J|K|L|M Z|Y|X|W|V|U|T|S|R|Q|P|O|N Where A ⇔ Z and L ⇔ O, e.g. There is an interesting property that some words share. When some strings ...
10
votes
3answers
204 views

Bacon's cipher: An Intro to Steganography

This little piggy went to market, this little piggy wrote some code... Ah wait, we're not talking about that bacon, we're talking about Sir Francis Bacon! Specifically, the cipher Bacon devised in ...
16
votes
1answer
510 views

Convert ciphered Roman numerals to Arabic decimals

Write an algorithm to interpret a sequence of letters as a Roman numeral. (see roman numeral rules below) Each distinct letter has a matching Arabic decimal value, no maximum. But you don't have ...
7
votes
1answer
197 views

An Affinity for Ciphers

Description You, an armchair cryptanalyst, have noticed that the first letters of each word in your neighbor's mail (yes, you read it -- how else would you know if he's plotting something?) look very ...
31
votes
9answers
2k views

The Drunken Bishop

In public-key cryptography, a public key fingerprint is a short sequence of bytes used to identify a longer public key. In SSH in particular they can be used to verify that a server is in fact ...
7
votes
2answers
306 views

Crack a Vigenère Cipher

A Vigenère Cipher is encrypted by repeating a keyword to be the length of the plaintext, and summing each character in that text with the corresponding letter in the plaintext modulo 26. (using ...
1
vote
0answers
211 views

Back to the future: Post-quantum cryptography [closed]

If you know your programming history, you may know that one of the earliest code golf challenges was to implement RSA encryption. Now, I'm challenging you to code golf an encryption system that is ...
0
votes
0answers
56 views

Golf: Tabula Recta [duplicate]

From Chapter 18 of Significant Digits, a fan-fiction of the Harry Potter and the Methods of Rationality fan-fiction, we have the following cryptographic problem: As it happened, the books were ...
12
votes
2answers
557 views

Cryptic Kicker //

Cryptic Kicker A common but insecure method of encrypting text is to permute the letters of the alphabet. In other words, each letter of the alphabet is consistently replaced in the text by some ...
16
votes
3answers
401 views

A fiercer four-square cipher

Background One-hundred and thirteen years ago, amateur cryptographer Félix Delastelle published his work on the four-square cipher, a digraphic substitution cipher that accepts two permutations of a ...
10
votes
5answers
305 views

CipherSaber encryption

Implement a CipherSaber encryption program, as described below. Guidelines: The smallest entry, in bytes, wins. However, in a departure from code-golf norms, you are welcome to post interesting ...
12
votes
20answers
3k views

Cryptographic hash golf (robbers)

This contest is over. There are no remaining crackable answer in the cops challenge. Companion thread of Cryptographic hash golf As a reminder, here are the rules for robbers from the main ...
33
votes
23answers
4k views

Cryptographic hash golf

This contest is over. Due to the nature of cops-and-robbers challenges, the cops challenge becomes a lot easier when the interest in the associated robbers challenge has diminished. Therefore, ...
15
votes
4answers
789 views

Shifty XORyption

Write a program or function (or set of programs/functions) to encrypt and decrypt data given the following specification: Encryption Calculate an XOR hash of the input by XOR-ing every byte with ...
7
votes
1answer
393 views

Decrypting a block of AES

Today your goal is to decrypt a secret message using AES. Given a ciphertext and key you will decrypt and print the message. Your program may be in any language. It will be run with input on ...
1
vote
0answers
57 views

Solve a Date Shift Cipher [duplicate]

Introduction In this challenge you will be solving date shift ciphers. Here is a general overview of what a date shift cipher is. To encode a message, you first must make a key. A key in a date shift ...
11
votes
6answers
861 views

Solve a Diagonal Burrows-Wheeler transform

Introduction In this challenge you will be solving diagonal Burrows-Wheeler transforms. Here is a general overview of what a diagonal Burrows-Wheeler transform is. To encode a message, you first must ...
6
votes
2answers
239 views

Key length of Vigenère cipher

The Vigenère cipher is a substitution cipher where the encryption of each letter of the plaintext depends on a different character in a keyword. This stops you using simple methods of frequency ...
-8
votes
2answers
380 views

Challenge: Crack the code [closed]

I have created a simple encryption algorithm. Your challenge, if you choose to accept it, is to re-produce the algorithm that encodes one string into it's encoded counterpart and then back again by ...
3
votes
3answers
453 views

Compress and Decompress sentence using vowel based encryption cipher [closed]

The aim is to parse a sentence and compress/encrypt it according to the rules below and then decrypt it using the key: Remove all letters in a word before the first vowel is encountered. Example: ...
7
votes
2answers
532 views

2nd byte bias of RC4

Short version RC4, designed in 1987, is one of the most famous stream ciphers. This question asks you to practically demonstrate its 2nd byte bias (for a theoretical proof, see section 3.2 of this ...
20
votes
12answers
2k views

What ROT is this? - decrypt ROT-n

Here are the letters of the English alphabet in order by frequency: e t a o i n s h r d l c u m w f g y p b v k j x q z That is, e is the most frequently used letter, and z is the least common. ...
18
votes
13answers
2k views

Write a Playfair encryption program

Write a program that takes two lines of input and uses the first as a key phrase to encrypt the second according to the Playfair encryption technique. Wikipedia describes Playfair encryption in some ...
23
votes
4answers
2k views

Implement ROT-47… in ROT-47

Challenge: Implement ROT-47 in code that works as both itself and as the ROT-47 version of itself. Scoring: Your score is calculated as a percentage of used, ROT-47 eligible bytes in total of both ...
3
votes
3answers
412 views

Build an RSA encoder

Your task is to build a function in any language that takes a message m, an encryption e, and a modulus k (all positive integers), and takes m to the power of e modulo k. Your solution must not be a ...
2
votes
2answers
2k views

Rail fence cipher

Write a program which reads a string and a key and encodes the string into a rail-fence cipher using that key. Similarly, write a program for reverse function, ie, deciphering a rail fence using a ...
12
votes
7answers
1k views

C: replace AES FIPS-197 SubBytes table by constant-time code

In FIPS-197 (the Advanced Encryption Standard, known as AES), it is made heavy use of SubBytes, which could be implemented as unsigned char SubBytes(unsigned char x) { static const unsigned char ...
3
votes
2answers
670 views

Implement DES key expansion

I wanted to make a challenge to do the full DES encryption algorithm, but that may be a bit too involved to get a ton of participation. This challenge is to simply generate the 16 48-bit subkeys used ...
31
votes
3answers
2k views

Underhanded Password Hashing

In the spirit of the Underhanded C Contest, I'm starting an Underhanded Code Contest. The objective of this contest is to straightforwardly implement some code, while subtly hiding a nefarious bug ...
11
votes
12answers
2k views

Implement a One-Time Pad

Background A one-time pad is a form of encryption that has been proven impossible to crack if used properly. Encryption is performed by taking a plaintext (comprised of only letters A-Z) and ...
4
votes
4answers
501 views

Implement Oplop

Oplop is an algorithm to generate website specific passwords based on a master password and a keyword. It is described here: http://code.google.com/p/oplop/wiki/HowItWorks There's an online ...
11
votes
6answers
2k views

Implement Rijndael's S-box

Rijndael's S-box is a frequently used operation in AES encryption and decryption. It is typically implemented as a 256-byte lookup table. That's fast, but means you need to enumerate a 256-byte ...
15
votes
5answers
2k views

Write Buggy Code

Now is the time to show off your abilities to write bad code. I am trying out a new sort of programming puzzle, most similar, I think, to the underhanded C contest. The main difference is that this is ...
6
votes
3answers
511 views

Break the broken hash [closed]

Some time ago, I found this unused hash function (written in Java) in our codebase: long hashPassword(String password) { password = password.toUpperCase(); long hash = 0; int multiplier = ...
9
votes
7answers
3k views

Implement Shamir's Secret Sharing reconstruction

Shamir's secret sharing scheme is a simple way of protecting a secret by splitting it into several parts needed to reconstruct it. Your task is to implement Shamir's Secret Sharing reconstruction ...
12
votes
1answer
669 views

Break the broken cipher

I have designed a simple random generator that cycles two numbers in a chaotic way using a multiply and modulus method. It works great for that. If I were to use it as a cipher generator it would ...
11
votes
2answers
2k views

Decryption by pattern analysis

You are given an encrypted string, encrypted using a very simple substitution cipher. Problem You do not know what the cipher is but you do know the ciphertext is English and that the most frequent ...