embryo wrote:h0bby1 wrote:The point is to avoid that something that has not managed to get your permission to do something can still do it.
With crypto even if a program has the permission to read sector on the hardrive, it still can't read your files.
If some program has managed to obtain disk read permission then it is possible to read private key. If private key is encrypted, then it is possible to read encryption key. If the encryption key is encrypted, then it is possible to read another encryption key. And so on.
With permissions it is possible to have disk read permission along with system area read permission. So if something has managed to get disk read permission (or circumvent it) then it is still unable to read the system area. And it requires no permanent overhead with encryption/decryption.
h0bby1 wrote:The point would be that the key to access certain things would only be given to the program that are actually supposed to access it.
It complicates the hacking, but when there are some key owners, hackers just need to circumvent permissions, associated with the key owners. Your case just moves hacker attention from simple disk read to a read from particular location within the key owner storage. In case of fine grained permissions the situation is a bit similar, but hacker should manage to obtain two permissions instead of one disk read permission and information about key storage location. It means - two permissions against one permission + some information (which is often well documented in open source projects).
h0bby1 wrote:Potentially, in the extreme, even the kernel itself could not access some resource without an explicit permission from the user.
And it seems the Windows is close to such solution.
the way i see it, those private keys would be generated at boot time, and eventually recycled as frequently as possible, the kernel in the absolute just has to keep track of the key used by running application, but it would not be specially for file/disk encryption, but for the side of authentification in general. To have a way to identify application as being 'genuinely' authorized to do what it pretend it can do in a secure manner.
If the program run in user space, it's easy to limit the access to the hardware if all access go through kernel calls, which would most likely be the case if you want security anyway, and it would be totally possible to make some area of the harddrive unaccessible through kernel calls. And put any security related information there. Any system of permission would be based on the ability of kernel to limit access to hardware anyway. Encryption just make identification more secure.
It's not so much the fact that the data will be "crypted" or "hidden", but that if you have a known set of data, the data resulting from the original data being encrypted with a specific key cannot be falsified.
With a system of crypto, the kernel can have a way to make sure the data it send has not be modified by another program. If you use some kind of token generated by the kernel used to identify the application permission level.
It's not so much to hide this data to the application, but to make the application unable to generate valid data without knowing the private key that encrypted it. If the application has to use kernel generated identification, encrypting them add a layer of security to it. If some permission/Security credential has to be generated by the kernel to be used by an application, encrypting them can make sure the application cannot modify them, or generate valid credentials.
An 'admin' mode would just be used to create and modify those permission level and eventually something to automatically associate certain application with a certain level of permission.
It would still need some equivalent of gid associated with application, but application would be run on the basis of some application domain, and given a credential associated with this permission level in a encrypted form by the kernel that would then condition what function or api the application can use. Could be sort of like a gid, but more flexible. And not only limited to file system access, or even directly linked to file permission at all.
With asymmetric crypto, the destination program can identity the source of the data in a reliable manner from it's public key, and the source program can make sure only the program who has the public key can use the data. But the program having access to public key cannot encrypt data that would be decryptable using this public key.
But it's more the properties to be able to 'sign' the data using a private key that can be used rather than the property to make it hidden or encrypted.
Storing permanent encrypted data is different matter than control of general system function. For system function, the key doesn't have to make it ever on the harddrive, or to user space memory, they just have to be stored in kernel space memory for running application and control authorized action in general.
For file encryption, the key must not be wrote on the hard drive, or not on place that any program can read that's pretty clear lol Either the user would have to enter the key manually, or it would need some special handling in the kernel if the key are to be stored somewhere.
If you had some kind of very sensitive information on your hard drive like some industrial secret, and that you want to be able to run random internet application on it, then the only way to really protect the file from being leaked without bothering about having several account is to crypt them, but the key should be then either entered manually, or stored on a specific media, or on a place that is not readable by applications.
A set of 'permanent' private key could be managed via the kernel, for the purpose of encrypting non temporary data on hard drive, and it could at least be made easier to track and control access to this data, without having to deal with file system based permissions. Even if the kernel has to store a set of permanent key, it can be made in sort that those key never make it to user space at all. But associated with some permission level, and only application run with that permission level can read the information (but can still alterate or modify or delete it if it has harddrive access).
A system like that could be used to reinforce or complement file system based permission, you could make in sort to have application in a certain application domain automatically store all files in an encrypted form, and then not having to bother too much about file system permission regarding potential leaking. But it would require to store those encryption key in a place that is never accessible at all other than in admin mode to add new application domain.
It cannot replace entirely file system based permission for file access, but can help to have solid mechanism to protect data privacy, by requiring explicit user interaction to authorize application to reach some application domain associated with sensitive data for ex, and even if file system security is compromised, it doesn't give the program access to read the sensitive data (provided the key are stored somehow outside of the file system, in a place that is handled specially by the kernel with other interface than file system). It give potentially another level of authorization/security than purely file system based to protect sensitive data from leak.
A file could be stored in any place, in any folder or moved around, from an hd to another or anything without you have to worry about it's permission (unless you want to also prevent delete/corruption).