Files
davideisinger.com/bin/encrypt
David Eisinger 4960096457 Add photos
2025-07-01 11:41:27 -04:00

23 lines
409 B
Ruby
Executable File

#!/usr/bin/env ruby
file = ARGV.pop || raise("please supply a filename")
raise("file '#{file}' does not exist") unless File.exist?(file)
%x(
openssl \
aes-256-cbc \
-in #{file} \
-out #{file}.enc \
-pass file:secret.key \
-iter 1000000
)
output = %[{{<dither #{ File.basename(file) } "782x600" />}}]
IO.popen("pbcopy", "w") { |pb| pb.write(output) }
puts output
File.delete(file)