What are you trying to insinuate ? Please explain what is in your opinion “the normal way of using public key encryption” and why my implementation is not “the normal way of using public key encryption” ? I just counted the number of UTF-8 characters of a message that goes through: 117 characters. When I add another character it doesn’t get through. Please don’t assume you know things that you don’t know.
Please explain how increasing the maximum size of text messages to a fixed size in bytes, changes the way memory is allocated.
The normal way to use it is to encrypt a session key and use a fast symmetric algorithm for the main encryption.
I thought I had done. If I didn’t do it well, it may be better for someone else to try and explain.
I ended up splitting each text message into smaller pieces, then putting everything together at the destination. It works fine in spite of the 1024 byte hard-coded limit and in spite of the RSA encryption. I know that RSA encryption is often used to encrypt and trnsmit an AES key, which is then used to do the actual encryption/decryption of the message. However, if I had used this method, the only gain would have been to be able to send about 800 characters at once instead of about 100. The way I implemented RSA is very fast, the encryption/decryption speed is not a problem. The big disadvantage with symmetric encryption + RSA would have been that given the structure of my application, a secure implementation would have involved 2 AJAX calls for every message, instead of just one, as well as using an additional JavaScript library, etc. The RSA-only method is much cleaner, very fast and at least as secure, if not more secure.
I tested the application with multibyte characters, such as Chinese, Cyrillic, etc., with long texts and everything works fine. The message reaches its destination almost instantaneously. I also sent a 100000 character long message, which is about 30 A4 pages. It went through with no problems.
The conclusion is that given its WebRTC capabilities, Asterisk can be used successfully as a text chat server, although it wasn’t built for that. After all, no audio/video communication platform is complete without text chat.
Many thanks to the Asterisk developers who did the work. This thread can be closed now.
1 Like