Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rc4'
- if ARGV.size != 1
- puts "Usage: #{$0} <key>|<content>\n\n"
- exit 1
- end
- (key, cypher_text) = ARGV[0].split('|')
- key = key.split('').sort.join
- rc4 = RC4.new(key)
- s = cypher_text.scan(/../).collect{|x| [x.hex].pack('C')}.join
- puts rc4.decrypt(s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement