[0] https://www.kernel.org/doc/html/v4.17/crypto/userspace-if.ht...
https://en.wikichip.org/wiki/x86/sme
https://www.kernel.org/doc/Documentation/x86/amd-memory-encr...
From the quick description it sounds like this provides a way of encrypting, per memory page, based on a symmetric key that is backed by some level of hardware encryption. It was not clear (in a quick read) how or where to specify the key by which an individual page is encrypted. That would be a critical component of comprehension with respect to identifying if this could be used to encipher individual processes and further isolate memory. It sounds like it might be possible to establish per-process memory isolation, which is probably the best level of security possible without resorting to entirely isolated hardware.
Additionally a per-process key does not help against spectre style attacks where you would trick the process into speculating on protected memory.
Transparent disk encryption, not a problem since devices have filesystems which can implement encryption at that layer.
Note: inside the enclave there is a performance loss but that's due to MAC checks. If you just want encryption without integrity against tampering you don't need that.
SME/MKTME add hardware support for this.
https://info.varnish-software.com/blog/introducing-varnish-t...
Ah, so we'll just have to trust you that it's doing anything at all, then.
> https://news.ycombinator.com/newsguidelines.html
Forgive me but can we not be skeptical of claims made about a commercial product?
It's also not helpful to post such a clichéd dismissal of what someone else says or their work. That's in the site guidelines too.
There's also the problem of making sure that your internal API is sound and doesn't copy the key around. In languages like C it's relatively easy to achieve (because copying a buffer in C normally requires some explicit code) but in higher level languages you might easily mistakenly pass the key object by copy instead of reference, leaving some duplicate of the sensitive information in some other location in RAM.
I think there really should be some kind of industry-standard multiplatform library meant to deal with secret keys that would implement all that behind the scenes and offer a simple API. It's simply too easy to make a dumb mistake when implementing these things, and you won't notice anything is wrong until somebody attempts to actually recover the key somehow.
Or you can use explicit_bzero(), which is designed for that use case.
You really need a mfence (full memory barrier), not just a compiler barrier, maybe even a clflush.
https://www.usenix.org/system/files/conference/usenixsecurit...
I agree with you on a standard platform. Id get a company like Galois to build it. They already have and open-sourced the necessary tooling from thrir prior contracts.
Now, in MY opinion, the whole idea of servers storing OR MANIPULATING unencrypted user-submitted information is what’s wrong with our current Internet culture. This needs to stop. It has massive social and economic effects and creates honeypots for hackers.
The sooner we make end-to-end encryption a basic expectation, the sooner we change our society to have a far more private and safe environment for everyone, and correct massive power imbalances: an organization or user should have power and data and connections and ability to SPAM others because people VOLUNTARILY gave them those things, not because they happened to build proprietary software and run it on infrastructure that is needed to operate the application!!!
I am not sure this is a bad place for security through obscurity. ASLR is similar. The thing is, here we are not using this is a primary mechanism. (that would be preventing RCE) Instead, this would be a secondary 'defense in depth' measure meant to make it harder to deploy an exploit after you have been compromised.
For such a second layer of defense in depth, obscurity is a decent option. Things go wrong if you start relying on your obscurity to do anything but slow down an attacker.
https://github.com/qemu/qemu/blob/master/docs/amd-memory-enc...
https://github.com/andy-goryachev/PasswordSafe/blob/master/s...
Curiously, RAM encryption, and its relative - clearing secrets from memory when not in use - cannot be added to the Bouncycastle library because they use java BigInteger (unless reflection is used of course).
example:
https://github.com/andy-goryachev/PasswordSafe/blob/master/s...
byte[] key = generateKey(); try { // sensitive operation } finally { Crypto.zero(key); }
once the operation finishes, the memory is cleared (and possibly subject to gc)
the problem is that some java classes, for instance BigInteger, are not designed for cryptographic operations - it's underlying arrays are not easily accessible (save for reflection).
A very good point, thank you.
What could be done to mitigate this? Direct ByteBuffer per
https://stackoverflow.com/questions/5670862/bytebuffer-alloc...
?
Assuming you mean oracles implementation, it's likely that it is.
https://www.sjoerdlangkemper.nl/2016/05/22/should-passwords-... http://www.daemonology.net/blog/2014-09-04-how-to-zero-a-buf... https://man.openbsd.org/explicit_bzero.3
Short answer is yes usually, and if not, you can always do inline asm. Of course, you're really, really, really not supposed to write your own crypto.
In my opinion server-applications of all sorts should encrypt their private keys by default; this makes cold-boot attacks and other memory-escape attacks so much harder, since now two totally unrelated memory chunks have to be combined in order to retrieve the private key (in fact one could argue that, the higher the quantity of memory chunks is, the harder it is to correctly decrypt the original private key; although to me this has the security through obscurity smell).
In practice however, this is rarely done. OpenSSL for example has a whole lot of memory-management functions [1], but none of them seem to include RAM encryption (AFAIK it is not present in the source code elsewhere either, but it's a large one, so I am not familiar with all code. Related: in fact some people even argue it's way too large for it's own good [2]).
Even better still, would be to use the CPU Cache for private keys, since this memory is even more difficult to access through any sort of cold boot. An interesting paper with much more information about this subject can be found here [3], to whom it may concern.
[0] https://github.com/veracrypt/VeraCrypt/commit/321715202aed04...
[1] https://www.openssl.org/docs/man1.1.0/man3/OPENSSL_zalloc.ht...
[2] https://queue.acm.org/detail.cfm?id=2602816
[3] https://www.ieee-security.org/TC/SP2015/papers-archived/6949...