Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Enrypting with SATSA Crypto  RSS feed

Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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


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!
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!