Skip to content

Instantly share code, notes, and snippets.

@lkdocs
Created September 11, 2013 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lkdocs/6526427 to your computer and use it in GitHub Desktop.
Save lkdocs/6526427 to your computer and use it in GitHub Desktop.
require 'openssl'
def encrypt_RSA(key, message='my plaintext string')
key.public_encrypt(message, OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment