converted encrypto code to module