{"action":"created","issue":{"url":"https://api.github.com/repos/bcgit/bc-java/issues/76","labels_url":"https://api.github.com/repos/bcgit/bc-java/issues/76/labels{/name}","comments_url":"https://api.github.com/repos/bcgit/bc-java/issues/76/comments","events_url":"https://api.github.com/repos/bcgit/bc-java/issues/76/events","html_url":"https://github.com/bcgit/bc-java/pull/76","id":37024032,"number":76,"title":"BCrypt implementation","user":{"login":"timw","id":670828,"avatar_url":"https://avatars.githubusercontent.com/u/670828?v=3","gravatar_id":"","url":"https://api.github.com/users/timw","html_url":"https://github.com/timw","followers_url":"https://api.github.com/users/timw/followers","following_url":"https://api.github.com/users/timw/following{/other_user}","gists_url":"https://api.github.com/users/timw/gists{/gist_id}","starred_url":"https://api.github.com/users/timw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timw/subscriptions","organizations_url":"https://api.github.com/users/timw/orgs","repos_url":"https://api.github.com/users/timw/repos","events_url":"https://api.github.com/users/timw/events{/privacy}","received_events_url":"https://api.github.com/users/timw/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-07-02T20:57:59Z","updated_at":"2015-02-02T08:45:21Z","closed_at":"2015-02-02T04:48:43Z","pull_request":{"url":"https://api.github.com/repos/bcgit/bc-java/pulls/76","html_url":"https://github.com/bcgit/bc-java/pull/76","diff_url":"https://github.com/bcgit/bc-java/pull/76.diff","patch_url":"https://github.com/bcgit/bc-java/pull/76.patch"},"body":"Implementation of raw and OpenBSD/crypt style bcrypt password hash functions.\r\n\r\nRaw and OpenBSD style are separated.\r\nThe OpenBSD/crypt style is most useful for compatibility with existing uses or clients wanting a simple hash+params encoding.\r\nThe raw style could be plugged into a future password hash API quite easily (i.e. based on the PHC API).\r\n\r\nTo reuse the existing Blowfish implementation (having an unverified copy is the cause of at least one major bug in crypt_blowfish) BlowfishEngine is extended slightly with hooks to allow the key schedule to be overridden and for salt to be mixed in during table processing in key setup. Performance impact should be negligible given the existing cost of the Blowfish key setup.\r\n\r\nIn the OpenBSD implementation the 2 (original), 2a, 2b and 2y formats are supported (a/b/y are algorithmically equivalent, but represent bug fixes in various crypt implementations). The crypt_blowfish 2x and 'safe 2a' modes are not implemented since they require borking the BlowfishEngine (where the bug was identified).\r\n\r\nCross tested with JBCrypt and OpenWall crypt_blowfish test vectors (links in unit tests).\r\n\r\nAlso added checking for defined key sizes in BlowfishEngine, with a constructor/factory for uses needing unrestricted key lengths (bcrypt being one of them). That's in a separate commit, so feel free to drop/amend."},"comment":{"url":"https://api.github.com/repos/bcgit/bc-java/issues/comments/72422720","html_url":"https://github.com/bcgit/bc-java/pull/76#issuecomment-72422720","issue_url":"https://api.github.com/repos/bcgit/bc-java/issues/76","id":72422720,"user":{"login":"timw","id":670828,"avatar_url":"https://avatars.githubusercontent.com/u/670828?v=3","gravatar_id":"","url":"https://api.github.com/users/timw","html_url":"https://github.com/timw","followers_url":"https://api.github.com/users/timw/followers","following_url":"https://api.github.com/users/timw/following{/other_user}","gists_url":"https://api.github.com/users/timw/gists{/gist_id}","starred_url":"https://api.github.com/users/timw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timw/subscriptions","organizations_url":"https://api.github.com/users/timw/orgs","repos_url":"https://api.github.com/users/timw/repos","events_url":"https://api.github.com/users/timw/events{/privacy}","received_events_url":"https://api.github.com/users/timw/received_events","type":"User","site_admin":false},"created_at":"2015-02-02T08:45:21Z","updated_at":"2015-02-02T08:45:21Z","body":"Yeah, there's the odd time I hanker for a C++ friend equivalent. \r\nI don't think there's a test vector (cost == 31 is a little OTT for unit tests) - it's probably sufficient to fix with a comment given it's an edge case."}}