Live data from Hacker News

Swift Homomorphic Encryption

swift.org

121–130 of 135 posts

Re: Swift Homomorphic Encryption

#121
post #88

Earlier quoted context omitted.

In this PIR model the server has to read the whole database, otherwise it would be easy on the server to see, that these rows were not accessed and therefore they are not the one the client queried. In this PIR model the server runtime is O(n) where n is the number of rows. To keep it practical, we do support sharding the database. Client leaks a few bits of hashed query to pick the right shard, where we process the…

Thanks for explanation. I will read the code to see how sharing works.

https://github.com/apple/swift-homomorphic-encryption/blob/3...

Run SHA256 on the keyword, truncate the hash and take the modulus with number of shards.

Re: Swift Homomorphic Encryption

#122
post #93
post #28

I wrote some basic homomorphic encryption code for a hackathon like 8 years ago. When I interviewed for a BigTechCo [1] about a year later, the topic came up, and when I tried explaining what homomorphic encryption was to one of the interviewers, he told me that I misunderstood, because it was "impossible" to update encrypted data without decrypting it. I politely tried saying "actually no, that's what makes homomorp…

> he told me that I misunderstood, because it was "impossible" to update encrypted data without decrypting it. I politely tried saying "actually no, that's what makes homomorphic encryption super cool", and we went back and forth; eventually I kind of gave up because I was trying to make a good impression. The moment you have to explain yourself you've already lost. No argument you make will change their mind. They a…

It's not stupid to intuitively doubt HME and ask for an explanation if you've never heard of it before, but to argue that it's impossible without knowing anything about it, yeah.

Re: Swift Homomorphic Encryption

#123
post #101

Earlier quoted context omitted.

It is more like a symmetric cipher. Once you have a key you can decrypt everything encrypted with that key

the risk in this is that FHE is proposed as a privacy protecting tech, and it will "squeeze a lot of toothpaste out of the tube" in private data sharing, where a weakness will be a rug pull under all the data subjects whose data was shared under the aegis of being "encrypted." It's important to understand this failure mode, imo.

I don't see how a bad actor can "rug pull" when everyone has a different encryption key.

A cryptographic scheme weakness is a threat to all computing systems, it's not worse for FHE. It's just that FHE relies on newer encryption than existing widely deployed crypto.

Re: Swift Homomorphic Encryption

#124
post #78
post #28

I wrote some basic homomorphic encryption code for a hackathon like 8 years ago. When I interviewed for a BigTechCo [1] about a year later, the topic came up, and when I tried explaining what homomorphic encryption was to one of the interviewers, he told me that I misunderstood, because it was "impossible" to update encrypted data without decrypting it. I politely tried saying "actually no, that's what makes homomorp…

This happened to me in a grant application. We had written a web application that did a homomorphic encryption based calculation of molecular weight to demonstrate that HE could be used to build federated learning models for chemical libraries. Our reviewers told us that machine learning on encrypted data was impossible. We had the citations and the working model to refute them. Very frustrating.

What was the end result? I was almost roped into a project like this, encrypted ML for biology applications. It was definitely possible, but it seemed too slow to be worthwhile. Other federated learning projects shut down because it was wayy more efficient on a single cluster, and that was without the HE tax. I also have no idea if you can practically do HE matrix operations on a TPU or GPU or CPU SIMD at least; presumably that's something the research would cover.

Then again I didn't test very much because they also wanted it to be the proof of work for a blockchain, a possibility that I didn't discount but also figured it'd be extremely hard and I wasn't the guy to do it.

Re: Swift Homomorphic Encryption

#125

This must be the first real world use case of HE. It has generally been considered too slow to do anything useful but this is an excellent use case.

I believe Cipherstash is using HE to do what they do: https://cipherstash.com

it says on their webpage that they aren't using HE

Re: Swift Homomorphic Encryption

#126
post #92

FHE is cool but I wonder how many use cases it actually fits. Don’t get me wrong, it gives better security guarantees for the end user but do they really care if the organization makes a promise about a secure execution environment in the cloud? Also from an engineering point of view, using FHE requires a refactoring of flows and an inflexible commitment to all processing downstream. Without laws mandating it, do org…

