{"id":13781343,"url":"https://github.com/MarinX/agemobile","last_synced_at":"2025-05-11T14:35:08.889Z","repository":{"id":37683737,"uuid":"486931346","full_name":"MarinX/agemobile","owner":"MarinX","description":"Gomobile support for Age","archived":false,"fork":false,"pushed_at":"2023-06-16T07:51:22.000Z","size":12550,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T08:44:57.970Z","etag":null,"topics":["age-encryption","android","encryption","golang","ios-swift"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MarinX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-04-29T10:30:36.000Z","updated_at":"2025-04-03T15:16:15.000Z","dependencies_parsed_at":"2024-01-15T20:57:33.499Z","dependency_job_id":null,"html_url":"https://github.com/MarinX/agemobile","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"4073b2028a1df8e99b1336b856fbd72c92dc3a79"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarinX%2Fagemobile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarinX%2Fagemobile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarinX%2Fagemobile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarinX%2Fagemobile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarinX","download_url":"https://codeload.github.com/MarinX/agemobile/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253580388,"owners_count":21930934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["age-encryption","android","encryption","golang","ios-swift"],"created_at":"2024-08-03T18:01:25.075Z","updated_at":"2025-05-11T14:35:03.877Z","avatar_url":"https://github.com/MarinX.png","language":"Objective-C","funding_links":[],"categories":["Implementations"],"sub_categories":[],"readme":"# agemobile\n\nGomobile bind is limited by types and while it allows you to generate identity, you cannot encrypt/decrypt.\n\nThis package wraps age library into usable mobile library.\n\n\u003cimg src=\"./misc/android_screenshot.png\" width=\"250\"\u003e\n\n## Install\n\n### Android\n\n1. Get `age.aar` (You can get `age.aar` from [release page](https://github.com/MarinX/agemobile/releases) or clone the repo and execute `make build-android` to build .aar yourself - Build artifact is located in `build/android` folder.)\n2. Add `age.aar` to `libs` folder in your app project\n3. Include dependency for Android in `build.gradle`\n\n```gradle\ndependencies {\n    ...\n    // AgeMobile aar from Go\n    implementation fileTree(include: ['age.aar'], dir: 'libs')\n}\n```\n\n### iOS\n\n1. Get `Age.xcframework` (You can get `Age.xcframework` from [release page](https://github.com/MarinX/agemobile/releases) or clone the repo and execute `make build-ios` to build yourself - Build artifact is located in `build/ios` folder.)\n2. Copy `Age.xcframework` into iOS project framework folder\n3. Import `Age` in Swift\n\n## Usage\n\n### Android\n\nThere is an example project in [\\_examples/android](./_examples/android/AgeMobile) folder\n\n#### Generate key\n\n```java\nimport agemobile.Agemobile;\n\ntry {\n    age.X25519Identity identity = Agemobile.generateX25519Identity();\n    String privateKey = identity.string();\n    String publicKey = identity.recipient().string();\n} catch (Exception e) {\n    e.printStackTrace();\n}\n```\n\n#### Decrypt\n\n```java\nimport agemobile.Agemobile;\n\n// decrypt text\ntry {\n    String decryptedText = Agemobile.decrypt(\"age-key/s\",\"with or without armor encrypted text\");\n} catch (Exception e) {\n    e.printStackTrace();\n}\n\n// decrypt file\ntry {\n    Agemobile.decrypt(\"age-key/s\",\"input file to decrypt\", \"output path where to write decrypted file\");\n} catch (Exception e) {\n    e.printStackTrace();\n}\n```\n\n#### Encrypt\n\n```java\nimport agemobile.Agemobile;\n\n// encrypt text\ntry {\n    Agemobile.encrypt(\"age-keys\",\"text to encrypt\");\n} catch (Exception e) {\n    e.printStackTrace();\n}\n\n// encrypt file\ntry {\n    Agemobile.encryptFile(\"age-keys\",\"input file to encrypt\", \"output path where to write encrypted file\");\n} catch (Exception e) {\n    e.printStackTrace();\n}\n```\n\n### iOS\n\nThere is an example project in [\\_examples/ios](./_examples/ios/AgeMobile) folder\n\n#### Generate Key\n\n```swift\nimport Age\n\nlet identity = AgemobileGenerateX25519Identity(nil)\nlet privateKey = identity?.string()\nlet publicKey = identity?.recipient()?.string()\n\n```\n\n#### Encrypt\n\n```swift\nimport Age\n\nlet input = \"my secret\"\nlet encrypted = AgemobileEncrypt(identity?.recipient()?.string(), input, true, nil)\n```\n\n#### Decrypt\n\n```swift\nimport Age\n\nlet decrypted = AgemobileDecrypt(identity?.string(), encrypted, nil)\n```\n\n## Contributing\n\nPR's are welcome. Please read [CONTRIBUTING.md](https://github.com/MarinX/agemobile/blob/main/CONTRIBUTING.md) for more info\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMarinX%2Fagemobile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMarinX%2Fagemobile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMarinX%2Fagemobile/lists"}