catchat/runner.rb

50 lines
1.2 KiB
Ruby

require "rmagick"
require "./image_utils.rb"
require "./encode_image.rb"
img = Magick::ImageList.new "./images/original/arty_2.jpg"
#srand(12345)
pass = "my_password"
message = "This is the message that I would like to save please " +
"and thank you also I love you? AND apostrophe's, and " +
"also some commas somewhere hiding around here, It's " +
"gonna be pushing it a bit here... 1234567 let's huck " +
"some more stuff in here to bump it to 255. Wow. We " +
"are going even further. further than anyone believed " +
"`~!@\#\{$%^&*()-_=+\][}{';:'}]} Wooow. 123456789!1234" +
"56789! so put 15 more??????400!"
#message = "tests"
puts message.length
puts message
puts
puts "Initializing EncodeImage..."
start = Time.new.to_f
em = EncodeImage.new(pass, message, img)
puts em.encode
puts "Took " + (Time.new.to_f - start).to_s + " seconds to encode... 🐱"
puts
start = Time.new.to_f
result = em.decode
puts result
puts "Took " + (Time.new.to_f - start).to_s + " seconds to decode... 🐱"
if message == result then
puts "WOW THEY MATCH! 🐱🐱🐱🐱🐱🐱🐱🐱"
end
exit
puts
puts "Done!"