> but do they really care if the organization makes a promise about a secure execution environment in the cloud? Uh... demonstrably yes? No "secure execution environment" is secure against a government wiretap order. FHE is.

Unless the operating system for iPhones is open source and one can verify which version they have installed, users can't really be sure that Apple is doing this. They could just say they are doing things to protect user's privacy, and then not, and sell their data.

Re: Swift Homomorphic Encryption

#127

Earlier quoted context omitted.

It does - otherwise you would know which numbers are queried to process the query, letting you narrow things down (ie huge side channel and thus not HE anymore).

How so? You can just query all the numbers and discard results you don't want.

Sure, you can query the database all you want. The important property is that the server cannot observe the client querying the database - processing a query occurs in an encrypted space that it does not have the keys to. Similarly, one would expect that each query, even if it's for the same phone number, would be observed to be reading randomly from the database each time.

Re: Swift Homomorphic Encryption

#128
post #71

Earlier quoted context omitted.

Exactly, plain text phone number in the same db row

Yeah but as I wrote elsewhere, the DB isn’t a KV store of plain text numbers and their encrypted representation. Instead the entire database would be encrypted and you’d do set containment operations in encrypted space which wouldn’t /couldn’t leak anything about your query (modulo unexpected side channels in the design). I don’t know how they do this efficiently and at scale with lots of updates, but maybe this data…

That could only work if the server didn't have its own database copy. Not sure how a client would be able to provide the server with a database encrypted by the client.

If the server can decrypt it, it's not really safe if you're assuming server is evil

Re: Swift Homomorphic Encryption

#129
post #67

Earlier quoted context omitted.

In my experience this comes up a lot less often when people are paid to be empirically right, and the most annoying arguments occur when no one has an interest in being right and instead wants to defend their status. e.g. try telling a guy with his date nearby that he's wrong about something irrelevant like how state alcohol minimum markups work. An even more common scenario is when someone is passionate about a poli…

That does kind of make sense though - if you are paid to be right but someone doesn't believe you, you are still getting paid, so what does it matter?

I was referring to the situations where being right directly means you make money - right about price movements, right about what users want, right about whether oil is present in a particular digging location, etc. In those cases you only get paid if you actually are right.

Re: Swift Homomorphic Encryption

#130

Earlier quoted context omitted.

Yeah but as I wrote elsewhere, the DB isn’t a KV store of plain text numbers and their encrypted representation. Instead the entire database would be encrypted and you’d do set containment operations in encrypted space which wouldn’t /couldn’t leak anything about your query (modulo unexpected side channels in the design). I don’t know how they do this efficiently and at scale with lots of updates, but maybe this data…

That could only work if the server didn't have its own database copy. Not sure how a client would be able to provide the server with a database encrypted by the client. If the server can decrypt it, it's not really safe if you're assuming server is evil

The database isn’t secret here. The server indeed has its own copy - it would have to otherwise what is the client query resolving against. What’s secret is which phone numbers are contacting the client. So instead of sending the phone number to the server, you send an encrypted version of the phone numbers. This encrypted version is then checked against the encrypted database. This prevents the evil server from discovering the phone number the client is checking.

If you read the docs, a perfectly valid implementation is an HTTP request that sends the unencrypted database to the client which then checks the numbers locally - it achieves equivalent security priorities. The advantage here is that the database can be large enough to make distribution less practical than just doing a lookup per number and that’s where the HE comes in.

Remember: evil in a security context means someone trying to actively circumvent your protection guarantees, but you’re making an assumption that the database needs to be secret when it may not as the privacy and security guarantees are about the client’s information. Apple isn’t necessarily saying the database is secret since it’s just “this phone number is likely spam”. Of course, it’s possible that the server itself can’t even generate a valid query. It’s possible Apple designed it such that the query has to be generated on a valid Apple device to begin with (since it has a chain of trust to each device manufactured).

Post reply on HN