Word cipher using Ruby code