Quick Encryption/Decryption Utility

lock on keyboard

Need a quick program to encrypt or decrypt small amounts of text, such as passwords? Here’s a quick utility I wrote in Python using Google Colab, Google’s implementation of Jupyter Notebooks. You can run the program there or copy it to your own Google Drive first. Note that you’ll need a Google account to access it.


I personally use this utility to encrypt sensitive information in Google Keep, as shown in the screenshot below. I save the URL of the utility with the encrypted text so I can decrypt it quickly.

(For longer notes, I’d honestly recommend a proper password manager that can encrypt notes. I use the Premium version of Bitwarden, which I highly recommend.)

The instructions in the program should be adequate to run it on your own.

Bookmark it in your browser for quick access! (Ctrl-D on your PC or Command-D on your Mac)

Python f-strings: Use of “=” (very cool!)

In Python f-strings, the equal sign (=) is used to print both the variable name and its value in a string. It is used to facilitate print-debugging by expanding to the text of the expression, an equal sign, then the representation of the evaluated expression. For example, if you have a variable named x with a value of 5, you can use an f-string like this: f'{x=}' which will expand to 'x=5'⁷.

Try it out here!

Source: Conversation with Bing, 3/30/2023

(1) python – What does = (equal) do in f-strings inside the expression …. https://stackoverflow.com/questions/59661904/what-does-equal-do-in-f-strings-inside-the-expression-curly-brackets Accessed 3/30/2023.

(2) Python f-String Tutorial – String Formatting in Python Explained with …. https://www.freecodecamp.org/news/python-f-strings-tutorial-how-to-use-f-strings-for-string-formatting/ Accessed 3/30/2023.

(3) Python f-strings: Everything you need to know! • datagy. https://datagy.io/python-f-strings/ Accessed 3/30/2023.

(4) Python 3’s f-Strings: An Improved String Formatting Syntax (Guide). https://realpython.com/python-f-strings/ Accessed 3/30/2023.

(5) PEP 498 – Literal String Interpolation | peps.python.org. https://peps.python.org/pep-0498/ Accessed 3/30/2023.

(6) Modulo String Formatting in Python – Real Python. https://realpython.com/python-modulo-string-formatting/ Accessed 3/30/2023.

(7) f-strings in Python – GeeksforGeeks. https://www.geeksforgeeks.org/formatted-string-literals-f-strings-python/ Accessed 3/30/2023.

(8) What does ‘f’ mean before a string in Python? – Stack Overflow. https://stackoverflow.com/questions/58233423/what-does-f-mean-before-a-string-in-python Accessed 3/30/2023.

This post was inspired by this tweet:

Hey Bing Chat: How can I compile a Python program into an executable file?

Bing Chat is an AI alternative to Chat-GPT. I’ve been testing it quite a bit since, at least for now, it is completely free and in most cases does an excellent job.

Here is a test case that worked perfectly for me…

Prompt: How can I compile a Python program into an executable file?

There are several ways to compile Python code into an executable file. One of the most popular ways is to use PyInstaller² which can be installed using pip package manager². Once installed, you can use it to create an executable file by running the following command in your terminal:

Continue reading “Hey Bing Chat: How can I compile a Python program into an executable file?”