cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

chrisgregg
Journeyman III

AESEncryptDecrypt sample won't decrypt

I'm testing out the OpenCL sample programs, and I can't get the AESEncryptDecrypt code to decrypt the sample .bmp file (lena512.bmp).  It seems to encrypt it (at least the bmp looks like random 1-bit noise), but when I try to decrypt it, using the command line:

$ ./AESEncryptDecrypt -d -i output.bmp -o unencryptedOutput.bmp

I get another 1-bit random noise .bmp back.  What am I missing?  Thanks!

 

-Chris

 

0 Likes
3 Replies
Aland
Journeyman III

Have same problem. Tested both on CPU and GPU - decryption fails, although when using '-e' key it reports 'Passed!'. I've compared results with my own implementation of AES - encryption is right, while decryption is not.

Although, it runs quite slow - with CUDA i got 256MiB of data encrypted&decrypted in ~7 seconds (on Tesla C1060), while sample from SDK needs ~9 seconds (on GPU) to encrypt only 64MiB (it doesn't process larger files). Just wondering, is this trouble of OpenCL (because it's still beta) or hardware unsuitability for such algorithms?

(Windows 7 32bit, Firestream 9270, Stream SDK 2.0 beta4)

0 Likes

Thanks for reporting. The issue has been informed to our developers and they are looking into it.

0 Likes

When i've changed one string in kernel (see code attached), encryption/decryption became correct on nVidia GPUs (nForce v195.89, Tesla c1060 and 280gtx) (although i've tested your kernel separately from whole application, using it for processing just random bytes - i had changed just the part responsible for loading data to be processed, not changing anything directly related to OpenCL), and it was always ok on CPU (with ATI's OpenCL, 2 * amd opteron 2435) . However, it fails on Firestream (even sample, when run with -e option, reports 'Failed' on GPU, not mentioning about decryption results).

Btw, Firestream 9270 i'm using has label 'Engineering sample NOT for Qualification' on it. Maybe it's the source of troubles?

 

unsigned char hiBitSet = (a>127?128:0);/*(a & 0x80);*/

0 Likes