generate entities and encode password