I would recommend setting up an SSL (Secure Socket Link). One link with some definitions is: http://en.wikipedia.org/wiki/Secure_Sockets_Layer

There are many ways of doing this. The main point is that your thinking (algorithm) is not correct. There will be essentially be an encrypt function and a decrypt function.

A layer on top of that is that the number of bytes sent == number bytes received by some protocol. This is like receiving a binary file with a "checksum".

By definition of an encrypted link, there is NO comparison of sent byte 1 to received byte 1. Ie, I sent a "secret message", you get it and decrypt it, but there is never any discussion about whether my char 3 is the same as char 3 that you sent. In fact, I may even send more encrypted bits (or even less) than you sent me to encrypt to begin with!

Typically the encrypted message is "transported" via standard protocols that show the num bytes sent, etc. You "got" the encrypted message by: 1)transport layer says that it is ok (number of bytes sent and received are the same and reasonable probability that no transmission error occured, 2)decrypted values "make sense".


In reply to Re: file comparison by Marshall
in thread file comparison by Karger78

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.