It is possible to protect hidden portals and chests, so that they appear as stone to anybody using x-ray. To do this, they must be completely covered, and not touch any transparent blocks at all.
Portals obviously require 2 free spaces inside, to solve this problem, we count levers as solid blocks, so placing 2 levers inside the portal and then covering the rest of the portal will prevent it from being visible. You can test that the portal is properly hidden by covering it up as you would, relogging, and then digging down to it. You should be able to notice that the 'stone' blocks turn into obsidian as you dig down.