Project 701 ~ Python (3)
I attended a Python meetup group in May 18th 2017. Krupesh was giving a presentation on Python and what it is capable of. The day after this meeting I decided I was going to start learning Python. The first thing I did was make a file containing the basic syntax of the Python programming language. This would become the foundation for what I know today. My first program was from a tutorial I followed which was to create a simple number guessing game. This game can be found under my path to programming repository. The program was simple, but it would serve as the base for learning two other skills in Python; logging and mysql/sqlite database interactions. Logging was something that I saw as a basic skill that a developer should know, which is why I prioritized learning it second. I also planned to learn how to interact with a mysql/sqlite database, using the logs as the data to be inserted. What I quickly realized was with the current state of my number guessing game, it would take a very long time to generate a decent amount of logs. So I decided to automate the game by replacing the user guess input with a (pseudo)randomly generated number. Inserting the logs was a learning experience of its own. When I first tried, I had no idea how to seperate the values, hence the disgusting slices in the mysql example on lines 22-30. At the time I didn’t know any better, and this was the case until I learned about strings.split()
.
Since that first program I’ve made a number of projects some can be found on my Github, ranging in size and dealing with various topics. My favorite project so far has been my password hashing program; SBH. This program takes a plain text and a number for ciphers applied; then outputs a 256 bit hash. This might sound just like normal hashing, but what makes SBH different is the layering of ciphers. Currently the cipher used is the casesar cipher which simply means a number (rotation) is chosen from 1-26 (in this case english is the language used ~ hence 26 possible rotations, but I don’t see why it couldn’t be applied to other languages) and each character of plain text is offset by that rotation. The original iterations of SBH gave the user the ability to choose the rotation(s), but I quickly found that it was a massive bottleneck. This was because if the user wanted a number of ciphers above say 10, then they would have to memorize and enter all 10+ rotations. What I realized at this point was if I automatically generated the rotation(s), then the user could choose any number (1 < n < infinity).
Ever since programming clicked for me (especially with Python) 3 years ago I have been learning non-stop. I have come to realize that I have always been and will always be an eternal student. Because of this I have decided to not make this post about learning Python, but rather reflecting on the path that I took to learn it.