{"action":"created","issue":{"url":"https://api.github.com/repos/WhisperSystems/TextSecure-Browser/issues/147","labels_url":"https://api.github.com/repos/WhisperSystems/TextSecure-Browser/issues/147/labels{/name}","comments_url":"https://api.github.com/repos/WhisperSystems/TextSecure-Browser/issues/147/comments","events_url":"https://api.github.com/repos/WhisperSystems/TextSecure-Browser/issues/147/events","html_url":"https://github.com/WhisperSystems/TextSecure-Browser/issues/147","id":56705382,"number":147,"title":"Extra block of padding added to encrypted messages","user":{"login":"joebandenburg","id":5731837,"avatar_url":"https://avatars.githubusercontent.com/u/5731837?v=3","gravatar_id":"","url":"https://api.github.com/users/joebandenburg","html_url":"https://github.com/joebandenburg","followers_url":"https://api.github.com/users/joebandenburg/followers","following_url":"https://api.github.com/users/joebandenburg/following{/other_user}","gists_url":"https://api.github.com/users/joebandenburg/gists{/gist_id}","starred_url":"https://api.github.com/users/joebandenburg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joebandenburg/subscriptions","organizations_url":"https://api.github.com/users/joebandenburg/orgs","repos_url":"https://api.github.com/users/joebandenburg/repos","events_url":"https://api.github.com/users/joebandenburg/events{/privacy}","received_events_url":"https://api.github.com/users/joebandenburg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-02-05T17:57:08Z","updated_at":"2015-02-05T21:51:15Z","closed_at":null,"body":"WebCrypto only supports PKCS#7 padding. I've tested `window.crypto.subtle.encrypt` and it will always add an additional block of padding even if the message length is already a multiple of block size. It looks like you don't do anything special to remove this extra block. I also notice that you do your own padding, so the plaintext length will always be a multiple of the block size. Are you aware of this issue?"},"comment":{"url":"https://api.github.com/repos/WhisperSystems/TextSecure-Browser/issues/comments/73136761","html_url":"https://github.com/WhisperSystems/TextSecure-Browser/issues/147#issuecomment-73136761","issue_url":"https://api.github.com/repos/WhisperSystems/TextSecure-Browser/issues/147","id":73136761,"user":{"login":"moxie0","id":512439,"avatar_url":"https://avatars.githubusercontent.com/u/512439?v=3","gravatar_id":"","url":"https://api.github.com/users/moxie0","html_url":"https://github.com/moxie0","followers_url":"https://api.github.com/users/moxie0/followers","following_url":"https://api.github.com/users/moxie0/following{/other_user}","gists_url":"https://api.github.com/users/moxie0/gists{/gist_id}","starred_url":"https://api.github.com/users/moxie0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moxie0/subscriptions","organizations_url":"https://api.github.com/users/moxie0/orgs","repos_url":"https://api.github.com/users/moxie0/repos","events_url":"https://api.github.com/users/moxie0/events{/privacy}","received_events_url":"https://api.github.com/users/moxie0/received_events","type":"User","site_admin":false},"created_at":"2015-02-05T21:51:15Z","updated_at":"2015-02-05T21:51:15Z","body":"The TextSecure protocol uses bit padding for its message payloads, so that in the future we can add arbitrary padding amounts (with minimal cost if we decide not to) in order to further obscure message length.\r\n\r\nAxolotl (one level down), now uses CBC mode with PKCS7 padding.  It sounds like what you're seeing are two different layers of the protocol. If bit padding is present in libaxolotl, that is indeed a bug, and it should be applied in libtextsecure instead."}}