Skip to content

Instantly share code, notes, and snippets.

Avatar

Syd esoterik

View GitHub Profile
@esoterik
esoterik / ascii_encoder.rb
Created Sep 6, 2019
ruby script to encode characters in whitespace
View ascii_encoder.rb
def substitute(art, count)
split = art.split ""
spaces = split.each_index.select { |i| split[i] == " " }
to_alter = spaces.sample(count)
to_alter.each { |i| split[i] = "\u2800" }
split.join ""
end
ascii = ["
@esoterik
esoterik / least_significant_bit_stego.rb
Created Sep 18, 2018
ruby script to hide a string in an image
View least_significant_bit_stego.rb
require 'rmagick'
require 'chunky_png'
# Simple least significant bit steganography. Hides a message in the
# least significant bit of the red channel of the image.
#
# Requires ImageMagick, Ruby 2.5, rmagick gem, chunky_png gem
#
# To encode a message:
# ruby lsb.rb encode image_file message encdoded_filename