Questions tagged [cryptography]

For challenges involving cryptography: encryption or decryption.

Filter by
Sorted by
Tagged with
92
votes
12answers
8k views

Proving that a Russian cryptographic standard is too structured

The aim of this challenge is to find an impossibly short implementation of the following function p, in the langage of your choosing. Here is C code implementing it ...
-2
votes
11answers
210 views

Convert alphanumeric (base-36) sentences into hexadecimal (base-16) sentences

I use "sentence" here loosely to mean "any sequence of words separated by spaces" and "words" to mean "sequences of alphanumeric (hexatrigesimal) characters unseparated by spaces". Conversion is from ...
8
votes
3answers
273 views

Generate an RSA key pair

Given a positive integer \$N >= 4\$, output an RSA key pair (both the private and the public key) whose key length is \$N\$ bits. The RSA key generation algorithm is as follows: Choose an \$N\$-...
25
votes
6answers
1k views

Gimli, make it even shorter?

I'm one of the authors of Gimli. We already have a 2-tweet (280 chars) version in C but I would like to see how small it can get. Gimli (paper,website) is a high speed with high security level ...
13
votes
9answers
694 views

Shifting Caesars Shifts

Description A Caesar Shift is a very simple monoalphabetic cipher where each letter gets replaced by the one after it in the alphabet. Example: ...
-5
votes
1answer
392 views

Implement the MD5 algorithm! [closed]

Your challenge is to output the MD5 hash of your input. The specification of MD5 can be found here. Crypto builtins are NOT allowed. Shortest code wins. Psuedocode: ...
4
votes
3answers
392 views

Straddling Checkerboard Cipher

The Straddling Checkerboard is a method for converting letters to numbers and was part of a pencil an paper cipher known as VIC To convert letters to numbers first you have to make a checkboard like ...
11
votes
9answers
748 views

Decode the hidden message!

Introduction One day, you were just relaxing in your office in the CIA, when suddenly you see an alert on your computer. Your programs have just intercepted hundreds of coded messages! A quick ...
2
votes
6answers
427 views

Shh… Can You Split a Secret?

In Applied Cryptography by Bruce Schneier (which I have been reading quite a lot recently), a protocol for splitting secrets is discussed. Here is a brief description: Trent generates a random ...
15
votes
21answers
2k views

Generate a cipher

Generate a cipher given a number and string Your task is simple. Given a string s and a number 0 <= n <= 9 as inputs, ...
5
votes
0answers
144 views

Out Steganograph Me! [duplicate]

Out Steganograph Me As a follow up to this challange, I want to see competitive algorithms for encoding strings as images, and then decoding them. The Challenge Your goal is to write a function or ...
28
votes
7answers
1k views

Decipher Neurotic Frogs

Decipher Neurotic Frogs Now that Puzzling.SE has finally cracked my amphibian-obsessed cipher, let's write a program or function to decrypt it! (If you want to look at the puzzle before having it ...
25
votes
22answers
1k views

PKCS#7 padding validation

In cryptography, PKCS#7 padding is a padding scheme which adds a number of bytes N ≥ 1, where the value of each added byte is equal to N. For example, Hello, World!...
6
votes
1answer
898 views

Write a VIC cipher decoder

You've received a coded message from your ally that you know is encoded with the VIC cipher. As you know that the VIC cipher is notoriously convoluted, you want to write a program that will decode the ...
18
votes
4answers
2k views

Write a VIC cipher encoder

The VIC cipher is one of the most complicated pencil and paper ciphers ever devised. Used in the 1950s by Soviet spy Reino Häyhänen, codenamed "VICTOR", its main principle is security through ...
81
votes
136answers
12k views

Print a Tabula Recta!

Print a Tabula Recta! The Tabula Recta (sometimes called a 'Vigenere Table'), was created by Johannes Trithemius, and has been used in several ciphers, including all variants of Bellaso's Vigenere ...
6
votes
1answer
377 views

Help the poor Cryptographers - DLP Edition

Introduction and Motivation I'm mainly active on Cryptography.SE and as such have already stumbled across the question: "How the hell am I supposed tools like cado-nfs to do stuff!?". They are super-...
17
votes
12answers
2k views

Shamir's Secret Sharing

Given n (the number of players), t (the threshold value), and s (the secret), output the <...
8
votes
4answers
365 views

Time for some TEA!

Introduction A while back I stumbled across the tiny encryption algorithm (TEA) and since then I have recommended it whenever special cryptographic security properties were un-needed and a self-...
-7
votes
13answers
2k views

Substitution cipher [duplicate]

A substitution cipher is an encoding method where each letter in the alphabet is replaced with a fixed, different one; for example, given the following substitution map: ...
2
votes
0answers
125 views

Crack the Cipher [duplicate]

Write a program or function that will break ciphers, using as few bytes as possible. Task Given an encrypted message and a dictionary as input, output the decrypted message. The messages will be ...
6
votes
2answers
522 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 ...
27
votes
24answers
2k 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 ...
14
votes
3answers
890 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
694 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
324 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 ...
42
votes
11answers
3k 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 the ...
7
votes
2answers
581 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 A=0,B=...
0
votes
0answers
124 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
651 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 ...
17
votes
3answers
837 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 ...
11
votes
5answers
516 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 ...
34
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
854 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 ...
9
votes
1answer
523 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 stdin, ...
2
votes
0answers
2k 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
970 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
379 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
492 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 ...
4
votes
3answers
570 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 ...
7
votes
2answers
1k 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 ...
24
votes
13answers
3k 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, ...
20
votes
14answers
6k 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
3k 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
540 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 ...
8
votes
6answers
4k views

Rail fence cipher

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 ...
17
votes
7answers
2k 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 ...
4
votes
2answers
792 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 ...
22
votes
4answers
957 views

Cryptographic quine variant

Create a program that prints the MD5 sum of its source in the form: MD5 sum of my source is: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx No cheating - you can't just read ...