note 73139 added to function.openssl-pkcs7-sign
| From: | ungdi at hotmail dot com | Date: | Sat, 10 Feb 2007 09:10:35 +0000 |
| Subject: | note 73139 added to function.openssl-pkcs7-sign | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-123211@lists.php.net to get a copy of this message | ||
I would like to make a modification from my previous note. Some clients prefer a certain order in
which messages should be signed and encrypted (if both is desired). Newer email clients, such as
Thunderbird and Outlook 2003 will accept the most secure method of "sign -> encrypt ->
sign again".
Why?
The first signing authenticates the message saying that you did indeed write it. Then the email is
encrypted so that only the recipient can open and read it. Then the second signing ensure
confidentiality by identifying that the person encrypting is the one whom encrypted it, a message
intended for the decrypting person. This is the most secure method. This ensures: Non-Repudiation of
message (first sign), Confidentiality (encrypt), and Context Integrity [you were intended to be
addressed] (second sign).
If you only sign then encrypt, there is no way you can guarantee that (aside from the contents of
the letter, headers are placed in plain text outside the message) that the message was intended for
you by the original sender. For example:
Bob signs a love letter and encrypts it to Amy saying only "I love you. -- Bob". Amy
decrypts it, sees the message (and plays a joke) and forwards the message to John using John's
public key, re-encrypting, but not tampering with the message contents keeping the signature valid.
This allows Amy to make it look like Bob sent John a love letter and that Bob loves John, as you
cannot verify whom sent it during encryption. That is not what you want!
This is also analogous to someone taking a government document, put it in an envelope themselves and
write the government address in the return address and send it to you. You know the letter is
written by the government, but you don't know for sure whether the government sent it to you
directly or was opened and relayed.
While encrypting then signing has a problem, this is affectively signing on the envelope of a snail
mail piece. I know you sent it, but is the message really from you? Or are you forwarding it?
Sign - Encrypt - Sign Again method will make the first sign show that you know the writer of the
message is the person, encrypt it to keep others from reading it, sign again to indicate the message
was not relayed and that the sender intended to sent the mail to address you.
Just make sure the headers of the mail is applied in the last step and not the second or third step.
For more information about the security and integrity risks of this situation, please read this web
page: http://world.std.com/~dtd/sign_encrypt/sign_encrypt7.html
----
Server IP: 64.71.164.2
Probable Submitter: 66.207.163.166
----
Manual Page -- http://www.php.net/manual/en/function.openssl-pkcs7-sign.php
Edit -- https://master.php.net/note/edit/73139
Del: integrated -- https://master.php.net/note/delete/73139/integrated
Del: useless -- https://master.php.net/note/delete/73139/useless
Del: bad code -- https://master.php.net/note/delete/73139/bad+code
Del: spam -- https://master.php.net/note/delete/73139/spam
Del: non-english -- https://master.php.net/note/delete/73139/non-english
Del: in docs -- https://master.php.net/note/delete/73139/in+docs
Del: other reasons-- https://master.php.net/note/delete/73139
Reject -- https://master.php.net/note/reject/73139
Search -- https://master.php.net/manage/user-notes.php