Functional OpenSSL encrypt and decrypt in Ruby
As part of a project I am working on, I wanted to have a method for unsubscribing users from a mailing list without having to log in — just click and unsubscribe. I wanted to keep the URLs opaque and unguessable while not requiring a database hit to guarantee authenticity or a full table scan before going about the main work of unsubscribing the user. Encrypting a unique key, in my case the email address, for the user will accomplish these goals.