FiloSottile / age

A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.
https://age-encryption.org
BSD 3-Clause "New" or "Revised" License
15.79k stars 477 forks source link

Add gomobile support #381

Closed MarinX closed 2 years ago

MarinX commented 2 years ago

This PR adds agemobile package to support gomobile bind. Gomobile bind is limited by types and while it allows you to generate identity, you cannot encrypt/decrypt.

With agemobile package, we can wrap encrypt/decrypt into supported types (string, bool) so it can be called from Android/iOS.

Attached is an example of a real android device calling the android library(age.aar) to generate credentials and encrypt text. age_mobile_example

FiloSottile commented 2 years ago

Hey, this is extremely cool! I think it's a bit out of scope for this repository, also because I don't do gomobile development myself and wouldn't be in a good position to maintain it, but I would be happy to link to it from an upcoming list of age-related projects and integrations if it were a third-party module you host on your GitHub or elsewhere!

paralin commented 2 years ago

It's only a couple hundred lines of code, is it worth forking for that really?

FiloSottile commented 2 years ago

It would not be a fork, this PR adds a whole separate package which doesn't have to be filippo.io/age/agemobile but can simply be github.com/MarinX/agemobile.

MarinX commented 2 years ago

Thanks for the review and input 🙏

I understand your concerns. I will create a module for it and maintain it.

MarinX commented 2 years ago

just a fyi Repo for the mobile library is located here agemobile