{"id":29287933,"url":"https://github.com/pvasa/easycrypt","last_synced_at":"2026-03-05T12:02:02.697Z","repository":{"id":119146360,"uuid":"95847881","full_name":"pvasa/EasyCrypt","owner":"pvasa","description":"Android cryptography library with SecureRandom patches.","archived":false,"fork":false,"pushed_at":"2018-10-07T18:11:56.000Z","size":667,"stargazers_count":109,"open_issues_count":3,"forks_count":21,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-06T02:08:17.063Z","etag":null,"topics":["android","cryptography","decryption","encryption","hashing","kotlin"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/pvasa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-06-30T04:15:56.000Z","updated_at":"2025-06-18T11:14:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"d7a760d4-3b4c-4586-b8b3-a2ab2a7c8168","html_url":"https://github.com/pvasa/EasyCrypt","commit_stats":null,"previous_names":["ryan652/easycrypt"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/pvasa/EasyCrypt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvasa%2FEasyCrypt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvasa%2FEasyCrypt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvasa%2FEasyCrypt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvasa%2FEasyCrypt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pvasa","download_url":"https://codeload.github.com/pvasa/EasyCrypt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvasa%2FEasyCrypt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30123729,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T11:11:57.947Z","status":"ssl_error","status_checked_at":"2026-03-05T11:11:29.001Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["android","cryptography","decryption","encryption","hashing","kotlin"],"created_at":"2025-07-06T02:08:16.896Z","updated_at":"2026-03-05T12:02:02.683Z","avatar_url":"https://github.com/pvasa.png","language":"Kotlin","readme":"[![CircleCI](https://img.shields.io/circleci/project/github/pvasa/EasyCrypt.svg)](https://circleci.com/gh/pvasa/EasyCrypt)\n[![Bintray](https://img.shields.io/github/release/pvasa/easycrypt.svg)](https://github.com/pvasa/EasyCrypt/releases)\n[![License](https://img.shields.io/github/license/pvasa/easycrypt.svg)](LICENSE)\n[![GitHub issues](https://img.shields.io/github/issues/pvasa/easycrypt.svg)](https://github.com/pvasa/EasyCrypt/issues)\n\n# EasyCrypt\nSecure and efficient cryptography library for Android. (Auto fix SecureRandom bugs in API 18 and below.)\n\n***Note:** EasyCrypt uses only secure implementations and all the known Crypto bugs are already dealt with properly. [More information here.](https://github.com/pvasa/EasyCrypt/issues/6)*\n\n## Features\n* AES-256 encryption algorithm\n* CBC/CTR mode of operations\n* Block padding with PKCS7 (only with CBC)\n* Computationally secure random salt (of cipher block size)\n* Password stretching with PBKDF2\n* Random IV generated on each encryption (16 bytes)\n* Supports MD5, SHA1, and SHA2 hash functions\n* Generate secure keys with SecureRandom or random.org\n* Asymmetric encryption with RSA\n* Auto handle large data by using hybrid asymmetric encryption\n* Asymmetric RSA signing and verification\n* Supported RSA key sizes are 2048 bits and 4096 bits\n* Password analysis for strength, crack times, weakness, etc using [nulab's zxcvbn4j library](https://github.com/nulab/zxcvbn4j)\n\n## Sample app\nDownload the sample app from [play store](https://play.google.com/store/apps/details?id=com.pvryan.easycryptsample).\n\n## Install\nAdd in your app's build.gradle\n```gradle\ndependencies {\n    ..\n    implementation \"com.pvryan.easycrypt:easycrypt:1.3.3\"\n}\n```\n\n## Usage\n```kotlin\nval eCryptSymmetric = ECSymmetric()\nval eCryptAsymmetric = ECAsymmetric()\nval eCryptHash = ECHash()\nval eCryptPass = ECPasswords()\n```\n\n### Symmetric key encryption\n#### Encrypt data\n```kotlin\neCryptSymmetric.encrypt (input, password,\n    object : ECResultListener {\n\n        // Optional\n        override fun onProgress(newBytes: Int, bytesProcessed: Long, totalBytes: Long) {\n\n        }\n\n        override fun \u003cT\u003e onSuccess(result: T) {\n\n        }\n\n        override fun onFailure(message: String, e: Exception) {\n\n        }\n    },\n    outputFile // Optional\n)\n```\n\n#### Decrypt data\n```kotlin\neCryptSymmetric.decrypt(input, password,\n        object : ECResultListener {\n\n            // Optional\n            override fun onProgress(newBytes: Int, bytesProcessed: Long, totalBytes: Long) {\n\n            }\n\n            override fun \u003cT\u003e onSuccess(result: T) {\n\n            }\n\n            override fun onFailure(message: String, e: Exception) {\n\n            }\n        },\n        outputFile // Optional\n)\n```\n\n### Asymmetric key encryption\n#### Encrypt data\n```kotlin\neCryptAsymmetric.generateKeyPair(object : ECRSAKeyPairListener {\n\n     override fun onSuccess(keyPair: KeyPair) {\n         privateKey = keyPair.private as RSAPrivateKey // Save private key\n         eCryptAsymmetric.encrypt(input, keyPair.public as RSAPublicKey,\n                 object : ECResultListener {\n\n                     // Optional\n                     override fun onProgress(newBytes: Int, bytesProcessed: Long, totalBytes: Long) {\n\n                     }\n\n                     override fun \u003cT\u003e onSuccess(result: T) {\n\n                     }\n\n                     override fun onFailure(message: String, e: Exception) {\n\n                     }\n                 },\n                 outputFile // Optional\n         )\n     }\n\n     override fun onFailure(message: String, e: Exception) {\n         e.printStackTrace()\n     }\n\n }, keySize = eCryptAsymmetric.KeySizes._4096)\n```\n\n#### Decrypt data\n```kotlin\neCryptAsymmetric.decrypt(input, privateKey,\n        object : ECResultListener {\n\n            // Optional\n            override fun onProgress(newBytes: Int, bytesProcessed: Long, totalBytes: Long) {\n\n            }\n\n            override fun \u003cT\u003e onSuccess(result: T) {\n\n            }\n\n            override fun onFailure(message: String, e: Exception) {\n\n            }\n        },\n        outputFile // Optional\n)\n```\n\n#### Sign data\n```kotlin\neCryptKeys.genRSAKeyPair(object : ECRSAKeyPairListener {\n\n    override fun onGenerated(keyPair: KeyPair) {\n\n        publicKey = keyPair.public as RSAPublicKey\n\n        eCryptAsymmetric.sign(input,\n                keyPair.private as RSAPrivateKey,\n                object : ECResultListener {\n\n                    // Optional\n                    override fun onProgress(newBytes: Int, bytesProcessed: Long, totalBytes: Long) {\n\n                    }\n\n                    override fun \u003cT\u003e onSuccess(result: T) {\n\n                    }\n\n                    override fun onFailure(message: String, e: Exception) {\n\n                    }\n                },\n                signatureOutputFile)\n    }\n\n    override fun onFailure(message: String, e: Exception) {\n\n    }\n})\n```\n\n#### Verify data\n```kotlin\neCryptAsymmetric.verify(input, publicKey, signatureFile,\n        object : ECVerifiedListener {\n            override fun onSuccess(verified: Boolean) {\n\n            }\n\n            override fun onFailure(message: String, e: Exception) {\n\n            }\n        }\n)\n```\n\n#### Hash data\n```kotlin\neCryptHash.calculate(input, hashAlgorithm, // from ECHashAlgorithms\n        object : ECResultListener {\n\n            // Optional\n            override fun onProgress(newBytes: Int, bytesProcessed: Long, totalBytes: Long) {\n\n            }\n\n            override fun \u003cT\u003e onSuccess(result: T) {\n\n            }\n\n            override fun onFailure(message: String, e: Exception) {\n\n            }\n        },\n        outputFile // Optional\n)\n```\n\n#### Analyze password\n```kotlin\nval analysis: ECPasswordAnalysis = ECPasswordAnalyzer.analyze(\"thisismypassword\")\n```\n\n--------------------------------------------------------------\n| Input                 | Output                             |\n|-----------------------|------------------------------------|\n| File                  | outputFile                         |\n| FileInputStream       | outputFile                         |\n| ByteArray             | String or outputFile (if provided) |\n| ByteArrayInputStream  | String or outputFile (if provided) |\n| String                | String or outputFile (if provided) |\n| CharSequence          | String or outputFile (if provided) |\n| Anything else         | InvalidParameterException          |\n\n#### Generate key with SecureRandom (pseudo-random)\n```kotlin\nval password = eCryptPass.genSecureRandomPassword(length, charArrayOf(/*symbols to be used in password*/))\n```\n\n#### Generate key with Random.org (true random)\nFor sample to work enter your API key in FragmentPasswords\n```kotlin\neCryptPass.genRandomOrgPassword(\n        length,\n        \"random-org-api-key\", //TODO: Replace with your random.org api key\n        new ECPasswordListener() {\n\n            @Override\n            public void onFailure(@NonNull String message, @NonNull Exception e) {\n\n            }\n\n            @Override\n            public void onSuccess(@NonNull String password) {\n\n            }\n        });\n```\n\n## License\n```\nCopyright 2018 Priyank Vasa\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvasa%2Feasycrypt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpvasa%2Feasycrypt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvasa%2Feasycrypt/lists"}