Skip to content

Instantly share code, notes, and snippets.

@krio
Created September 9, 2010 06:02
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 krio/571459 to your computer and use it in GitHub Desktop.
Save krio/571459 to your computer and use it in GitHub Desktop.
require 'crypt/rijndael'
#Set a pass-phrase that only you and receiver know
super_secret_key = Crypt::Rijndael.new("Don't tell anyone this key")
#Encrypt a string using the secret key
encrypted_string = super_secret_key.encrypt_string("this is the string that we need to hide!!")
#Decrypt the string using the same secret key
decrypted_string = super_secret_key.decrypt_string(encrypted_string)
@igorescobar
Copy link

What about the iv?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment