Created working encryption fn.