<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic problem about encryption and decryption in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/problem-about-encryption-and-decryption/m-p/800305#M3160</link>
    <description>&lt;P&gt;Thank you very much.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Nov 2011 00:54:29 GMT</pubDate>
    <dc:creator>Liang_Lu</dc:creator>
    <dc:date>2011-11-07T00:54:29Z</dc:date>
    <item>
      <title>problem about encryption and decryption</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/problem-about-encryption-and-decryption/m-p/800300#M3155</link>
      <description>Hi,&lt;BR /&gt; I tried to decryptthe ciphertext which was encrypted by ippsRijindael128EncryptCBC using the function AES_cbc_decrypt in openssl ,but i failed , then i encrypted the same plaintext using the two funtions respectively, the ciphertext was different, but i think it should be the same because the algorithmand the iput was the same, i confused.&lt;BR /&gt;&lt;BR /&gt;thanks</description>
      <pubDate>Wed, 02 Nov 2011 08:19:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/problem-about-encryption-and-decryption/m-p/800300#M3155</guid>
      <dc:creator>Liang_Lu</dc:creator>
      <dc:date>2011-11-02T08:19:42Z</dc:date>
    </item>
    <item>
      <title>problem about encryption and decryption</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/problem-about-encryption-and-decryption/m-p/800301#M3156</link>
      <description>Hello &lt;BR /&gt;Maybe the example from page 43 of our guide&lt;BR /&gt;&lt;A href="http://software.intel.com/en-us/articles/ipp-crypto-guide/" target="_blank"&gt;http://software.intel.com/en-us/articles/ipp-crypto-guide/&lt;/A&gt;&lt;BR /&gt;will be helpful&lt;BR /&gt;&lt;BR /&gt;Andrzej Chrzeszczyk</description>
      <pubDate>Thu, 03 Nov 2011 07:45:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/problem-about-encryption-and-decryption/m-p/800301#M3156</guid>
      <dc:creator>Andrzej_Chrzeszczyk</dc:creator>
      <dc:date>2011-11-03T07:45:25Z</dc:date>
    </item>
    <item>
      <title>problem about encryption and decryption</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/problem-about-encryption-and-decryption/m-p/800302#M3157</link>
      <description>Hi &lt;BR /&gt;&lt;BR /&gt;Could you pelase provide somecode snippet toshow the parameterdefination for two functions and functions call details? &lt;BR /&gt;or a entire test case will begreat. &lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Ying H.</description>
      <pubDate>Thu, 03 Nov 2011 08:30:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/problem-about-encryption-and-decryption/m-p/800302#M3157</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2011-11-03T08:30:49Z</dc:date>
    </item>
    <item>
      <title>problem about encryption and decryption</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/problem-about-encryption-and-decryption/m-p/800303#M3158</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;This is the code snippet.&lt;BR /&gt;&lt;BR /&gt;int ippTimingAES_CBC(int minLen,int maxLen)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;Ipp8u *pPText = ippsMalloc_8u(maxLen);&lt;/P&gt;&lt;P&gt;Ipp8u *pPPText = ippsMalloc_8u(maxLen);&lt;/P&gt;&lt;P&gt;Ipp8u *pCText = ippsMalloc_8u(maxLen);&lt;/P&gt;&lt;P&gt;Ipp8u *pCCText = ippsMalloc_8u(maxLen);&lt;/P&gt;&lt;P&gt;if(pPText&amp;amp;&amp;amp;pPPText&amp;amp;&amp;amp;pCText&amp;amp;&amp;amp;pCCText)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;Ipp8u iv[16];&lt;/P&gt;&lt;P&gt;Ipp8u saved_iv[16];&lt;/P&gt;&lt;P&gt;Ipp8u secret_key[32];&lt;/P&gt;&lt;P&gt;Ipp8u* pBuffer;&lt;/P&gt;&lt;P&gt;int pSize;&lt;/P&gt;&lt;P&gt;AES_KEY aes_enc;&lt;/P&gt;&lt;P&gt;AES_KEY aes_dec;&lt;/P&gt;&lt;P&gt;setRandom8u(secret_key,32);&lt;/P&gt;&lt;P&gt;setRandom8u(saved_iv,16);&lt;/P&gt;&lt;P&gt;setRandom8u(pPText,maxLen);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;memcpy(pPPText,pPText,maxLen);&lt;/P&gt;&lt;P&gt;memcpy(iv,saved_iv,sizeof(saved_iv));&lt;/P&gt;&lt;P&gt;AES_set_encrypt_key(secret_key,IppsRijndaelkey128,&amp;amp;aes_enc);&lt;/P&gt;&lt;P&gt;ippsRijndael128GetSize(&amp;amp;pSize);&lt;/P&gt;&lt;P&gt;pBuffer = ippsMalloc_8u(pSize);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(pBuffer){&lt;/P&gt;&lt;P&gt;ippsRijndael128Init(aes_enc.rd_key,IppsRijndaelKey128,pBuffer);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;else{&lt;/P&gt;&lt;P&gt;ippsFree(pPText);&lt;/P&gt;&lt;P&gt;ippsFree(pPPText);&lt;/P&gt;&lt;P&gt;ippsFree(pCText);&lt;/P&gt;&lt;P&gt;ippsFree(pCCText);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;ippsRijndael128EncryptCBC(pPText,pCText,minLen,pBuffer,iv,IppsCppaddingNONE);&lt;/P&gt;&lt;P&gt;memcpy(iv,saved_iv,sizeof(saved_iv));&lt;/P&gt;&lt;P&gt;AES_cbc_encrypt(pPPText,pCCText,minLen,&amp;amp;aes_enc,iv,1);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;... ...&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;int main(){&lt;/P&gt;&lt;P&gt;... ...&lt;/P&gt;&lt;P&gt;ippTimingAES_CBC(256,256);&lt;/P&gt;&lt;P&gt;... ...&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;&lt;BR /&gt;The result is that pCText is different form pCCText.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2011 02:02:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/problem-about-encryption-and-decryption/m-p/800303#M3158</guid>
      <dc:creator>Liang_Lu</dc:creator>
      <dc:date>2011-11-04T02:02:40Z</dc:date>
    </item>
    <item>
      <title>problem about encryption and decryption</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/problem-about-encryption-and-decryption/m-p/800304#M3159</link>
      <description>Hi&lt;BR /&gt;Compare the example where IPP and SSL give the same results:&lt;BR /&gt;&lt;BR /&gt;//icpc -ipp=crypto diff3.cpp -lssl&lt;BR /&gt;#include &lt;OPENSSL&gt;&lt;BR /&gt;#include &lt;OPENSSL&gt;&lt;BR /&gt;#include &lt;STRING.H&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;#include &lt;TIME.H&gt;&lt;BR /&gt;#include &lt;OPENSSL&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include "ipp.h"&lt;BR /&gt;#include "ippcore.h"&lt;BR /&gt;#include&lt;IOSTREAM&gt;&lt;BR /&gt;#define keylen 16&lt;BR /&gt;using namespace std;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;int size=64;&lt;BR /&gt;const int blkSize = 16;&lt;BR /&gt;ippInit();&lt;BR /&gt;Ipp8u iv[16];&lt;BR /&gt;Ipp8u iv1[16];&lt;BR /&gt;Ipp8u iv2[16];&lt;BR /&gt;Ipp8u iv3[16];&lt;BR /&gt;Ipp8u key[16];&lt;BR /&gt;int num_threads;&lt;BR /&gt;int i;&lt;BR /&gt;int count=0;&lt;BR /&gt;int c_len; //ciphertext len;&lt;BR /&gt;int len; //plaintext len;&lt;BR /&gt;double costtime;&lt;BR /&gt;int j;&lt;BR /&gt;int ctxsize;&lt;BR /&gt;double timesum;&lt;BR /&gt;for (i=0; i&amp;lt;16; i++) /*init-vector*/&lt;BR /&gt;{&lt;BR /&gt; iv&lt;I&gt;=rand()%10;&lt;BR /&gt;}&lt;BR /&gt;for (i=0;i&amp;lt;16;i++) /*key*/ &lt;BR /&gt;{&lt;BR /&gt; key&lt;I&gt;=rand()%10;&lt;BR /&gt;}&lt;BR /&gt;len=size;&lt;BR /&gt;c_len=len;&lt;BR /&gt;unsigned char *plaintext=(Ipp8u *)malloc(len);&lt;BR /&gt;&lt;BR /&gt;memcpy(iv1,iv,sizeof(iv));&lt;BR /&gt;memcpy(iv2,iv,sizeof(iv));&lt;BR /&gt;memcpy(iv3,iv,sizeof(iv));&lt;BR /&gt;Ipp8u ciphertext[c_len];&lt;BR /&gt;memset(ciphertext,0,len);&lt;BR /&gt;&lt;BR /&gt;for(i=0;i&lt;LEN&gt;&lt;/LEN&gt;{&lt;BR /&gt; plaintext&lt;I&gt;=(Ipp8u)rand()%10+'0';&lt;BR /&gt;}&lt;BR /&gt;printf("the plaintext is %s\n",plaintext);&lt;BR /&gt;&lt;BR /&gt;//IPP &lt;BR /&gt;ippsRijndael128GetSize(&amp;amp;ctxsize);&lt;BR /&gt;IppsRijndael128Spec* pCtx = (IppsRijndael128Spec*)(new Ipp8u [ctxsize]);&lt;BR /&gt;ippsRijndael128Init(key,IppsRijndaelKey128,pCtx);&lt;BR /&gt;ippsRijndael128EncryptCBC(plaintext,ciphertext,len,pCtx,iv,IppsCPPaddingNONE);&lt;BR /&gt;Ipp8u deciph[sizeof(ciphertext)];&lt;BR /&gt;ippsRijndael128DecryptCBC(ciphertext, deciph, sizeof(ciphertext),pCtx,iv,IppsCPPaddingNONE);&lt;BR /&gt;cout&amp;lt;&amp;lt;"the IPP ciphertext:"&amp;lt;&lt;ENDL&gt;&amp;lt;&lt;CIPHERTEXT&gt;&amp;lt;&lt;ENDL&gt;&lt;/ENDL&gt;cout &amp;lt;&amp;lt; "the IPP deciphered text: "; &lt;BR /&gt;for(i=0;i&lt;LEN&gt;&lt;/LEN&gt; cout&amp;lt;&lt;DECIPH&gt;&lt;I&gt;;&lt;BR /&gt;cout&amp;lt;&lt;ENDL&gt;&lt;/ENDL&gt;delete (Ipp8u*)pCtx;&lt;BR /&gt;&lt;BR /&gt;//SSL &lt;BR /&gt;Ipp8u ciphertext2[c_len];&lt;BR /&gt;Ipp8u deciph2[sizeof(ciphertext2)];&lt;BR /&gt;EVP_CIPHER_CTX enc_ctx;&lt;BR /&gt;EVP_CIPHER *cipher=(EVP_CIPHER *)EVP_aes_128_cbc();&lt;BR /&gt;EVP_CIPHER_CTX_init(&amp;amp;enc_ctx);&lt;BR /&gt;EVP_EncryptInit_ex(&amp;amp;enc_ctx, cipher, NULL, key, iv2);&lt;BR /&gt;EVP_EncryptUpdate(&amp;amp;enc_ctx, ciphertext2, &amp;amp;c_len, plaintext, len);&lt;BR /&gt;EVP_CIPHER_CTX dec_ctx;&lt;BR /&gt;EVP_CIPHER_CTX_init(&amp;amp;dec_ctx);&lt;BR /&gt;EVP_DecryptInit_ex(&amp;amp;dec_ctx, cipher, NULL, key, iv3);&lt;BR /&gt;EVP_DecryptUpdate(&amp;amp;dec_ctx, deciph2, &amp;amp;c_len, ciphertext2, len);&lt;BR /&gt;cout&amp;lt;&amp;lt;"the SSL ciphertext:"&amp;lt;&lt;ENDL&gt;&amp;lt;&lt;CIPHERTEXT2&gt;&amp;lt;&lt;ENDL&gt;&lt;/ENDL&gt;cout &amp;lt;&amp;lt; "the SSL deciphered text: "; &lt;BR /&gt;for(i=0;i&lt;LEN&gt;&lt;/LEN&gt; cout&amp;lt;&lt;DECIPH2&gt;&lt;I&gt;;&lt;BR /&gt;cout&amp;lt;&lt;ENDL&gt;&lt;/ENDL&gt;EVP_CIPHER_CTX_cleanup(&amp;amp;enc_ctx); &lt;BR /&gt;EVP_CIPHER_CTX_cleanup(&amp;amp;dec_ctx); &lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;/I&gt;&lt;/DECIPH2&gt;&lt;/CIPHERTEXT2&gt;&lt;/ENDL&gt;&lt;/I&gt;&lt;/DECIPH&gt;&lt;/CIPHERTEXT&gt;&lt;/ENDL&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/IOSTREAM&gt;&lt;/SYS&gt;&lt;/OPENSSL&gt;&lt;/TIME.H&gt;&lt;/STDLIB.H&gt;&lt;/STRING.H&gt;&lt;/OPENSSL&gt;&lt;/OPENSSL&gt;</description>
      <pubDate>Fri, 04 Nov 2011 08:20:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/problem-about-encryption-and-decryption/m-p/800304#M3159</guid>
      <dc:creator>Andrzej_Chrzeszczyk</dc:creator>
      <dc:date>2011-11-04T08:20:27Z</dc:date>
    </item>
    <item>
      <title>problem about encryption and decryption</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/problem-about-encryption-and-decryption/m-p/800305#M3160</link>
      <description>&lt;P&gt;Thank you very much.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2011 00:54:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/problem-about-encryption-and-decryption/m-p/800305#M3160</guid>
      <dc:creator>Liang_Lu</dc:creator>
      <dc:date>2011-11-07T00:54:29Z</dc:date>
    </item>
  </channel>
</rss>

