Both are Black Hat SEO techniques. Cloaking is presenting different versions of webpage to the user while over optimization is redirecting users to other webpages without their knowledge.