This one is for Monks with experience in sockets and encryption:

I am using sockets (IO::Socket::INET) to communicate bi-directionally between several machines (n automatons and a server). I'd like to encrypt all messages using the PGPSimple module. My questions don't have to do directly with the encryption, but rather with the key management. This is an intranet application where automatons will connect to a port on the server.

1. When the automatons (which I have never seen or heard from before) log onto the server they will ask for the server's public key. Do I send and receive this as a string? (In other words $string = $objPGP->PublicKey("me\@myserver.com" and then send the $string via the socket).

2. Also, the automatons will send the server their public keys and identifications (automatonN@myweb.com), presumably in the same way the server sends its public key to them: as a sting into the socket. In order to use the automaton's public key I need to access it with the "PublicKey" method (which requires the identification. This menas that once I have the public key for automaton N I need to place it in the keyring (specified in PgpKeyPath). What method should I use to store the key?

Thanks All!
Gary

In reply to Crypt::PGPSimple - keyring management by gary kuipers

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.