Add encryption in firebase group chat

Brief summary of this post: 1. The user enters a passphrase which is unique to the group chat and has to be shared to the user for granting him access. 2. The passphrase is saved in SharedPreferences. 3. A master key is generated using the passphrase. 4. While sending message, a secret key is generated using the master key and message ID. The message is encrypted using this secret key. 5. On retrieving message, it is decrypted using a secret key generated using master key and message ID. Steps: 1. In Button to enter the group chat page, add a dialog box (dialog2) with EditText (dialog_text1) where user can enter the passphrase. On entering the passphrase it is saved in SharedPreferences (sp:sp) and user moves to group chat activity using intent component. Code to add an EditText to Dialog component: final EditText dialog_text1 = new EditText(AdminpageActivity.this); dialog_text1.setLayoutParams(linear2.getLayoutParams()); dialog2.setView(dialog_text1); Code to get text from EditTe...