File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Using Cipher on 2 strings in Succession Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Using Cipher on 2 strings in Succession" Watch "Using Cipher on 2 strings in Succession" New topic
Author

Using Cipher on 2 strings in Succession

Dennis Putnam
Ranch Hand

Joined: Feb 03, 2012
Posts: 230
Can doFinal be invoked on 2 separate strings after a single call to init? In other words is this sequence valid?
Richard Tookey
Rancher

Joined: Aug 27, 2012
Posts: 1166
    
  17

Yes - as long as no exception is thrown.
Dennis Putnam
Ranch Hand

Joined: Feb 03, 2012
Posts: 230
Thanks. It seemed to work but I just wanted to make sure.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Using Cipher on 2 strings in Succession
 
It's not a secret anymore!