Subject: AW: Loading FR in CFB mode

From: "Weins, Thorsten" <[email-masked]>
Date: Fri, 19 Mar 2004 09:19:37 +0100

I have encountered this problem while trying to use a RSA-Key which has been created using PGP 8.0 with our OpenPGP implementation. The secret key is encrypted with AES256 and the IV which is part of the secret key packet is only 8 Bytes long. How can the problem be handled?

Thorsten Weins

-----Ursprüngliche Nachricht-----
Von: Hal Finney [mailto:[email-masked]] 
Gesendet: Donnerstag, 18. März 2004 18:48
An: [email-masked]; Weins, Thorsten
Betreff: Re: Loading FR in CFB mode

Thorsten writes:
> can anybody tell me how to load the FR in CFB mode (not PGP CFB mode!) 
> when the BS is 16 Bytes (e.g. when using AES256) but the IV only 
> consists of 8 Bytes.

I assume this is not an OpenPGP question, right?

There is no right answer to this.  The IV should normally be the same size as the block size.  If you are using a non-standard, smaller IV then you must have an agreement among all participants about how you will handle it.

Hal Finney

---

From: Werner Koch <[email-masked]>
Date: Fri, 19 Mar 2004 10:59:05 +0100

> I have encountered this problem while trying to use a RSA-Key which has been created using PGP 8.0 with our OpenPGP implementation. The secret key is encrypted with AES256 and the IV which is part…

That might be a bug in PGP.  You need to explictly track the length of
the IV like:

	    switch( sk->protect.algo ) {
	      case 7: case 8: case 9: /* reserved for AES */
	      case 10: /* Twofish */
		sk->protect.ivlen = 16;
		break;
	      default:
		sk->protect.ivlen = 8;
	    }

IIRC, I once checked with Hal that Twofish worked for both GnuPG and
PGP.

  Werner