<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>23498</bug_id>
          
          <creation_ts>2013-10-14 19:47:57 +0000</creation_ts>
          <short_desc>Should the nonce, IV, and associated data be separated?</short_desc>
          <delta_ts>2014-01-24 23:53:40 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Web Cryptography</product>
          <component>Web Cryptography API Document</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Harry Halpin">hhalpin</reporter>
          <assigned_to name="Ryan Sleevi">sleevi</assigned_to>
          <cc>ap</cc>
    
    <cc>watsonm</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>94687</commentid>
    <comment_count>0</comment_count>
    <who name="Harry Halpin">hhalpin</who>
    <bug_when>2013-10-14 19:47:57 +0000</bug_when>
    <thetext>The API should be suggestive of the right use.

    The encrypt interface seems to be missing some key parameters. For symmetric encryption I would suggest expanding it to

    Promise&lt;any&gt; encrypt(AlgorithmIdentifier algorithm,
    Key key,
    Nonce nonce,
    sequence&lt;CryptoOperationData&gt; associatedData);
    sequence&lt;CryptoOperationData&gt; cleartextData);

    As is, the Nonce and associatedData arguments are missing. As a result,
    in several modes the IV and associatedData are given as parameters to the
    algorithms. I worry that this will confuse developers into thinking that
    the IV and associatedData are set once when the key is initialized and
    never changed again. But both, especially the nonce, will need to be
    different for every message. At least if it is being passed in it would suggest to the developer that the nonce would be changed.

    Similarly, AES-GCM decrypt will need to take as input the ciphertext *and*
    associatedData. Would associatedData always be given as an algorithm
    parameter? (Dan Boneh)

    at least if it is being passed in it would suggest to the developer that the nonce would be changed.

    http://lists.w3.org/Archives/Public/public-webcrypto/2013Sep/0055.html
Related Actions Items:</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99057</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Watson">watsonm</who>
    <bug_when>2014-01-24 23:53:40 +0000</bug_when>
    <thetext>There was no response to Ryan&apos;s comments on the list: 
http://lists.w3.org/Archives/Public/public-webcrypto/2013Oct/0022.html</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>