Treating duplications and creating the random secret code