Skip to content

Instantly share code, notes, and snippets.

@jasonmadigan
Created June 11, 2009 12:18
Show Gist options
  • Save jasonmadigan/127868 to your computer and use it in GitHub Desktop.
Save jasonmadigan/127868 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# Solution for http://www.dailyperfect.com/jobs/
# char msg_rot_something[] = {129, 146, 139, 158, 74, 147, 157, 74, 158,
# 146, 143, 74, 139, 152, 157, 143, 156, 74, 158, 153, 74, 158, 146, 143,
# 74, 155, 159, 143, 157, 158, 147, 153, 152, 74, 153, 144, 74, 150, 147,
# 144, 143, 86, 74, 159, 152, 147, 160, 143, 156, 157, 143, 74, 139, 152,
# 142, 74, 143, 160, 143, 156, 163, 158, 146, 147, 152, 145, 105, 74, 125,
# 143, 152, 142, 74, 163, 153, 159, 156, 74, 156, 143, 157, 154, 153, 152,
# 157, 143, 74, 161, 147, 158, 146, 74, 163, 153, 159, 156, 74, 156, 143,
# 157, 159, 151, 143, 74, 158, 153, 74, 148, 153, 140, 157, 106, 142, 139,
# 147, 150, 163, 154, 143, 156, 144, 143, 141, 158, 88, 141, 153, 151, 52,
# 55, 0};
def decrypt msg, offset
msg.each do |x|
x+=offset
x-=26 if x>?Z
x+=26 if x<?A
print x.chr
end
puts
end
chars = [129, 146, 139, 158, 74, 147, 157, 74, 158, 146, 143, 74, 139, 152, 157, 143, 156, 74, 158, 153, 74, 158, 146, 143, 74, 155, 159, 143, 157, 158, 147, 153, 152, 74, 153, 144, 74, 150, 147, 144, 143, 86, 74, 159, 152, 147, 160, 143, 156, 157, 143, 74, 139, 152, 142, 74, 143, 160, 143, 156, 163, 158, 146, 147, 152, 145, 105, 74, 125, 143, 152, 142, 74, 163, 153, 159, 156, 74, 156, 143, 157, 154, 153, 152, 157, 143, 74, 161, 147, 158, 146, 74, 163, 153, 159, 156, 74, 156, 143, 157, 159, 151, 143, 74, 158, 153, 74, 148, 153, 140, 157, 106, 142, 139, 147, 150, 163, 154, 143, 156, 144, 143, 141, 158, 88, 141, 153, 151, 52, 55, 0]
decrypt(chars, -16)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment