On Fri, Apr 11, 2014 at 2:15 PM, Nikolay Elenkov
<[email protected]> wrote:
> On Fri, Apr 11, 2014 at 1:49 PM, nikhilesh <[email protected]> 
> wrote:
>> Hi Nikolay,
>>
>> Thanks for the reply. I tried the same thing but no success. Please see code
>> snippet below:
>
> You are on the right track, but the cipher() should return byte[], and
> decipher() should take a byte[] as input (the output of cipher()).
> You can't just convert encrypted data to an integer. In your case
> it's much longer than 4 bytes (16), so you are throwing away 12 bytes.
> Dump encrypted data to log to confirm.

Also note that this code will generate and use a random IV, so you
need to save it and use it for decyption.You can get the IV using
Cipher.getIV().

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to