Naive Diffie-Hellman Implementation in Ruby
12.9.2020
Because I was a psychology major (and I'm proud of it, dammit!), I missed out on a lot of the CS fundamentals that many developers learn in college. This mostly doesn't hold me back on a day to day basis, but it's always nice to fill in some gaps. One such thing is Diffie-Hellman key exchange. I was inspired by the really awesome Computerphile episode on the topic to write my own implementation. I basically just followed the protocol as laid out on the Wikipedia page.
This is my implementation. It was fun to write! Don't take it too seriously, I just wanted to see the general concept in action.
The Ruby standard library also includes what I'm sure is an actually secure application of the protocol.
It goes without saying, but it's okay to not know things. There are enough bullshitters and know-it-alls in the world already. Showing vulnerability in your knowledge will encourage others to do the same, and we'll all learn more and be better off for it.
Other Posts
The Best Projects Can Be Done in a Weekend
Everyone Has Something To Offer
Book Thoughts: Capital and Ideology
When Does the Magic Comment Work, and When Does it Not?
Benchmarking Arrays Full of Nils
Go, and When It's Okay to Learn New Things
Grouping Records by Month with Ruby
Add Timestamps to Existing Tables in Rails
The Busy and (Somewhat) Fit Developer
TuxedoCSS and the Rails Asset Pipeline
Gem You Should Know About: auto_html
Querying for Today's Date with ActiveRecord