For Programmers: Free Programming Magazines  


Home > Archive > Java Security > January 2006 > Re: [Q]Symmetric Encryption problem with Java and Crypto API









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [Q]Symmetric Encryption problem with Java and Crypto API
stefano.fornari@gmail.com

2006-01-10, 4:13 am

It should be this:

bResult = CryptEncrypt(
hKey, // Key obtained earlier
0, // No hashing of data
FALSE, // Final or only buffer of data
0, // Must be zero
sSrcData, // No data this time
&dwSize, // length of the source data
0 // Size of block
);

> /* THIS DOESN'T WORK.
> 1. Does not update dwSize value
> 2. Affects (screws up) encrypted data
> 3. Am I using it the wrong way?????
> // Get the size of the encrypted block
> bResult = CryptEncrypt(
> hKey, // Key obtained earlier
> 0, // No hashing of data
> FALSE, // Final or only buffer of data
> 0, // Must be zero
> 0, // No data this time
> &dwSize, // length of the source data
> 0 // Size of block
> );


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com