A
A
Alexander Shishenko2012-01-21 13:57:13
Cryptography
Alexander Shishenko, 2012-01-21 13:57:13

Asymmetric encryption algorithm?

For a p2p application, you need to encrypt messages based on a public key algorithm. Messages from approximately 1 byte to 512 kb. Important points:
1) Small key length with good cryptographic strength.
2) Good performance to run on modern phones/tablets and other devices.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
MikhailEdoshin, 2012-01-21
@GamePad64

There are not so many public key algorithms, so, in fact, I would take RSA. For small messages (less than the length of the RSA key) you can encrypt them directly. For large ones, it is usually encrypted with a symmetric algorithm with a random key, and the key is then encrypted with RSA. The only thing is that the minimum message will be equal to the length of the RSA key, and they are quite long - 512 bits is considered not very safe, commercial keys start from 1024 bits.

O
Ocelot, 2012-01-21
@Ocelot

1) A random session key is generated for each messaging session.
2) The session key is transmitted encrypted using RSA 512/1024/2048
3) Subsequently, messages are encrypted with a symmetric algorithm (AES 128/256, Twofish, Serpent, IDEA) using the session key.
Pros:
+ key size for symmetric algorithms is smaller with comparable cryptographic strength
+ block size (which means the minimum message size) is 128-256 bits
+ symmetric algorithms work much faster
Cons:
- you need to pre-generate and transmit session keys
- you need to monitor the expiration date and relevance of session keys

Z
zed91, 2012-01-21
@zed91

1. The two parts of paragraph 1 do not agree with each other
2. Paragraph 2 does not agree with paragraph 1.
PS RSA

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question