{"action":"created","comment":{"url":"https://api.github.com/repos/tozny/java-aes-crypto/pulls/comments/29114849","id":29114849,"diff_hunk":"@@ -1,16 +1,65 @@\n java-aes-crypto\n ===============\n \n-A simple Android class for encrypting &amp; decrypting strings, aiming to avoid [serious cryptographic errors](http://tozny.com/blog/encrypting-strings-in-android-lets-make-better-mistakes/) that most such classes suffer from.\n+A simple Android class for encrypting &amp; decrypting strings, aiming to avoid [serious cryptographic errors](http://tozny.com/blog/encrypting-strings-in-android-lets-make-better-mistakes/) that most such classes suffer from. [Show me the code](https://github.com/scottyab/java-aes-crypto/blob/master/aes-crypto/src/main/java/com/tozny/crypto/android/AesCbcWithIntegrity.java)\n+\n+#Features\n \n-Features\n-==========\n Here are the features of this class. We believe that these properties are consistent with what a lot of people are looking for when encrypting Strings in Android.\n \n-* *Paste-ability*: It's a very simple Java class that works across most or all versions of Android. The class should be easy to paste into an existing codebase.\n * *Works for strings*: It should encrypt arbitrary strings or byte arrays. This means it needs to effectively handle multiple blocks (CBC) and partial blocks (padding). It consistently serializes and deserializes ciphertext, IVs, and key material using base64 to make it easy to store.\n * *Algorithm & Mode*: We chose: AES 128, CBC, and PKCS5 padding. We would have picked GCM for its built-in integrity checking, but that's only available since Android Jelly Bean.\n * *IV Handling*: We securely generate a random IV before each encryption and provide a simple class to keep the IV and ciphertext together so they're easy to keep track of and store. We set the IV and then request it back from the Cipher class for compatibility across various Android versions.\n * *Key generation*: Random key generation with the updated generation code recommended for Android. If you want password-based keys, we provide functions to salt and generate them.\n * *Integrity*: Lots of people think AES has integrity checking built in. The thinking goes, \"if it decrypts correctly, it was generated by the person with the private key\". Actually, AES CBC allows an attacker to modify the messages. Therefore, we've also added integrity checking in the form of a SHA 256 hash.\n-* *License*: The included MIT license is compatible with open source or commercial products. Tozny also offers custom support and licensing terms if your organization has different needs. Contact us at [info@tozny.com](mailto:info@tozny.com) for more details.\n\\ No newline at end of file\n+\n+\n+#How to include in project?\n+\n+###Copy and paste\n+It's a single very simple java class, [AesCbcWithIntegrity.java](https://github.com/scottyab/java-aes-crypto/blob/master/aes-crypto/src/main/java/com/tozny/crypto/android/AesCbcWithIntegrity.java) that works across most or all versions of Android. The class should be easy to paste into an existing codebase. \n+\n+###Android Library project\n+The library is in Android library project format so you can clone this project and add as a library module/project. \n+\t\n+###Maven Dependancy\n+We've also published the library AAR file to Maven central for simple one line gradle dependancy managment. \n+\n+\n+```groovy\n+dependencies {\n+    compile 'com.scottyab:aes-crypto:0.0.1-SNAPSHOT'\n+}\n+```\n+\n+#Examples\n+\n+##Generate new key\n+\n+\n+```java\n+  AesCbcWithIntegrity.prngFixed.set(true);","path":"README.md","position":47,"original_position":47,"commit_id":"9380706c7d1a5d080a8e91d3fc1746fd30e11e59","original_commit_id":"9380706c7d1a5d080a8e91d3fc1746fd30e11e59","user":{"login":"swenson","id":33404,"avatar_url":"https://avatars.githubusercontent.com/u/33404?v=3","gravatar_id":"","url":"https://api.github.com/users/swenson","html_url":"https://github.com/swenson","followers_url":"https://api.github.com/users/swenson/followers","following_url":"https://api.github.com/users/swenson/following{/other_user}","gists_url":"https://api.github.com/users/swenson/gists{/gist_id}","starred_url":"https://api.github.com/users/swenson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swenson/subscriptions","organizations_url":"https://api.github.com/users/swenson/orgs","repos_url":"https://api.github.com/users/swenson/repos","events_url":"https://api.github.com/users/swenson/events{/privacy}","received_events_url":"https://api.github.com/users/swenson/received_events","type":"User","site_admin":false},"body":"I don't think we want to set that to true unless the PRNG has actually been fixed, right?","created_at":"2015-04-26T22:16:52Z","updated_at":"2015-04-26T22:16:52Z","html_url":"https://github.com/tozny/java-aes-crypto/pull/8#discussion_r29114849","pull_request_url":"https://api.github.com/repos/tozny/java-aes-crypto/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/tozny/java-aes-crypto/pulls/comments/29114849"},"html":{"href":"https://github.com/tozny/java-aes-crypto/pull/8#discussion_r29114849"},"pull_request":{"href":"https://api.github.com/repos/tozny/java-aes-crypto/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/tozny/java-aes-crypto/pulls/8","id":31937243,"html_url":"https://github.com/tozny/java-aes-crypto/pull/8","diff_url":"https://github.com/tozny/java-aes-crypto/pull/8.diff","patch_url":"https://github.com/tozny/java-aes-crypto/pull/8.patch","issue_url":"https://api.github.com/repos/tozny/java-aes-crypto/issues/8","number":8,"state":"open","locked":false,"title":"Refactor to Android library Project","user":{"login":"scottyab","id":404105,"avatar_url":"https://avatars.githubusercontent.com/u/404105?v=3","gravatar_id":"","url":"https://api.github.com/users/scottyab","html_url":"https://github.com/scottyab","followers_url":"https://api.github.com/users/scottyab/followers","following_url":"https://api.github.com/users/scottyab/following{/other_user}","gists_url":"https://api.github.com/users/scottyab/gists{/gist_id}","starred_url":"https://api.github.com/users/scottyab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottyab/subscriptions","organizations_url":"https://api.github.com/users/scottyab/orgs","repos_url":"https://api.github.com/users/scottyab/repos","events_url":"https://api.github.com/users/scottyab/events{/privacy}","received_events_url":"https://api.github.com/users/scottyab/received_events","type":"User","site_admin":false},"body":"As mentioned in comments on issue #7 I've refactored the structure into an Android library project with very simple test (that needs more work) and sample project (also needs more work ideally). I've also published a temporary copy to maven central snapshots repo as an example of how this could work.  Readme also updated to account for this. ","created_at":"2015-03-25T16:05:37Z","updated_at":"2015-04-26T22:16:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b5ea717a9319e5bc2b57fae72f8c2a7ad6e9856a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tozny/java-aes-crypto/pulls/8/commits","review_comments_url":"https://api.github.com/repos/tozny/java-aes-crypto/pulls/8/comments","review_comment_url":"https://api.github.com/repos/tozny/java-aes-crypto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tozny/java-aes-crypto/issues/8/comments","statuses_url":"https://api.github.com/repos/tozny/java-aes-crypto/statuses/9380706c7d1a5d080a8e91d3fc1746fd30e11e59","head":{"label":"scottyab:master","ref":"master","sha":"9380706c7d1a5d080a8e91d3fc1746fd30e11e59","user":{"login":"scottyab","id":404105,"avatar_url":"https://avatars.githubusercontent.com/u/404105?v=3","gravatar_id":"","url":"https://api.github.com/users/scottyab","html_url":"https://github.com/scottyab","followers_url":"https://api.github.com/users/scottyab/followers","following_url":"https://api.github.com/users/scottyab/following{/other_user}","gists_url":"https://api.github.com/users/scottyab/gists{/gist_id}","starred_url":"https://api.github.com/users/scottyab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottyab/subscriptions","organizations_url":"https://api.github.com/users/scottyab/orgs","repos_url":"https://api.github.com/users/scottyab/repos","events_url":"https://api.github.com/users/scottyab/events{/privacy}","received_events_url":"https://api.github.com/users/scottyab/received_events","type":"User","site_admin":false},"repo":{"id":32015587,"name":"java-aes-crypto","full_name":"scottyab/java-aes-crypto","owner":{"login":"scottyab","id":404105,"avatar_url":"https://avatars.githubusercontent.com/u/404105?v=3","gravatar_id":"","url":"https://api.github.com/users/scottyab","html_url":"https://github.com/scottyab","followers_url":"https://api.github.com/users/scottyab/followers","following_url":"https://api.github.com/users/scottyab/following{/other_user}","gists_url":"https://api.github.com/users/scottyab/gists{/gist_id}","starred_url":"https://api.github.com/users/scottyab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottyab/subscriptions","organizations_url":"https://api.github.com/users/scottyab/orgs","repos_url":"https://api.github.com/users/scottyab/repos","events_url":"https://api.github.com/users/scottyab/events{/privacy}","received_events_url":"https://api.github.com/users/scottyab/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/scottyab/java-aes-crypto","description":"A simple Android class for encrypting & decrypting strings, aiming to avoid the classic mistakes that most such classes suffer from.","fork":true,"url":"https://api.github.com/repos/scottyab/java-aes-crypto","forks_url":"https://api.github.com/repos/scottyab/java-aes-crypto/forks","keys_url":"https://api.github.com/repos/scottyab/java-aes-crypto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scottyab/java-aes-crypto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scottyab/java-aes-crypto/teams","hooks_url":"https://api.github.com/repos/scottyab/java-aes-crypto/hooks","issue_events_url":"https://api.github.com/repos/scottyab/java-aes-crypto/issues/events{/number}","events_url":"https://api.github.com/repos/scottyab/java-aes-crypto/events","assignees_url":"https://api.github.com/repos/scottyab/java-aes-crypto/assignees{/user}","branches_url":"https://api.github.com/repos/scottyab/java-aes-crypto/branches{/branch}","tags_url":"https://api.github.com/repos/scottyab/java-aes-crypto/tags","blobs_url":"https://api.github.com/repos/scottyab/java-aes-crypto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scottyab/java-aes-crypto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scottyab/java-aes-crypto/git/refs{/sha}","trees_url":"https://api.github.com/repos/scottyab/java-aes-crypto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scottyab/java-aes-crypto/statuses/{sha}","languages_url":"https://api.github.com/repos/scottyab/java-aes-crypto/languages","stargazers_url":"https://api.github.com/repos/scottyab/java-aes-crypto/stargazers","contributors_url":"https://api.github.com/repos/scottyab/java-aes-crypto/contributors","subscribers_url":"https://api.github.com/repos/scottyab/java-aes-crypto/subscribers","subscription_url":"https://api.github.com/repos/scottyab/java-aes-crypto/subscription","commits_url":"https://api.github.com/repos/scottyab/java-aes-crypto/commits{/sha}","git_commits_url":"https://api.github.com/repos/scottyab/java-aes-crypto/git/commits{/sha}","comments_url":"https://api.github.com/repos/scottyab/java-aes-crypto/comments{/number}","issue_comment_url":"https://api.github.com/repos/scottyab/java-aes-crypto/issues/comments{/number}","contents_url":"https://api.github.com/repos/scottyab/java-aes-crypto/contents/{+path}","compare_url":"https://api.github.com/repos/scottyab/java-aes-crypto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scottyab/java-aes-crypto/merges","archive_url":"https://api.github.com/repos/scottyab/java-aes-crypto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scottyab/java-aes-crypto/downloads","issues_url":"https://api.github.com/repos/scottyab/java-aes-crypto/issues{/number}","pulls_url":"https://api.github.com/repos/scottyab/java-aes-crypto/pulls{/number}","milestones_url":"https://api.github.com/repos/scottyab/java-aes-crypto/milestones{/number}","notifications_url":"https://api.github.com/repos/scottyab/java-aes-crypto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scottyab/java-aes-crypto/labels{/name}","releases_url":"https://api.github.com/repos/scottyab/java-aes-crypto/releases{/id}","created_at":"2015-03-11T12:08:32Z","updated_at":"2015-04-11T23:47:02Z","pushed_at":"2015-03-25T15:55:25Z","git_url":"git://github.com/scottyab/java-aes-crypto.git","ssh_url":"git@github.com:scottyab/java-aes-crypto.git","clone_url":"https://github.com/scottyab/java-aes-crypto.git","svn_url":"https://github.com/scottyab/java-aes-crypto","homepage":"http://tozny.com/blog/encrypting-strings-in-android-lets-make-better-mistakes/","size":209,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"tozny:master","ref":"master","sha":"8a16565ac554e7990d2f4591222efc05fe827dc7","user":{"login":"tozny","id":4185639,"avatar_url":"https://avatars.githubusercontent.com/u/4185639?v=3","gravatar_id":"","url":"https://api.github.com/users/tozny","html_url":"https://github.com/tozny","followers_url":"https://api.github.com/users/tozny/followers","following_url":"https://api.github.com/users/tozny/following{/other_user}","gists_url":"https://api.github.com/users/tozny/gists{/gist_id}","starred_url":"https://api.github.com/users/tozny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tozny/subscriptions","organizations_url":"https://api.github.com/users/tozny/orgs","repos_url":"https://api.github.com/users/tozny/repos","events_url":"https://api.github.com/users/tozny/events{/privacy}","received_events_url":"https://api.github.com/users/tozny/received_events","type":"Organization","site_admin":false},"repo":{"id":26654294,"name":"java-aes-crypto","full_name":"tozny/java-aes-crypto","owner":{"login":"tozny","id":4185639,"avatar_url":"https://avatars.githubusercontent.com/u/4185639?v=3","gravatar_id":"","url":"https://api.github.com/users/tozny","html_url":"https://github.com/tozny","followers_url":"https://api.github.com/users/tozny/followers","following_url":"https://api.github.com/users/tozny/following{/other_user}","gists_url":"https://api.github.com/users/tozny/gists{/gist_id}","starred_url":"https://api.github.com/users/tozny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tozny/subscriptions","organizations_url":"https://api.github.com/users/tozny/orgs","repos_url":"https://api.github.com/users/tozny/repos","events_url":"https://api.github.com/users/tozny/events{/privacy}","received_events_url":"https://api.github.com/users/tozny/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tozny/java-aes-crypto","description":"A simple Android class for encrypting & decrypting strings, aiming to avoid the classic mistakes that most such classes suffer from.","fork":false,"url":"https://api.github.com/repos/tozny/java-aes-crypto","forks_url":"https://api.github.com/repos/tozny/java-aes-crypto/forks","keys_url":"https://api.github.com/repos/tozny/java-aes-crypto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tozny/java-aes-crypto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tozny/java-aes-crypto/teams","hooks_url":"https://api.github.com/repos/tozny/java-aes-crypto/hooks","issue_events_url":"https://api.github.com/repos/tozny/java-aes-crypto/issues/events{/number}","events_url":"https://api.github.com/repos/tozny/java-aes-crypto/events","assignees_url":"https://api.github.com/repos/tozny/java-aes-crypto/assignees{/user}","branches_url":"https://api.github.com/repos/tozny/java-aes-crypto/branches{/branch}","tags_url":"https://api.github.com/repos/tozny/java-aes-crypto/tags","blobs_url":"https://api.github.com/repos/tozny/java-aes-crypto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tozny/java-aes-crypto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tozny/java-aes-crypto/git/refs{/sha}","trees_url":"https://api.github.com/repos/tozny/java-aes-crypto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tozny/java-aes-crypto/statuses/{sha}","languages_url":"https://api.github.com/repos/tozny/java-aes-crypto/languages","stargazers_url":"https://api.github.com/repos/tozny/java-aes-crypto/stargazers","contributors_url":"https://api.github.com/repos/tozny/java-aes-crypto/contributors","subscribers_url":"https://api.github.com/repos/tozny/java-aes-crypto/subscribers","subscription_url":"https://api.github.com/repos/tozny/java-aes-crypto/subscription","commits_url":"https://api.github.com/repos/tozny/java-aes-crypto/commits{/sha}","git_commits_url":"https://api.github.com/repos/tozny/java-aes-crypto/git/commits{/sha}","comments_url":"https://api.github.com/repos/tozny/java-aes-crypto/comments{/number}","issue_comment_url":"https://api.github.com/repos/tozny/java-aes-crypto/issues/comments{/number}","contents_url":"https://api.github.com/repos/tozny/java-aes-crypto/contents/{+path}","compare_url":"https://api.github.com/repos/tozny/java-aes-crypto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tozny/java-aes-crypto/merges","archive_url":"https://api.github.com/repos/tozny/java-aes-crypto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tozny/java-aes-crypto/downloads","issues_url":"https://api.github.com/repos/tozny/java-aes-crypto/issues{/number}","pulls_url":"https://api.github.com/repos/tozny/java-aes-crypto/pulls{/number}","milestones_url":"https://api.github.com/repos/tozny/java-aes-crypto/milestones{/number}","notifications_url":"https://api.github.com/repos/tozny/java-aes-crypto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tozny/java-aes-crypto/labels{/name}","releases_url":"https://api.github.com/repos/tozny/java-aes-crypto/releases{/id}","created_at":"2014-11-14T19:37:28Z","updated_at":"2015-04-26T22:09:33Z","pushed_at":"2015-04-26T22:09:33Z","git_url":"git://github.com/tozny/java-aes-crypto.git","ssh_url":"git@github.com:tozny/java-aes-crypto.git","clone_url":"https://github.com/tozny/java-aes-crypto.git","svn_url":"https://github.com/tozny/java-aes-crypto","homepage":"http://tozny.com/blog/encrypting-strings-in-android-lets-make-better-mistakes/","size":325,"stargazers_count":81,"watchers_count":81,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":2,"forks":15,"open_issues":2,"watchers":81,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tozny/java-aes-crypto/pulls/8"},"html":{"href":"https://github.com/tozny/java-aes-crypto/pull/8"},"issue":{"href":"https://api.github.com/repos/tozny/java-aes-crypto/issues/8"},"comments":{"href":"https://api.github.com/repos/tozny/java-aes-crypto/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/tozny/java-aes-crypto/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/tozny/java-aes-crypto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tozny/java-aes-crypto/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/tozny/java-aes-crypto/statuses/9380706c7d1a5d080a8e91d3fc1746fd30e11e59"}}}}