Changing preferences

Robert J. Hansen rjh at sixdemonbag.org
Wed Sep 24 04:37:02 CEST 2008


Kevin Hilton wrote:
> Now that the algorithm has been changed for picking preferred
> algorithms, can someone please explain how the new algorithm works if
> the personal preferences are omitted?

Borda counting.

http://en.wikipedia.org/wiki/Borda_count

Once you've gone off and read that, come back and read the rest of this
message.  It will probably not make much sense until/unless you do.
This is a message I sent to David early this morning as a test of the
new algorithm selection code.

=====

Prefs are given here in shorthand: A3-A1 for AES256-128, C for CAST5, B
for Blowfish, T for Twofish, I for IDEA, D for 3DES.  Hashes are S5-S1
for SHA512-SHA1, M for MD5, R for RIPEMD160.  Compression is B, U, ZLIB
and ZIP.  Default prefs will be explicitly shown if not already listed,
if only to make the Borda count easier.



1.  KEY PREFERENCES.

Key ID          Cipher Pref         Hash Pref        Comp Pref
           1  2  3  4  5  6 7 8   1  2  3  4  5   1    2 3    4

0xE33B60D8 A1 T  C  B  D          R  S1           ZLIB Z U
0xFA92497C A1 T  C  B  D          R  S1           ZLIB Z U
0x7E70793D C  D  I  T             S1              Z    U
0xF34F9073 A3 A2 A1 C  D          S1 R            ZLIB Z U
0x3BCA7DD2 A3 T  A2 D  A1 C I B   S1              Z    U
0xD6B98E10 B  D  A3 A2 A1 C I     S3 S5 S4 S2 S1  B    Z ZLIB U
0xFEAF8109 B  D  A3 A2 A1 C I     S3 S5 S4 S2 S1  B    Z ZLIB U



2.  BORDA COUNTS

A1: 1 + 1 + 0 + 3 + 5 + 5 + 5 = 20
A2: 0 + 0 + 0 + 2 + 3 + 4 + 4 = 13
A3: 0 + 0 + 0 + 1 + 1 + 3 + 3 = 8
C:  3 + 3 + 1 + 4 + 6 + 6 + 6 = 29
B:  4 + 4 + 0 + 0 + 8 + 1 + 1 = 18
T:  2 + 2 + 4 + 0 + 2 + 0 + 0 = 10
I:  0 + 0 + 3 + 0 + 7 + 7 + 7 = 24
D:  5 + 5 + 2 + 5 + 4 + 2 + 2 = 25

S5: 0 + 0 + 0 + 0 + 0 + 2 + 2 = 4
S4: 0 + 0 + 0 + 0 + 0 + 3 + 3 = 6
S3: 0 + 0 + 0 + 0 + 0 + 1 + 1 = 2
S2: 0 + 0 + 0 + 0 + 0 + 4 + 4 = 8
S1: 2 + 2 + 1 + 1 + 1 + 5 + 5 = 17
M:  0 + 0 + 0 + 0 + 0 + 0 + 0 = 0
R:  1 + 1 + 0 + 2 + 0 + 0 + 0 = 4

ZL: 1 + 1 + 0 + 1 + 0 + 3 + 3 = 9
Z:  2 + 2 + 1 + 2 + 1 + 2 + 2 = 12
B:  0 + 0 + 0 + 0 + 0 + 1 + 1 = 2
U:  3 + 3 + 2 + 3 + 2 + 4 + 4 = 21


3.  ALLOWABLE ALGORITHMS

Sym intersect:  CAST5 (29 votes), 3DES (25 votes)
Hash intersect: SHA1 (17 votes)
Comp intersect: ZIP (12 votes), UNCOMPRESSED (21 votes)


4.  ALGORITHM SELECTION

Resulting message should be symmetrically encrypted with 3DES, signed
with SHA1 if possible for the signing keys, and compressed with ZIP.


5.  EXPERIMENTAL TEST

(Note that my gpg.conf file explicitly lists local-user D6B98E10 and
local-user FEAF8109, hence my omitting them from the command line here.)

job:gnupg-1.4.9 rjh$ gpg --armor --sign --recipient E33B60D8 --recipient
FA92497C --recipient 7E70793D --recipient F34F9073 --recipient 3BCA7DD2
--recipient D6B98E10 --recipient FEAF8109 --encrypt COPYING

job:gnupg-1.4.9 rjh$ gpg -vvvv COPYING.asc

[much irrelevant stuff snipped]

gpg: 3DES encrypted data
:compressed packet: algo=1
gpg: binary signature, digest algorithm SHA224
gpg: binary signature, digest algorithm SHA1


6.  CONCLUSION

It would appear the code is successful, at least in this example.



More information about the Gnupg-users mailing list