Naive Diffie-Hellman Implementation in Ruby
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.