<div id="compose" contenteditable="true" style="padding-left: 16px; padding-right: 16px; padding-bottom: 8px;"><div>You say your data is:</div><div><br></div><div><<IvSpec>> == <<RandomIv>></div><div><br></div><div>But you read:</div><div><br></div><div>Is your data <<IvSpec:8/binary, IV:8/binary, Rest/binary>></div><div><br></div><div>Should it not be just:</div><div><br></div><div><<IV:8/binary, Rest/binary>></div><div><br></div><div>?<br><br><div class="acompli_signature">Sent from <a href="http://aka.ms/Ox5hz3">Outlook</a></div><br></div></div>
    <div class="gmail_quote">_____________________________<br>From: Bogdan Andu <<a dir="ltr" href="mailto:bog495@gmail.com" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="0">bog495@gmail.com</a>><br>Sent: Thursday, November 5, 2015 2:26 p.m.<br>Subject: [erlang-questions] blowfish cbc mode decrypt<br>To: Erlang <<a dir="ltr" href="mailto:erlang-questions@erlang.org" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="2">erlang-questions@erlang.org</a>><br><br><br>    <div dir="ltr">   <div>    <div>     <div>      <div>       <div>        <div>         <div>          <div>           <div>            Hi,            <br>            <br>           </div>I have a stream of data called EncryptedData (with randomiv header specification).           <br>I want to decrypt  using:           <br>crypto:block_decrypt(blowfish_cbc, hexstr2bin(Key), IV, Rest).           <br>           <br>          </div>          <div>           where:           <br>          </div>          <div>           <br>EncryptedData is formatted as follows:           <br>          </div><<IvSpec:8/binary, IV:8/binary, Rest/binary>>          <br>          <br>         </div>IvSpec == <<"RandomIV">>         <br>         <br>        </div>However the decryption does not works and garbage is generated        <br>       </div>       <div>        (the function  ) .        <br>       </div>       <div>        <br>       </div>What could be done given the fact that IV is an 8-byte quantity       <br>      </div>the Key is formatted according to crypto test suites and is 16 bytes long       <br>      <br>     </div>Am I missing something?     <br>     <br>    </div>Thanks,    <br>    <br>   </div>Bogdan   <br>  </div>  <br><br></div>