-
Notifications
You must be signed in to change notification settings - Fork 0
#7 Encryption
Akshat Sharma edited this page Dec 13, 2020
·
2 revisions
Entirety of encryption is handled in EncryptionController
. This class as following functions:
-
generateKeys()
: returns an array of size2
.arr[0]
is private key whilearr[1]
is public key. -
getEncryptedMessage()
: takes aChatMessage
object whosemssgText
attribute is plain text and returns aChatMessage
object whosemssgText
attribute is encrypted. -
getDecryptedMessage()
: opposite ofgetEncryptedMessage()
. Returns a decrypted plaintextchatMessage
.
The controller always encrypts with recipient's public key and decrypts with current user's (sender's) private key.
Where encryption-decryption takes place:
- All incoming/outgoing radio messages are encrypted.
- All incoming/outgoing offline messages are encrypted.
- All incoming/outgoing online messages are encrypted.
- Any message being stored in local database is decrypted.
EncryptionController
can be found in security/EncryptionController.java