Optimization of encrypted holograms in optical security systems