Analysis of XOR encryption algorithm for Android data encryption

preface:

In recent days, the company temporarily asked the company to implement the Android im instant messaging protocol, and roughly looked at the agreement they set. Because they had not participated before, it is said that due to server performance constraints, only non plaintext transmission was reached. I don't know the specific reason, but the encryption method used here is XOR encryption. This encryption method has been used in Android encryption Notepad before. Today, we have finished the connection of client heartbeat maintenance and packet analysis. Let's summarize this encryption method.

Other encryption methods:

What is XOR encryption?

In the XOR operation, if a character (or numerical value) x is XORed with a numerical value m to obtain y, then the XOR operation with y and M can be restored to X. therefore, the function of data encryption and decryption can be realized by applying this principle.

XOR usage scenario?

XOR encryption and decryption implementation?

1. Fixed key

This method is the same as the encryption and decryption algorithm

Test encryption and decryption

2. The key is not fixed

Encryption implementation

Decryption implementation

test

Summary:

Bit operation can realize many advanced and efficient operations. For example, encryption, the n-th power in multiplication is to shift n bits to the right, which is fast. Im binary data packet adopts XOR algorithm. Firstly, it can realize encryption. Secondly, the XOR encryption algorithm will not change the length of binary data, which is of great benefit to binary data packet. Therefore, this summary is made.

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>