To reach a satisfactory level of security, you need to use SSL. Taking a look at what happens:

1) User goes to website
2) User enters information (username, password)
3) User hits "submit" button
*sniff packets here*
4) User entered information is sent plaintext across the wire.
5) Programmer tries to secure information now at the server
*futile - information has already been sniffed*


Using SSL, their browser and your server negotiate a public-private key pair; and the encryption/decryption is done on both sides; thus, preventing anything plaintext being sent over the line.
I guess, if you really want to do this programmatically, you would have to use some form of client-side browser scripting (a la JavaScript) to encrypt the data after the user has hit submit and before it is sent down the wire. Then, over at the server, you would need to reverse the client-side encryption (basically, you are redoing SSL). But, that method would be a lot slower than SSL and probably less secure. Why remake the wheel? SSL is what you are looking for. Here is a link for Apache's SSL. I could not find an official IIS SSL page, but here is a link to a web site that will take you step-by-step for installing SSL on IIS.

Jeremy

In reply to Re: Ecryption? by enoch
in thread Ecryption? by Punto

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.