fork(7) download
  1. class Dakota
  2.  
  3. PRIVATE_KEY = 8411088
  4.  
  5. def self.encrypt(str)
  6. str.gsub(/[A-Z]/){|c|"0#{c.downcase}"}.gsub(/[a-z]+/){|s|xor(s.to_i(36),$')}
  7. end
  8.  
  9. def self.decrypt(str)
  10. str.gsub(/\d+/){|s|out = s.to_i.to_s(36);out[0] = out[0].upcase if s[0]==?0; out}
  11. end
  12.  
  13. def self.xor(n, config)
  14. n^=PRIVATE_KEY if private_env?(config)
  15. n
  16. end
  17.  
  18. def self.private_env?(config)
  19. config =~ /^ .#{private}/i
  20. end
  21.  
  22. end
  23.  
  24. puts code = Dakota.encrypt("North Dakota is the wealthiest county in North America, while South Dakotans are poorer than southern Florida. - the North Dakotan government")
  25.  
  26. puts out = Dakota.decrypt(code)
  27.  
Success #stdin #stdout 0.01s 7432KB
stdin
Standard input is empty
stdout
048188933 0803821726 676 38210 3290245289095277 767335462 671 039786965 023122877338, 54564962 039786965 01041752957752 13946 1553120451 1375439 2248302877187 033963119038. - 38210 048188933 028937582159 1695127380776633
South Dakota is the wealthiest county in North America, while North Dakotans are poorer than southern Florida. - the South Dakotan government