{"id":18494446,"url":"https://github.com/meetleev/flutter_crypto_x","last_synced_at":"2025-05-14T02:32:53.104Z","repository":{"id":59896955,"uuid":"537416060","full_name":"meetleev/flutter_crypto_x","owner":"meetleev","description":"A Dart library for encryption and decryption. Advanced RSA based on pointycastle.","archived":false,"fork":false,"pushed_at":"2024-11-05T07:35:56.000Z","size":288,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-25T16:41:14.889Z","etag":null,"topics":["oaep","pkcs1","rsa","rsa-encryption"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meetleev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"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-09-16T10:48:13.000Z","updated_at":"2024-11-05T07:35:41.000Z","dependencies_parsed_at":"2024-04-08T21:00:52.010Z","dependency_job_id":null,"html_url":"https://github.com/meetleev/flutter_crypto_x","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"ebb9c4efc7ec2cc0843c98926807625677c6263b"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meetleev%2Fflutter_crypto_x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meetleev%2Fflutter_crypto_x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meetleev%2Fflutter_crypto_x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meetleev%2Fflutter_crypto_x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meetleev","download_url":"https://codeload.github.com/meetleev/flutter_crypto_x/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239209644,"owners_count":19600361,"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":["oaep","pkcs1","rsa","rsa-encryption"],"created_at":"2024-11-06T13:19:45.889Z","updated_at":"2025-02-16T23:25:27.611Z","avatar_url":"https://github.com/meetleev.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crypto_x\n[![Pub](https://img.shields.io/pub/v/crypto_x.svg?style=flat-square)](https://pub.dev/packages/crypto_x)\n[![support](https://img.shields.io/badge/platform-android%20|%20ios%20|%20web%20|%20macos%20|%20windows%20|%20linux%20-blue.svg)](https://pub.dev/packages/crypto_x)\n\nA Dart library for encryption and decryption. Advanced RSA, AES based on pointycastle.\n\n## Features\n\n* RSA with PKCS1 and OAEP encoding.\n* Generate RSA KeyPairs and import to pem format.\n\n## Getting started\n\nAdd the package to your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  crypto_x: \u003clatest_version\u003e\n```\n\n## Usage\n\n### AES\n\n#### Supported modes are:\n- CBC `AESMode.cbc`\n- CFB-8 `AESMode.cfb8`\n- CFB-128 `AESMode.cfb`\n- CTR `AESMode.ctr`\n- ECB `AESMode.ecb`\n- OFB-128 `AESMode.ofb`\n\n```dart\n    final key = CipherKey.fromUtf8('your key................');\n    final iv = CipherIV.fromLength(16);\n    var aes = AES(key: key, mode: AESMode.cbc);\n    CryptoBytes encrypted = aes.encrypt(CryptoBytes.fromUTF8('hello world.'), iv: iv);\n    String encryptedBase64 = decrypted.base64;\n    CryptoBytes decrypted = aes.decrypt(encrypted, iv: iv);\n    String plainText = decrypted.toString();\n```\n\n### RSA\n* encrypt and decrypt\n```dart\n    var privateRSA = RSA(\n        privateKey: privateKey);\n    var publicRSA = RSA(\n        publicKey: publicKey);\n    CryptoBytes signature = publicRSA.encrypt(CryptoBytes.fromUTF8('hello world'));\n    String ciphertext = signature.base64;\n    CryptoBytes plainBytes = publicRSA.decrypt(signature);\n    String plainText = plainBytes.toString();\n```\n\n* sign and verify\n```dart\n    var rsaSigner = RSASigner(digestType = DigestType.sha256, privateKey: privateKey, publicKey: publicKey);\n    var plainBytes = CryptoBytes.fromUTF8('hello world');\n    CryptoBytes signature = rsaSigner.sign(plainBytes);\n    bool isSame = rsaSigner.verify(signature, plainBytes);\n```\n\n[comment]: \u003c\u003e (## Additional information)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeetleev%2Fflutter_crypto_x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeetleev%2Fflutter_crypto_x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeetleev%2Fflutter_crypto_x/lists"}