In a simple form, essentially when a user registers with Matrix with their device, their device is assigned a pair of keys, a PUBLIC and PRIVATE key. Each device has its own pair of PUBLIC and PRIVATE keys.
When two users are messaging each other using encryption, USER1 writes a message and locks it with their PRIVATE key, the message is addressed to USER2's PUBLIC Key.
When USER2 receives the message addressed to their PUBLIC Key, they can then use their PRIVATE Key to unlock it. They can also use USER1's PUBLIC Key to verify the message came from USER1 and not another user.
When you can, it is best practice to verify keys with other users you affiliate with. This ensures that your communications are encrypted and that there is no middle-man. In the event that something happened to your affiliates device or someone attempts to read your messages from outside, your keys will not match. This will prevent anyone on a new device with the wrong keys from reading previous messages, send new messages to previous verified session and etc.
Matrix gives keys to each device instead of each user. This means, if you're a mobile user, you are given a set of keys for your mobile device. But let's say you decided to login on another device, such as the browser application. In this case, if you login, you'll be given a new set of keys that need to be verified with all associates.
To get started with Key verification android mobile devices, you need to go to a users profile and click “Show Session List”, users might have more then one session (device) and you'll need to repeat this process for each session (device).
A prompt will pop up on your end. Remember, for maximum security, it is recommended you complete this process in person or other trusted means of communication (another encrypted communication chat is best). Once you are ready, hit “Begin Verifying”.
Once the other user accepts the verification process prompt, you both will see Emoji's pop up. Communicate with each other and ensure that both of you have the same exact emoji's displayed. Once you have confirmed this, hit “Continue”.
Repeat all of these steps for each device owned by yourself, or the other users owns.