Note that there are some explanatory texts on larger screens.

plurals
  1. POdecryption of block cipher?
    primarykey
    data
    text
    <p>Hi i have encrypted a data of size 196,662 bytes, using block cipher method AES-128 of mode electronic code book (ecb), and now the encrypted data size became 196,672 bytes. And now I have to decrypt, since the data size i have to decrypt is a multiple of 16, I tried decrypting the encrypted data at a single stretch without dividing it, but its not decrypting. Tell me if i want to change anything in my encryption and decryption method or else tell me any other equivalent solution. Thanks in advance.</p> <p>Edit: Encryption code:</p> <pre><code>bufferlen = filesize; buffer = new BYTE [ bufferlen ]; feof = false; do { count = fread(buffer, 1, 16, filepointer); if ( count &lt; 16 ) { feof = true; } cout &lt;&lt; count; result = CryptEncrypt(hGenKey,NULL,feof,0,buffer,&amp;count,bufferlen); if ( result == 0 ) { cout &lt;&lt; "\nencrypt failed"; } else { cout &lt;&lt; "encrypt passed"; } if(fwrite(buffer, 1, count , filepointer1)!=count) { cout &lt;&lt; "\nwrite failed"; } } while (feof != true); </code></pre> <p>Decryption code:</p> <pre><code>bufferlen = filesize; buffer = new BYTE [ bufferlen ]; feof = false; do { count = fread(buffer, 1, 16, filepointer); if ( count &lt; 16 ) { feof = true; } cout &lt;&lt; count; result = CryptEncrypt(hGenKey,NULL,feof,0,buffer,&amp;count,bufferlen); if ( result == 0 ) { cout &lt;&lt; "\nencrypt failed"; } else { cout &lt;&lt; "encrypt passed"; } if(fwrite(buffer, 1, count , filepointer1)!=count) { cout &lt;&lt; "\nwrite failed"; } } while ( feof != true ); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload