In UNIX, is it possible to password protect a directory?

Is there a way to password protect a directory in UNIX? Something like:

~$ cd dir
~$ Password:
~/dir$

The Unix way of doing it is through the existing permissions, make that directory, and its contents owned by a specific owner and/or group and require everyone to su to that owner or be part of that group to access the contents by removing read and write privileges from everyone but that user and/or group, su will prompt for the password.


In theory you could do something along the lines of storing the directory content in an encrypted file and letting fuse provider decrypt it into a filesystem - but first presenting the user with a dialog. (and presumably blocking the system calls to that filesystem until the user enters passphrase)

Dirty, but it could work.