rewritten crypto[*] to Ruby