Tool to encrypt / decrypt with the code UBCHI, a key figure consisting of a double transposition used by the Germans during the First World War.
Ubchi Cipher - dCode
Tag(s) : Transposition Cipher
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
This page was modified in July 2021 to take into account the null letters. The previous implementation of Ubchi was incomplete.
Übchi is a double transposition cipher (with the same permutation key) used by the Germans during the First World War.
Ubchi consists of a columnar transposition, the addition of null letters, then a second columnar transposition.
Example: Encrypt SECRET with the key UBER
Step 1 - Write the message in a grid of width N with N the size of the key.
Example: The key UBER has 4 letters so
U | B | E | R |
---|---|---|---|
S | E | C | R |
E | T |
Step 2 - Sort the key alphabetically and swap the columns of the table accordingly
Example:
B | E | R | U |
---|---|---|---|
E | C | R | S |
T | E |
Step 3 - Read the table in columns from top to bottom and from left to right in order to get a new message
Example: Intermediate message: ETCRSE
Step 4 - Add null letters, any letter. Without this, the encryption is a classical double transposition, the addition of a single letter is enough to obfuscate the transposition method.
Example: Intermediate message: ETCRSEX (letter X added, it is preferable to add common letters to confuse the code breakers)
Step 5 - Repeat steps 1 to 3 a second time, the result is the final encrypted message.
Example: 1bis)
U | B | E | R |
---|---|---|---|
E | T | C | R |
S | E | X |
B | E | R | U |
---|---|---|---|
T | C | R | E |
E | X | S |
Decryption begins by determining the form of the grid used during encryption. Count the number of characters in the encrypted message and the permutation key, in order to deduce the number of columns and thus, rows.
Example: Decipher TECXRES (7 letters) with the key UBER (4 letters), knowing there is 1 null letter, the table will have the form
U | B | E | R |
---|---|---|---|
X | X | X | X |
X | X | X |
Step 1 - Sort the key in alphabetical order and fill in the grid in columns with the encrypted message.
Example: The grid fills up
B | E | R | U |
---|---|---|---|
T | C | R | E |
E | X | S |
Step 2 - Swap the columns of the grid to find the letters of the key in the correct order.
Example: The grid is swapped
U | B | E | R |
---|---|---|---|
E | T | C | R |
S | E | X |
Step 3 - Read the grid in lines from left to right then from top to bottom in order to get the message
Example: Intermediate message: ETCRSEX
Step 4 - Remove the null letters (found at the end of the message found)
Example: Intermediate message: ETCRSE (1 letter deleted, the letter X)
Step 5 - Repeat steps 1 to 3 a second time, the result is the original plain message.
Example: 1bis)
B | E | R | U |
---|---|---|---|
E | C | R | S |
T | E |
U | B | E | R |
---|---|---|---|
S | E | C | R |
E | T |
Any message encrypted by Ubchi is a transposition of the characters of the original message, so the analysis of the frequency of the letters and the index of coincidence are the same as those of the plain message.
The cipher was abandoned by the Germans following an article in the French newspaper Le Matin in November 1914, which praised the success of the decryption by the French. Any reference to German coded messages or to the newspaper Le Matin is a clue.
Attempting permutations by brute force is possible as long as the key is not too large (the number of possible permutations is equal to N! With N the size of the key).
The number of null letters is generally limited to 1 or 2. According to some sources, the number of null letters corresponded to the number of words in the permutation key.
The Ubchi figure could be made more complex by repeating the transposition several times or by performing a double transposition by modifying the key the second time.
The Ubchi cipher was used at the start of the First World War.
The principle of encryption by transposition dates from well before.
dCode retains ownership of the "Ubchi Cipher" source code. Except explicit open source licence (indicated Creative Commons / free), the "Ubchi Cipher" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or the "Ubchi Cipher" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Ubchi Cipher" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!
Reminder : dCode is free to use.
The copy-paste of the page "Ubchi Cipher" or any of its results, is allowed (even for commercial purposes) as long as you credit dCode!
Exporting results as a .csv or .txt file is free by clicking on the export icon
Cite as source (bibliography):
Ubchi Cipher on dCode.fr [online website], retrieved on 2024-11-21,