Dealing with this from the JCE point of view is covered in Chapter 4.
If you're trying to implement the underlying algorithm from scratch, I would recommend having a look at the source code for the Bouncy Castle lightweight API which is also available on the Bouncy Castle web site.
Regards,
David
|