我想讨论一下openssl的写入和读取方法。
假设我有一个数据结构如下图所示:openssl ssl加密
/-----------------------------------------------------\ | 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).
如何是你的方法,如果你面对一个问题,像上面。由于openssl加密了所有发送到SSL_write函数(CMIIW)的数据。
谢谢。
也许,在apropriate问题是,什么是可用于加密/ OpenSSL中解密有效载荷的加密和解密功能?
你能告诉我们在头和有效载荷之间存在什么样的逻辑连接?他们真的需要在同一个框架中吗?标题是否需要加密?这可能会有所帮助。 – ereOn 2010-03-30 06:47:15
嗯,我只想知道,如果我们面临这样的问题会怎么样。我相信openssl可以做这样的事情。 – deddihp 2010-03-30 14:00:17