Ruby - Jednoduché šifrování
Ukázkový program Jednoduché šifrování textu včetně zdrojových kódů v jazyce Ruby.
puts "Zadejte text k sifrovani" text = gets.upcase.strip puts "Zadejte heslo k sifrovani" passwd = gets.upcase.strip # zasifrovani textu text.length.times do |i| text[i] += passwd[i % passwd.length ] - (?A - 1) text[i] -= (?Z - ?A + 1) if (text[i] > ?Z) end puts text