Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is compilation of SEAL for Android and IOS possible? #25

Closed
alexej-sh opened this issue Apr 9, 2019 · 11 comments
Closed

Is compilation of SEAL for Android and IOS possible? #25

alexej-sh opened this issue Apr 9, 2019 · 11 comments

Comments

@alexej-sh
Copy link

Hello guys, is it possible to compile SEAL for Android and IOS or are there any obstacles to run SEAL on Android/IOS?

Thanks

@WeiDaiWD
Copy link
Contributor

WeiDaiWD commented Apr 9, 2019

Android/IOS devices are mostly 64-bit and support C++ nowadays. I do not see any issue in compiling. For IOS, you do need to write a thin wrapper in Object-C++ to interface with IOS. For Android, we do have a demo application built for Android devices. Please leave this issue open so that it reminds me to send you a link to the source code of that application as soon as it is released.

FYI, in general, homomorphic encryption involves two parties: a client who performs key generation, encryption, and decryption; and a server who performs evaluation. SEAL provides functionalities for both parties. It is not normal to consider an Android/IOS device as the server. Evaluation is computational intense and should be offloaded to a more powerful platform, while key generation, encryption, and decryption are possible and reasonable to be implemented on a mobile device, which is exactly what we do in the aforementioned demo. Unless there is a server running Android/IOS, you should follow the same approach.

@alexej-sh
Copy link
Author

It is not normal to consider an Android/IOS device as the server. Evaluation is computational intense

If we are talking about 20-30 operations (add/sub/mult) on mobile phone, do you think it will take lot of time? Are we talking about milliseconds, seconds or minutes?

@WeiDaiWD
Copy link
Contributor

That overhead highly relies on parameter selection. 20-30 multiplications of ciphertexts can take from milliseconds to seconds (not likely in minutes, but I am not sure what will happen if the mobile phone has power management turned on or has other programs occupying resources). You may test the performance when that Android version is released.

You've got me curious. In what scenario would you want to have a mobile phone perform encrypted computation for you? Maybe move to private chat if you prefer that way. No pressure at all if you do not want to disclose the idea.

@alexej-sh
Copy link
Author

You've got me curious. In what scenario would you want to have a mobile phone perform encrypted computation for you?

My usecase requires to perform computation on data of two different users A and B. So the idea is that user A generates pub, priv keys and encrypt his data. Then sends his encrypted data with his pub key and params to user B. User B encrypts his data with A's pub key and performs computation on data of both users. After that user B sends the encrypted result to user A and he decrypts the result and shares it with user B. Basically I want do computation on input-data of two different sources und only the creator of the input should know the content of it.
Do you think there are some problems with this approach (besides performance issues) or are there better ways to do it?

@kimlaine
Copy link
Contributor

In the scenario you describe both parties need to be semi-honest and not try to attack each other. What you describe amounts to a decryption oracle for B, which exposes the secret key of A to key recovery attacks if B sends a malformed/malicious ciphertext to A instead of a correct ciphertext produced according to the protocol description in your use-case.

Note also that in SEAL it's possible to compute encrypted-encrypted computations but also encrypted-plain computations, so B may not need to encrypt its data at all.

@alexej-sh
Copy link
Author

What you describe amounts to a decryption oracle for B, which exposes the secret key of A to key recovery attacks if B sends a malformed/malicious ciphertext to A instead of a correct ciphertext produced according to the protocol description in your use-case.

This is a good point but luckely in my specific use-case this will not be an issue.

Note also that in SEAL it's possible to compute encrypted-encrypted computations but also encrypted-plain computations, so B may not need to encrypt its data at all.

Thank you for this tipp :)

@BrentLagesse
Copy link

I am also very interested in a link to that application when it is released as I intend to use SEAL in an Android application in the near future.

@zkingri
Copy link

zkingri commented May 19, 2019

Android/IOS devices are mostly 64-bit and support C++ nowadays. I do not see any issue in compiling. For IOS, you do need to write a thin wrapper in Object-C++ to interface with IOS. For Android, we do have a demo application built for Android devices. Please leave this issue open so that it reminds me to send you a link to the source code of that application as soon as it is released.

May I have the source code of the demo application built for Android devices? Thank you.

@kimlaine
Copy link
Contributor

The app source code is available at https://GitHub.com/Microsoft/SEAL-Demo.

@WeiDaiWD
Copy link
Contributor

The app source code is available at https://GitHub.com/Microsoft/SEAL-Demo.
@alexej-sh @BrentLagesse @zkingri FYI
I am closing this issue.

@attackjie
Copy link

该应用程序源代码可从https://GitHub.com/Microsoft/SEAL-Demo获取。

Where can I find the seal method for building on Android? Are there any relevant demos available?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants