Non-optimal program output on symm. decryption of old-style PGP data

David Dahlberg D-Mail at gmx.net
Sat Dec 25 20:50:30 CET 2004


Hello *,

Some time ago I tryed en- and decrypting some file symmetrically in
the old PGP packet style (v3?) by using the following commands:

|gpg -o <encrfile> --rfc1991 --cipher idea --symmetric <plainfile>
|gpg -o <decrfile> --decrypt <encrfile>

which I thougt should be okay, since the decrypt command uses to reply "gpg:
assuming IDEA encrypted data" and this is indeed IDEA encrypted
material. But for some reason it didn't work :-(

Conclusion: The above encryption line uses the default hash algorithm
(SHA), the decryption routine guesses CAST5 (but doesn't say it),
while I thought plain symmetric encryption doesn't need any hashing.

(See also <news:cif3qb.3dk.1 at eddie.sub-etha.org> et seqq. on /Z-NETZ/ALT/PGP/ALLGEMEIN, resp.
  <http://groups.google.com/groups?threadm=cif3qb.3dk.1@eddie.sub-etha.org> (both German)
)

My suggestion for improvement'd be to change that decryption
cipher-guess line from "assuming IDEA encrypted data" to something
like "assuming IDEA/CAST5":

 ,--------------[ mainproc.c ]---------
| static void
| proc_encrypted( CTX c, PACKET *pkt )
| { [..]
|     write_status( STATUS_BEGIN_DECRYPTION );
| 
|     /*log_debug("dat: %sencrypted data\n", c->dek?"":"conventional ");*/
|     if( opt.list_only )
|     result = -1;
|     else if( !c->dek && !c->last_was_session_key ) {
|         int algo;
|         STRING2KEY s2kbuf, *s2k = NULL;
| 
|         /* assume this is old style conventional encrypted data */
|         if ( (algo = opt.def_cipher_algo))
|             log_info (_("assuming %s encrypted data\n"),
|                         cipher_algo_to_string(algo));
|         else if ( check_cipher_algo(CIPHER_ALGO_IDEA) ) {
|             algo = opt.def_cipher_algo;
|             if (!algo)
|                 algo = opt.s2k_cipher_algo;
|             idea_cipher_warn(1);
|             log_info (_("IDEA cipher unavailable, "
|                         "optimistically attempting to use %s instead\n"),
|                        cipher_algo_to_string(algo));
|         }
|         else {
|             algo = CIPHER_ALGO_IDEA;
|             if (!opt.def_digest_algo) {
|                 /* If no digest is given we assume MD5 */
|                 s2kbuf.mode = 0;
|                 s2kbuf.hash_algo = DIGEST_ALGO_MD5;
|                 s2k = &s2kbuf;
|             }
|             log_info (_("assuming %s encrypted data\n"), "IDEA");
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|         }


TIA and pardon my bad English
       David

PS:
http://bugs.gnupg.org/cgi-bin/gnatsweb.pl?debug=&database=default&cmd=create
didn't work with Opera/7.54, WinXP; saying the following on "Submit":
|Software error:
|Malformed multipart POST
|For help, please send mail to this site's webmaster, giving this error message
|and the time and date of the error.
:-(



More information about the Gnupg-devel mailing list