EldoS | Feel safer!

Software components for data protection, secure storage and transfer


Posted: 02/12/2007 14:32:20
by Matthew Jones (Standard support level)
Joined: 02/06/2007
Posts: 26

Okay, this is wierd then. I still get the error.
procedure TForm1.btnSaveClick(Sender: TObject);
  Crypto : TElRSAPublicKeyCrypto;
  KeyMaterial : TElRSAKeyMaterial;
  InBuf, EncBuf, DecBuf : ByteArray;
  EncSize, DecSize : integer;
   KeyMaterial := TElRSAKeyMaterial.Create;
  Crypto := TElRSAPublicKeyCrypto.Create();
  Crypto.KeyMaterial := m_xKeyMaterial;
  Crypto.InputEncoding := rsapkeBinary;
  Crypto.OutputEncoding := rsapkeBase64;

  // encrypting data
  SetLength(InBuf, 33);
  SBRndGenerate(@InBuf[0], Length(InBuf));
  EncSize := 0;
  Crypto.Encrypt(@InBuf[0], Length(InBuf), nil, EncSize);
  SetLength(EncBuf, EncSize);
  Crypto.Encrypt(@InBuf[0], Length(InBuf), @EncBuf[0], EncSize);

  // decrypting encrypted data
  Crypto.InputEncoding := rsapkeBase64;
  Crypto.OutputEncoding := rsapkeBinary;
  DecSize := 0;
  Crypto.Decrypt(@EncBuf[0], EncSize, nil, DecSize);
  SetLength(DecBuf, DecSize);
  Crypto.Decrypt(@EncBuf[0], EncSize, @DecBuf[0], DecSize);

Click the button, and I get an error in TElPublicKeyCrypto.Encrypt at the end where it checks the Length(FOutput) against Outsize and gives SInternalError. The units I've included are SBSymmetricCrypto, SBPublicKeyCrypto, SBUtils. I'm using the PKI version of the code. My current purpose is to write the demo on how to use the PK with Assymetric encryption so that I know I've got a good foundation to roll into my code. But right now not only does this simple example fail, but my main demo code isn't decrypting from a stream either. As I'm sure you guys suffer lots more, debugging encrypted data is hard as it is all "random".

Thanks for all the help, Matthew.
Posted: 02/12/2007 14:45:20
by Ken Ivanov (Team)

Would you be so kind to check the build number you are using? It is possible that this error has been present in one of the past build updates, but was fixed later.
Posted: 02/12/2007 14:51:04
by Matthew Jones (Standard support level)
Joined: 02/06/2007
Posts: 26

SecureBlackbox - version 4.0.94 - Released July 20, 2006 is what the changes.txt says. I bought it only a month or so ago, and have now got the need to actually use it.

I will check if there is a newer version.

Posted: 02/12/2007 14:54:11
by Matthew Jones (Standard support level)
Joined: 02/06/2007
Posts: 26

Hmm, I see I bought in December, and just afterwards the version 5 was officially released. I guess I'll update now and see if that just cures my problems.

Posted: 02/12/2007 14:54:46
by Eugene Mayevski (Team)

In fact it's version 5.0 available now and if you purchased a license a month ago, you must have received SecureBlackbox 5 license key. We strongly recommend that you update to SecureBlackbox 5 as we will not be able to provide a full-powered support for old versions (i.e. we can't test them thoroughly and we can't provide fixes for them).

Sincerely yours
Eugene Mayevski
Posted: 02/12/2007 15:05:33
by Matthew Jones (Standard support level)
Joined: 02/06/2007
Posts: 26

I got a notice, but not automatic key. Email is in the post, as they say. 8-)

Posted: 02/12/2007 15:24:53
by Eugene Mayevski (Team)


Sincerely yours
Eugene Mayevski
Posted: 12/17/2009 12:47:50
by Ami Goldi (Basic support level)
Joined: 12/09/2009
Posts: 3

I don't know if this thread was ever resolved, but using RSA encryption, the data that you are encrypting is limited to the size of the key, minus a few bytes for padding. For example, if you are using 1024 bit keys, then you can only encrypt data that is up to 128 bytes long, otherwise you'll get the "Input too long" error message.



Topic viewed 7357 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!