<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
p.Default, li.Default, div.Default
        {mso-style-name:Default;
        margin:0in;
        margin-bottom:.0001pt;
        text-autospace:none;
        font-size:12.0pt;
        font-family:Wingdings;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1039091584;
        mso-list-type:hybrid;
        mso-list-template-ids:1052908988 1588987396 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:.75in;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:1.25in;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:1.75in;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:2.25in;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:2.75in;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:3.25in;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:3.75in;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:4.25in;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        margin-left:4.75in;
        text-indent:-9.0pt;}
@list l1
        {mso-list-id:1939098940;
        mso-list-type:hybrid;
        mso-list-template-ids:-941295830 1856004966 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l1:level1
        {mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:56.25pt;
        text-indent:-.25in;
        font-family:"Calibri","sans-serif";
        mso-fareast-font-family:SimSun;}
@list l1:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:92.25pt;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l1:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:128.25pt;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l1:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:164.25pt;
        text-indent:-.25in;
        font-family:Symbol;}
@list l1:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:200.25pt;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l1:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:236.25pt;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l1:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:272.25pt;
        text-indent:-.25in;
        font-family:Symbol;}
@list l1:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:308.25pt;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l1:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:344.25pt;
        text-indent:-.25in;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hi:<o:p></o:p></p><p class=MsoNormal>                I am trying to implement AES-based Netlogon SChannel with Windows 2k8R2 server. <o:p></o:p></p><p class=MsoNormal>                However, the server always return 0x00721 status code to me. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                In [MS-NRPC].pdf doc, step 8 of section  3.3.4.2.1,   mentioned that : <o:p></o:p></p><p class=Default style='margin-left:.5in'><span style='font-family:"Calibri","sans-serif"'>"</span><span style='font-size:9.0pt;font-family:"Verdana","sans-serif"'>If AES is negotiated, then the server MUST use AES-128 for encryption. The server MUST derive the AES key using the following algorithm: <o:p></o:p></span></p><p class=Default style='margin-left:1.0in;text-indent:.5in'><span style='font-size:8.0pt;font-family:"Courier New"'>FOR (I=0; I < Key Length; I++) </span><span style='font-size:8.0pt'><o:p></o:p></span></p><p class=Default style='margin-left:1.0in;text-indent:.5in'><span style='font-size:8.0pt;font-family:"Courier New"'>EncryptionKey[I] = SessionKey[I] XOR 0xf0 </span><span style='font-size:8.0pt'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in;text-indent:.5in'><span style='font-size:9.0pt;font-family:"Verdana","sans-serif"'>The server MUST encrypt the <b>Confounder </b>field using the initialization vector constructed by concatenating the sequence number with itself twice (thus getting 16 bytes of data). <o:p></o:p></span></p><p class=MsoNormal style='margin-left:1.0in'><span style='font-size:9.0pt;font-family:"Verdana","sans-serif"'>For encrypting the data, the initialization vector MUST be constructed using the last block of the encrypted <b>Confounder </b>field. “<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>So, I followed the doc and <o:p></o:p></p><p class=MsoListParagraph style='margin-left:.75in;text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>       </span></span><![endif]>Encrypt the confounder using AES-128-cfb8 mode, with ivec=(seqNum+seqNum) <o:p></o:p></p><p class=MsoListParagraph style='margin-left:.75in;text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>       </span></span><![endif]>Encrypt the data, using same encryption algorithm, with ivec=(encrypted_Confounder+ encrypted_Confounder), to get 16 bytes of ivec<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>However, the server always return 0x721 status code . <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>Please see  attached network trace:<o:p></o:p></p><p class=MsoListParagraph style='margin-left:56.25pt;text-indent:-.25in;mso-list:l1 level1 lfo4'><![if !supportLists]><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>          </span></span><![endif]>pkt 531, which contain the encrypted data <o:p></o:p></p><p class=MsoListParagraph style='margin-left:56.25pt;text-indent:-.25in;mso-list:l1 level1 lfo4'><![if !supportLists]><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>          </span></span><![endif]>Pkt 532, server return 0x721 status code . <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>It is unclear to me that how to construct the ivec when encrypting the data, can you help ? <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal style='margin-left:.5in'>And, In Section 3.3.4.2.2, Step 9 , it mentioned<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>                The Confounder and the data MUST be decrypted. <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>                …. <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>                If AES is negotiated, decrypt using an initialization vector constructed by concatenating twice the sequence number ( thus getting 16 bytes of data) <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> <o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>I suppose the above step is saying how to decrypt the confounder only?    What ivec should use to decrypt the data ? <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                Please help.  <o:p></o:p></p><p class=MsoNormal>Thanks,<o:p></o:p></p><p class=MsoNormal>Yen<o:p></o:p></p></div></body></html>