Should I use cryptographic message syntax (CMS) for this task?

I have the task of transferring small binary messages (1 or 2 kilobytes long) between a desktop application and mobile devices. Messages should be encrypted asymmetrically (for example, RSA). From what I learned, you should use a hybrid cryptosystem for this kind of task:

  • Generate a random symmetric key
  • Encrypt plain text with a symmetric key (for example, using AES)
  • Encrypt symmetric public key
  • Transmission of encrypted text and encrypted symmetric key

I would not want to invent my own format for storing encrypted text and an encrypted symmetric key. So I came across the CMS standard (cryptographic message syntax). At first glance, it looks exactly the way I need it. If I understand the standard correctly, it enters ciphertext and an encrypted symmetric key, as well as information about the algorithms used.

Can anyone tell if the CMS standard should be used for the intended task? Is OpenSSL CMS support sufficient for my needs?

Cheers, Christian

+3
source share
1 answer

CMS , . , CMS, API OpenSSL .

- CMS, X.509, . PKI, ( RSA, , ).

OpenSSL API CMS; , , cms.c apps/ OpenSSL; 1000 , , , , , .

+4

Source: https://habr.com/ru/post/1709768/


All Articles