gnu-crypto-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GNU Crypto] GNU Crypto and OpenSSL


From: Casey Marshall
Subject: Re: [GNU Crypto] GNU Crypto and OpenSSL
Date: Sun, 04 Jan 2004 02:11:20 -0800
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.2 (gnu/linux)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>>>>> "Ben" == Ben  <address@hidden> writes:

Ben> Thanks a bunch for pointing me in the right direction on this.  I
Ben> fixed up my code and thought I had it down, but now I am having
Ben> another problem.  Only the first 8 bytes (1 block) of my data is
Ben> being encrypted, the rest is just 0's.  I have 16 bytes total,
Ben> and CBC mode is supposed to encrypt multiples of 8 bytes right?
Ben> Here is my encryption function:

I forgot to mention this: modes (and ciphers) operate on a single
block per call.

So you need to do:

  int bs = blowfish_cbc.currentBlockSize();
  for (int i = 0; i < data.length; i += bs)
    {
      blowfish_cbc.update(data, i, encData, i);
    }

- -- 
Casey Marshall || address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.7 <http://mailcrypt.sourceforge.net/>

iD8DBQE/9+a+gAuWMgRGsWsRAjPdAJ4x6d2HsFRe3zJARBp5Z8BH/EAifgCfai2Y
Z1CgnpiICvcqD8kpu+hWQew=
=F79L
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]