Service Layer high complexity mobile
0
Dependencies
0
Dependents
5
Entities
0
Integrations

Description

Core service responsible for end-to-end asymmetric encryption and decryption of assignment payloads. Retrieves the recipient's public key to encrypt outbound assignments and uses the local private key (stored in Flutter Secure Storage) to decrypt inbound content, with all crypto operations offloaded to a Flutter Isolate to keep the UI thread responsive.

Feature: Encrypted Task Assignment to Peer Mentors

task-encryption-service

Responsibilities

  • Retrieve recipient public key from Key Management Service
  • Encrypt assignment payload with recipient public key before storage
  • Decrypt received assignment payload using local private key inside a Flutter Isolate
  • Validate payload integrity with HMAC or signature check
  • Handle key-not-found and decryption failure error states

Interfaces

encryptPayload(plaintext, recipientPublicKey)
decryptPayload(ciphertext, privateKey)
validatePayloadIntegrity(payload)
runInIsolate(cryptoTask)
getRecipientPublicKey(userId)
reportEncryptionError(error)