openssl ssl encryption

Posted by deddihp on Stack Overflow See other posts from Stack Overflow or by deddihp
Published on 2010-03-30T00:32:55Z Indexed on 2010/03/30 1:03 UTC
Read the original article Hit count: 324

Filed under:
|
|

Hello, I want to discuss about openssl write and read method.
Assume I have an data structure like below:

/-----------------------------------------------------\
|  my_header   |  PAYLOAD                             |
\-----------------------------------------------------/
       |                              |
      \ /                            \ /
 not encrypted                      encrypted

I think the proper algorithm would be like this :
   SEND:
   build my_header with my own header.
   encrypt PAYLOAD with encryption function
   attach my_header and PAYLOAD (encrypted) to one buffer
   send it using common POSIX function just like send or sendto
   RECV:
   using common POSIX function just like recv or recvfrom.
   extract my_header and PAYLOAD(encrypted)
   decrypt PAYLOAD with decryption function
   at last i got my_header and PAYLOAD(decrypted).

How is your approach if you face a problem like above. Since openssl encrypt all of data that is sent to SSL_write function (CMIIW).

Thanks

© Stack Overflow or respective owner

Related posts about openssl

Related posts about ssl