{"action":"created","issue":{"url":"https://api.github.com/repos/codahale/sneaker/issues/3","labels_url":"https://api.github.com/repos/codahale/sneaker/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/codahale/sneaker/issues/3/comments","events_url":"https://api.github.com/repos/codahale/sneaker/issues/3/events","html_url":"https://github.com/codahale/sneaker/issues/3","id":70017015,"number":3,"title":"Recommendation: Versioning","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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-22T04:10:40Z","updated_at":"2015-04-22T04:25:15Z","closed_at":null,"body":"One suggestion that might make things easier moving forward is to add some element of versioning.\r\n\r\nAs it is, when you pull down some ciphertext and decrypt your key, you just assume it was encrypted with the current algorithm. That's fine for now, but in time, the algorithm may change, and it would be difficult to tell what a given ciphertext was encrypted with.\r\n\r\nThe easiest way is to probably just to do something like prepend a byte to the ciphertext, like a `0`, to indicate that we are using AES-256-GCM-with-random-padding. In the future, you can just increment that byte for more options, and add any additional structure you might need then."},"comment":{"url":"https://api.github.com/repos/codahale/sneaker/issues/comments/95028567","html_url":"https://github.com/codahale/sneaker/issues/3#issuecomment-95028567","issue_url":"https://api.github.com/repos/codahale/sneaker/issues/3","id":95028567,"user":{"login":"codahale","id":207,"avatar_url":"https://avatars.githubusercontent.com/u/207?v=3","gravatar_id":"","url":"https://api.github.com/users/codahale","html_url":"https://github.com/codahale","followers_url":"https://api.github.com/users/codahale/followers","following_url":"https://api.github.com/users/codahale/following{/other_user}","gists_url":"https://api.github.com/users/codahale/gists{/gist_id}","starred_url":"https://api.github.com/users/codahale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codahale/subscriptions","organizations_url":"https://api.github.com/users/codahale/orgs","repos_url":"https://api.github.com/users/codahale/repos","events_url":"https://api.github.com/users/codahale/events{/privacy}","received_events_url":"https://api.github.com/users/codahale/received_events","type":"User","site_admin":false},"created_at":"2015-04-22T04:25:15Z","updated_at":"2015-04-22T04:25:15Z","body":"Honestly, I’m not a fan of algorithm agility. If AES-GCM turns out to be broken, it’s going to require more than a version bump to fix. I’m also wary of algorithm downgrade problems.\r\n\r\nGCM doesn’t have padding, BTW. It’s essentially just CTR mode with a GHASH of the ciphertext appended."}}