New issue
Advanced search Search tips

Issue 769703 link

Starred by 2 users

Issue metadata

Status: Archived
Owner: ----
Closed: Oct 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

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.
 
Components: -Blink Blink>WebCrypto
Labels: Needs-Triage-M61 Needs-Feedback
Can you provide a reduced testcase for reproducing the bug?
Labels: Hotlist-HighSierra
Project Member

Comment 4 by sheriffbot@chromium.org, Oct 30 2017

Status: Archived (was: Unconfirmed)
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