Skip to content

Instantly share code, notes, and snippets.

@jonahoffline
Created February 13, 2013 13:04
Show Gist options
  • Save jonahoffline/4944459 to your computer and use it in GitHub Desktop.
Save jonahoffline/4944459 to your computer and use it in GitHub Desktop.
Crypt example.
class CustomAuth
def initialize(secret)
@secret = secret
end
def encrypt(key)
@secret.crypt(key)
end
def decrypt(key)
if encrypt(key) == key
'authenticated'
else
'error: wrong key'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment