{"action":"created","issue":{"url":"https://api.github.com/repos/libeclipse/visionary/issues/9","repository_url":"https://api.github.com/repos/libeclipse/visionary","labels_url":"https://api.github.com/repos/libeclipse/visionary/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/libeclipse/visionary/issues/9/comments","events_url":"https://api.github.com/repos/libeclipse/visionary/issues/9/events","html_url":"https://github.com/libeclipse/visionary/issues/9","id":151794345,"number":9,"title":"Weak default parameters","user":{"login":"chilicuil","id":75626,"avatar_url":"https://avatars.githubusercontent.com/u/75626?v=3","gravatar_id":"","url":"https://api.github.com/users/chilicuil","html_url":"https://github.com/chilicuil","followers_url":"https://api.github.com/users/chilicuil/followers","following_url":"https://api.github.com/users/chilicuil/following{/other_user}","gists_url":"https://api.github.com/users/chilicuil/gists{/gist_id}","starred_url":"https://api.github.com/users/chilicuil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chilicuil/subscriptions","organizations_url":"https://api.github.com/users/chilicuil/orgs","repos_url":"https://api.github.com/users/chilicuil/repos","events_url":"https://api.github.com/users/chilicuil/events{/privacy}","received_events_url":"https://api.github.com/users/chilicuil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-04-29T05:10:55Z","updated_at":"2016-04-29T19:07:28Z","closed_at":null,"body":"As per Colin Percival [recommendations](http://www.tarsnap.com/scrypt/scrypt-slides.pdf) (page 17) 2009 the following default values should be considered when using scrypt as KDF (which are now rather low).\r\n\r\n- For interactive use, N = 2^14, r = 8, p = 1\r\n- For sensitive storage, N = 2^20, r = 8, p = 1\r\n\r\nHowever in visionary the defaults are, N = 2^11, r = 1, p = 1 and the maximum allowed are N = 2^14, r = 1, p = 1 both are below the minimum recommended.\r\n\r\nThe scrypt key derivation function has been implemented in several languages, thus even if takes enough time on python (and may feel safe), it could be run in faster languages/custom hardware allowing effective brute force attacks, in a [C implementation](https://github.com/technion/libscrypt)\r\n\r\nN = 2^11, r = 1, p = 1 takes:\r\nreal\t0m0.004s\r\nuser\t0m0.003s\r\nsys\t0m0.001s\r\n\r\nWhile N = 2^14, r = 1, p = 1 takes:\r\nreal\t0m0.007s\r\nuser\t0m0.006s\r\nsys\t0m0.001s\r\n\r\nNot only default visionary parameters can be calculated quite fast, but require little ram, allowing more attacks in parallel.\r\n\r\n128 bytes x N_cost x r_blockSizeFactor = 128 x 2048 x 1 = 262144 bytes = 256kb\r\n128 bytes x N_cost x r_blockSizeFactor = 128 x 16384 x 1 = 2097152 bytes = 2MB\r\n\r\nThe recommended for interactive usage is 16 MB while for sensitive information is 1GB"},"comment":{"url":"https://api.github.com/repos/libeclipse/visionary/issues/comments/215850799","html_url":"https://github.com/libeclipse/visionary/issues/9#issuecomment-215850799","issue_url":"https://api.github.com/repos/libeclipse/visionary/issues/9","id":215850799,"user":{"login":"kootenpv","id":2746227,"avatar_url":"https://avatars.githubusercontent.com/u/2746227?v=3","gravatar_id":"","url":"https://api.github.com/users/kootenpv","html_url":"https://github.com/kootenpv","followers_url":"https://api.github.com/users/kootenpv/followers","following_url":"https://api.github.com/users/kootenpv/following{/other_user}","gists_url":"https://api.github.com/users/kootenpv/gists{/gist_id}","starred_url":"https://api.github.com/users/kootenpv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kootenpv/subscriptions","organizations_url":"https://api.github.com/users/kootenpv/orgs","repos_url":"https://api.github.com/users/kootenpv/repos","events_url":"https://api.github.com/users/kootenpv/events{/privacy}","received_events_url":"https://api.github.com/users/kootenpv/received_events","type":"User","site_admin":false},"created_at":"2016-04-29T19:07:28Z","updated_at":"2016-04-29T19:07:28Z","body":"Watch out with encodings. Changing the scrypt parameters will logically change the password."}}