Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Enrypting with SATSA Crypto

 
Koot Jart
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I'm doing a little MIDLet, where I need to encrypt some texts. I'm using SATSA API for that encryption purposes. Cipher class to actual enryption

javax.crypto.Cipher;

Here is what I have blocksize, what algorithm is used and what kind of padding is used.



Here is how I do actual crypting


One thing here is unclear to me. I noticed, that if remainder is 0 (zero), I have to increase ciphertextLength one blocksize. So actual byte table is then plaintext + blocksize. Otherwise, if table cipherText is as big as plaintext, ShortBufferException is thrown.

Can somebody explain why I have to do this. I assume, that something added to that cipherText table more, than just plaintext. But what is that.

Thanks for your answers!
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!