Module for encrypted String.
# File lib/origami/encryption.rb, line 482 def decrypt! unless @decrypted key = compute_object_key self.replace(@algorithm.decrypt(key, self.to_str)) @decrypted = true end self end
# File lib/origami/encryption.rb, line 461 def encrypt! if @decrypted key = compute_object_key encrypted_data = if @algorithm == ARC4 or @algorithm == Identity @algorithm.encrypt(key, self.value) else iv = Encryption.rand_bytes(AES::BLOCKSIZE) @algorithm.encrypt(key, iv, self.value) end @decrypted = false self.replace(encrypted_data) self.freeze end self end
Generated with the Darkfish Rdoc Generator 2.