crypto.subtle.decrypt with CBC algo fails when encrypted data padding is set to 32
Reported by
alexis.a...@gmail.com,
Sep 28 2017
|
||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
Steps to reproduce the problem:
1. crypt content with CBC algo padding 32
Example of python encryption code:
cipher = AES.new(plain_key, AES.MODE_CBC, buffer(iv))
padding = 32
padded_data = plain_data + (padding - len(plain_data) % padding) * chr(padding - len(plain_data) % padding)
encrypted_data = cipher.encrypt(buffer(padded_data))
2. decrypt with CBC algo
Example of javascript code executed with Chrome:
const key = await crypto.subtle.importKey('raw', plainkey.buffer, {name: 'AES-CBC'}, false, ['decrypt'])
const plainData = await crypto.subtle.decrypt({name: 'AES-CBC', iv: vector}, key, encryptedData)
What is the expected behavior?
It should work - decrypt the buffer.
(it works on node js 8, on safari 11, on python 2/3)
It fails on firefox 55
What went wrong?
decrypt throws DOMExeception
Did this work before? N/A
Chrome version: 61.0.3163.100 Channel: stable
OS Version: OS X 10.13.0
Flash Version:
When padding is set to 16 it works.
,
Sep 28 2017
Can you provide a reduced testcase for reproducing the bug?
,
Sep 28 2017
,
Oct 30 2017
No feedback was received in the last 30 days from reporter "alexis.agahi@gmail.com", so archiving this. Please re-open or file a new bug if this is still an issue. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot |
||||
►
Sign in to add a comment |
||||
Comment 1 by dtapu...@chromium.org
, Sep 28 2017