Is it possible to use an iPhone as an external encrypted drive accessible by iOS and any unix-based OS? Is it possible to use an iPhone in a way that can be encrypted and accessed by both iOS and any unix based OS as an external  drive? Even if additional software or tinkering is necessary in either system.

Reasoning is that I always carry it with me and it seems a much more secure alternative to uploading sensitive files to Dropbox so I can access them by the phone and any other computer.



~~I will be cross-posting this question to several other subject related stack communities in the hopes to obtain a good answer. I haven't been around here for a while; let me know if this is not kosher and I'll remove them~~ Edit: I've been advised against this, so moot now.
The short answer is, yes. There are a huge number of file manager apps out there. The trick is to find one which is (a) secure and (b) provides a webdav server so you can access the files on the device from other machines on the network (via a web browser or other webdav client).

I use Files by Olive Toast, which certainly fits your second criterion. Another one which looks like it would is EZ Server by Lisa Burns.

Regarding security, it depends what you're looking for. Do you want the files stored in encrypted storage on your iOS device? That's how iOS works for everything. Do you want them protected by a password? Isn't your iOS passcode enough? Do you want the webdav server to support https? Probably only necessary if you're using public Wi-Fi networks.