Advertisement
Guest User

Untitled

a guest
Oct 9th, 2015
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.63 KB | None | 0 0
  1. Encryptor:
  2.  
  3. #!/usr/bin/ruby
  4.  
  5. flag= ???
  6. str = "0123456789abcdef"
  7. chr = "!\"#%&()+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[^_`abcdefghijklmnopqrstuvwxyz~"
  8. bin = "0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111"
  9. flags = flag.scan /\w/
  10. hh=flags.map{|h| h.unpack('H*')}.join()
  11. a=hh.scan /\w/
  12. b=a.map{|x|str[bin.index(bin[str.index(x)*5,4].reverse)/5,1]}.join
  13. c=[]
  14. for y in 0..(b.length/2)
  15.     c.push(b[y*2,2].hex.chr.encode('utf-8','iso-8859-1'))
  16. end
  17. i=chr.length-1
  18. d=c[0,c.length-1].join()
  19. f=[]
  20. e=d.split("").each do |z|
  21.     f.push(chr[rand(0..i),1] + z + chr[rand(0..i),1])
  22.     end
  23. p f.join()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement