Jacko123
July 9th, 2007, 06:46 AM
Hello,
I want to send an email via network. My requirement is to send an encrypted file via email.
I'm able to send plain text files but if I encrypt and send it, the encrypted file is received but I'm unable to open the file from my application. I get error "incorrect password" though I have entered the correct password.
what I did???
1) Using my application encrypted the file using AES::CBC mode (crypto++ lib) say with password "sample123"
2) Send this file by an attachment using this code to SMTP.
HELO there
MAIL FROM: <xyz@gmail.com>
RCPT TO: <abc@yahoo.com>
DATA
Content-Type: multipart/related; boundary=unique-boundary-1
--unique-boundary-1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: binary
Content-Disposition: attachment; filename=samp.txt
MIME-Version: 1.0
From: <xyz@gmail.com>
To: <abc@yahoo.com>
Subject: samp.txt
//encrypted data.
.
QUIT
3) Received the file at abc@yahoo.com.
4) Open the file with the help of my application.
5) Fails to open as the file is modified. Get error as "incorrect password".
My questions:
1) Is the above data that I'm sending to SMTP correct??
2) How can I send an encrypted data over network so that the contents of the encrypted doesnt change...
Thanks in advance..
I want to send an email via network. My requirement is to send an encrypted file via email.
I'm able to send plain text files but if I encrypt and send it, the encrypted file is received but I'm unable to open the file from my application. I get error "incorrect password" though I have entered the correct password.
what I did???
1) Using my application encrypted the file using AES::CBC mode (crypto++ lib) say with password "sample123"
2) Send this file by an attachment using this code to SMTP.
HELO there
MAIL FROM: <xyz@gmail.com>
RCPT TO: <abc@yahoo.com>
DATA
Content-Type: multipart/related; boundary=unique-boundary-1
--unique-boundary-1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: binary
Content-Disposition: attachment; filename=samp.txt
MIME-Version: 1.0
From: <xyz@gmail.com>
To: <abc@yahoo.com>
Subject: samp.txt
//encrypted data.
.
QUIT
3) Received the file at abc@yahoo.com.
4) Open the file with the help of my application.
5) Fails to open as the file is modified. Get error as "incorrect password".
My questions:
1) Is the above data that I'm sending to SMTP correct??
2) How can I send an encrypted data over network so that the contents of the encrypted doesnt change...
Thanks in advance..