Towards practical homomorphic encryption and efficient implementation