Method: RbNaCl::SimpleBox#open
- Defined in:
- lib/rbnacl/simple_box.rb
#open(enciphered_message) ⇒ String Also known as: decrypt
Decrypts the ciphertext with a random nonce
Takes a ciphertext, optionally decodes it, then splits the nonce off the front and uses this to decrypt. Returns the message.
97 98 99 100 |
# File 'lib/rbnacl/simple_box.rb', line 97 def open() nonce, ciphertext = extract_nonce(.to_s) @box.open(nonce, ciphertext) end |