Morse Code (Python)

Morse Code (Python)

11th January is #LearnYourNameInMorseCodeDay.

GCHQ Morse Code
GCHQ Morse Code

I found this out as GCHQ tweeted the following today:

geektechstuff_morse_code_py_0
GCHQ Morse Code Tweet

Which is Morse Code. I’ve never learned Morse Code, but wanted to know what GCHQ were tweeting about. I few solutions came to mind:

  1. Convert the morse manually
  2. Use an online tool to convert the Morse
  3. Build a Python tool to convert the Morse

As I have recently been getting to grips with ciphers in Python, and as I wanted a little challenge I went with option 3 and got Python to convert the Morse for me.

geektechstuff_morse_code_py_1
Python Morse Code Translator

I found it easier to translate English to Morse as I hit a small snag with looking up a dictionary key by its value. Thankfully StackOverFlow had the answer.

The complete Python code is available on my GitHub here: https://github.com/geektechdude/Python_Encryption/blob/master/geektechstuff_morse_code.py

geektechstuff_morse_code_py_2
.-.. . .- .-. -. / -.– — ..- .-. / -. .- — . / .. -. / — — .-. … . / -.-. — -.. .

If you like puzzles / challenges then I recommend following the GCHQ Twitter feed. There are also two GCHQ puzzle books, and they have a GitHub (https://github.com/gchq).

One response to “Morse Code (Python)”

  1. Instant Messaging App With Vigenère Encryption (Python) – Geek Tech Stuff Avatar

    […] to brute force the Caesar cipher, Python to encrypt / decrypt with the Vigenère cipher , some Morse code and RSA Public […]

    Like

Welcome to GeekTechStuff

my home away from home and where I will be sharing my adventures in the world of technology and all things geek.

The technology subjects have varied over the years from Python code to handle ciphers and Pig Latin, to IoT sensors in Azure and Python handling Bluetooth, to Ansible and Terraform and material around DevOps.

Let’s connect