Method: File.encrypt
- Defined in:
- lib/ronin/support/crypto/core_ext/file.rb
.encrypt(path, cipher, block_size: 16384, output: nil, **kwargs) {|block| ... } ⇒ String
Encrypts the file.
237 238 239 240 241 242 243 |
# File 'lib/ronin/support/crypto/core_ext/file.rb', line 237 def self.encrypt(path,cipher, block_size: 16384, output: nil, **kwargs,&block) cipher = Ronin::Support::Crypto.cipher(cipher, direction: :encrypt, **kwargs) file = File.open(path,'rb') return cipher.stream(file, block_size: block_size, output: output,&block) end |