Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Crypt::OpenPGP - determining which cipher to use

by iburrell (Chaplain)
on Feb 03, 2004 at 00:21 UTC ( [id://326069]=note: print w/replies, xml ) Need Help??


in reply to Crypt::OpenPGP - determining which cipher to use

The public key in OpenPGP format stores lists of preferred symmetric, hash, and compression algorithms. The lists are in preference order, and any algorithm in the list isn't supported by the client.

I don't see any easy way to get this information fron Crypt::OpenPGP interface. The module really should use these lists if available to choose the algorithms it uses when encrypting messages.

  • Comment on Re: Crypt::OpenPGP - determining which cipher to use

Replies are listed 'Best First'.
Re: Re: Crypt::OpenPGP - determining which cipher to use
by hv (Prior) on Feb 03, 2004 at 01:57 UTC

    Super, that gave me what I needed to find some relevant information. The standard is defined primarily in RFC 2440 and RFC 3156, and the relevant parts here are in RFC 2440 5.2.3.6:

    5.2.3.6. Preferred symmetric algorithms
    
       (sequence of one-octet values)
    
       Symmetric algorithm numbers that indicate which algorithms the key
       holder prefers to use.  The subpacket body is an ordered list of
       octets with the most preferred listed first. It is assumed that only
       algorithms listed are supported by the recipient's software.
       Algorithm numbers in section 9. This is only found on a self-
       signature.
    and 9.2:
    9.2. Symmetric Key Algorithms
    
           ID           Algorithm
           --           ---------
           0          - Plaintext or unencrypted data
           1          - IDEA [IDEA]
           2          - Triple-DES (DES-EDE, as per spec -
                        168 bit key derived from 192)
           3          - CAST5 (128 bit key, as per RFC 2144)
           4          - Blowfish (128 bit key, 16 rounds) [BLOWFISH]
           5          - SAFER-SK128 (13 rounds) [SAFER]
           6          - Reserved for DES/SK
           7          - Reserved for AES with 128-bit key
           8          - Reserved for AES with 192-bit key
           9          - Reserved for AES with 256-bit key
           100 to 110 - Private/Experimental algorithm.
    
       Implementations MUST implement Triple-DES. Implementations SHOULD
       implement IDEA and CAST5.Implementations MAY implement any other
       algorithm.
    

    Hopefully that should be enough for me to delve into the Crypt::OpenPGP::* innards, and eventually come up with a proposal to the author for an extension to the interface.

    Thanks,

    Hugo

    [Update] second quote was truncated.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://326069]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-04-19 14:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found