Encrypted Emails PHP?

Discussion in 'PHP' started by Tropica, Jun 17, 2008.

  1. #1
    I have a form on one of my sites, when the form is submitted is there a way to encrypt the form? And then arrive in my email inbox un-encrypted?

    Of would I have to encypt the form page? If so whats the easiest way to do wither of these things?

    The form is a pretty standard PHP mailer type

    Thanks
     
    Tropica, Jun 17, 2008 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    You can use the mcrypt http://php.net/mcrypt function to encrypt a string, and then email it and decrypt it locally using the same key.

    If you need really strong encryption, here is a relly good AES class that will allow up to 256 Bit AES encryption.

    http://www.phpaes.com/

    I would encrypt, base64_encode, and then email it. You would then need to base64_decode, and decrypt it locally. You could also use a dynamic key like the specific email address with a salt.
     
    jestep, Jun 17, 2008 IP
  3. Tropica

    Tropica Notable Member

    Messages:
    2,431
    Likes Received:
    128
    Best Answers:
    0
    Trophy Points:
    230
    #3
    i think mcrypt might do it, but do you have to decrypt manually?
     
    Tropica, Jun 17, 2008 IP
  4. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #4
    When the email is received, it will be encrypted. At some point it will need to be decrypted so that it can be read. I don't now of any built-in function for an email program to decrypt a message.
     
    jestep, Jun 17, 2008 IP
  5. Tropica

    Tropica Notable Member

    Messages:
    2,431
    Likes Received:
    128
    Best Answers:
    0
    Trophy Points:
    230
    #5
    hmm, is there a more secure way to send emails? https?
     
    Tropica, Jun 17, 2008 IP