- This topic has 90 replies, 8 voices, and was last updated 3 years, 9 months ago by F6exb.
-
AuthorPosts
-
22nd March 2021 at 3:53 pm #53348Ace661Participant
May be I don’t understand very well but it seems to me that in your two last messages you write as if you were not very sure.
Yes, I have been able to decrypt this challenge, but I am rarely sure – I always consider that the method I used may not be the only option, and if so it may therefore not be the best option. If someone else is tackling it from a different perspective, any clues about my method may not be helpful.
22nd March 2021 at 3:53 pm #53349F6exbParticipantYes, I noticed the codeword from the begining, but my mistake came because “Baudot” is also used for ITA2. In ham radio world we call the code used for RTTY “Baudot code”. Maybe by “abus de langage” (I don’t know how to say in english).
Same thing here at the bottom of the page :
http://www.wavecom.ch/content/ext/DecoderOnlineHelp/default.htm#!worddocuments/baudot.htmNow, I am going back to the challenge.
22nd March 2021 at 5:45 pm #53350MadnessParticipantNo, no, no, no, NO!
Do not take advice fromt wavecom.ch.
Original Baudot code is 5-bit.23rd March 2021 at 10:07 am #53351F6exbParticipantOK. I Wanted only to show that there are mistakes everywhere with the word “Baudot” and that it is used sometimes for ITA1 or for ITA2.
About wavecom.ch:
ITA2 is also a 5 bits code but to synchronise both teletype writers, at the time of transmission a start bit is added before the 5 bits of data and 1.5 or 2 bits stop bits are added at the end. So they said “giving each character a length of 7, 7.5 or 8 bits”.
I don’t confuse: letters are coded with 5 bits.About the challenge, I get a lot of garbage. To be sure :
The ciphertext is punched on a tape, LSB on top.
I cut the tape every 5 characters.
Each block of 5 is rotaded clockwise (or counterclockwise).
The transcription is read vertically LSB on top.
The transcription is translated in plaintext with ITA1 code.PS: Has everybody left the forum?
24th March 2021 at 10:58 am #53353Ace661Participant@F6exb – there are only two possible options, not hundreds, so just try both!
This step will only get you part of the way to the plaintext – Madness has already given all the necessary details.
26th March 2021 at 9:13 am #53356F6exbParticipantI am so sorry for everyone who gave clues but I failed to write a program to translate five bits characters to printable characters using Baudot-UK.
I can decrypt normal letters and punctuation but can’t manage spaces and cancels. So I never got a ciphertext usable for a last decrypt stage.
I know that there is a library in Python, but I wanted to write my own program and I’m using PureBasic.
May be I’ll improve my programing skills for the next challenge.
Thank you everybody.26th March 2021 at 9:13 am #53357F6exbParticipant26th March 2021 at 9:14 am #53358F6exbParticipantSorry, for Coldplay it is ITA2. Harry can you correct my precedent message please ?
[Sorry, bit busy this morning! Harry]
26th March 2021 at 9:14 am #53359Mattyrat2027Participant@Everyone I look forward to seeing a method of decrypt, I’d rather try and solve it with the necessary steps rather than just look at the decrypt…
If there is somewhere I can find this, do say.
Thanks for a brilliant few months!
26th March 2021 at 9:14 am #53352MadnessParticipantDidn’t I say there is still a substitution after the rotation?
26th March 2021 at 1:00 pm #53360F6exbParticipant26th March 2021 at 3:04 pm #53361Mattyrat2027Participant26th March 2021 at 4:28 pm #53362F6exbParticipant@Mattyrat2027
I have understood hints like that: https://2020.cipherchallenge.org/forums/topic/53141/page/6/#post-5335129th March 2021 at 11:14 am #53363MadnessParticipant#!/usr/bin/env python3 # -*- coding: utf-8 -*- null = "█" shift = "↑" space = "_" alphabet = null+"AE/YUIO"+shift+"JGHBCFD"+space+"-XZSTWV*KMLRQNP" latin = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" def keyword_to_key(keyword): key = "" for char in keyword+latin: if char not in key: key += char return key def encrypt_stage1(p,keyword): key = keyword_to_key(keyword) c = "" for char in p.replace(" ",space): if char in latin: c += key[latin.index(char)] else: c += char return c def int_to_bits(n): bits = [] for _ in range(5): bits.append(n&1) n //= 2 return bits[::-1] def bits_to_int(b): result = 0 for bit in b[::]: result *= 2 result += bit return result def encrypt_stage2(p): c = "" while len(p) > 0: block = [x for x in p[:5]] p = p[5:] for i in range(5): block[i] = int_to_bits(alphabet.index(block[i])) for i in range(5): bits = [] for j in range(5): bits.append(block[j][i]) c += alphabet[bits_to_int(bits)] return c def encrypt(p,keyword): while len(p)%5 != 0: p += space c = encrypt_stage1(p,keyword) c = encrypt_stage2(c) return c def decrypt_stage2(c): bits = [] for char in c: bits += int_to_bits(alphabet.index(char)) p = "" for i in range(len(bits)//25): block = bits[25*i:25*i+25] newblock = [] for j in range(5): for k in range(5): newblock.append(block[k*5+j]) for j in range(5): p += alphabet[bits_to_int(newblock[5*j:5*j+5])] return p def decrypt_stage1(c,keyword): key = keyword_to_key(keyword) p = "" for char in c: if char in latin: p += latin[key.index(char)] else: p += char return p def decrypt(c,keyword): p = decrypt_stage2(c) p = decrypt_stage1(p,keyword) return p.replace(space," ") if __name__ == "__main__": from sys import argv if len(argv) != 4: print("usage: "+argv[0]+" encrypt|decrypt <keyword> <text>") exit() keyword = argv[2].upper() text = argv[3].upper() if argv[1][:3] == "enc": result = encrypt(text,keyword) elif argv[1][:3] == "dec": result = decrypt(text,keyword) print(result)
31st March 2021 at 5:06 pm #53365F6exbParticipantDear uncle Madness,
Thank you very much for your program. I learned a lot trying to read it. It works well and I can encrypt or decrypt a plain text. If I give it a text to encrypt, It give me a cipher text which is decrypted back in the same plain text.BUT:
– If I feed it with “DEAR UNCLE WILHELM…” the output isn’t “-ISWM WR_FA L█CO█ CU█FW L……” and reciprocally, I don’t see my uncle.
– You said on Github that “The alphabet was mixed with the Wheatston prescription from keyword FAILURE.”
The output of the procedure ” keyword_to_key(keyword)”, with FAILURE as keyword is:
FAILUREBCDGHJKMNOPQSTVWXYZ
which I think isn’t a mixing using Wheatstone’s prescription but rather a classical method. (document REPORT SP-013 METHODS OF MIXING KEYS which was before in the current case files).– If I comment ” #p = decrypt_stage1(p,keyword)” in the procedure decrypt(c,keyword) I can decrypt “-ISWM WR_FA…” but with a key which is a transposition of the Latin alphabet.
Is all that correct?
-
AuthorPosts
- You must be logged in to reply to this topic.