Engineering

Designing Granular Privacy: Field-Level Masking in Career Data

Learn how to build a 'Privacy Mode' that allows selective masking of sensitive career data like salary and employer names while sharing progress.

Amin Shekh · November 7, 2026
Share

When building productivity tools that involve professional growth, developers face a distinct paradox: users need to share their data to receive feedback, but the data they are sharing is often highly sensitive. In the context of our upcoming interview preparation app, Employ Ready, a user might want to show a mentor their interview performance scores and competency growth without revealing their current salary, the specific high-profile company they are interviewing with, or the name of their current manager. Implementing a binary 'public' or 'private' profile is insufficient for these nuanced professional relationships. Instead, we must design for granular privacy—specifically field-level masking that allows the user to toggle visibility on a per-attribute basis before generating a shared view or report.

The Challenge of Selective Disclosure

Traditional privacy models usually operate at the document or record level. If you share a document, the recipient sees the document. However, career data is multi-faceted. A single 'Interview Prep' session record contains public-ready data (time spent, categories covered), semi-private data (feedback notes), and highly sensitive data (compensation figures, internal project names mentioned in STAR method answers).

If we force users to share everything or nothing, they will often choose nothing, which limits the utility of the app for coaching and mentorship. The goal of granular privacy is to decouple the data ownership from the data presentation. By implementing a 'Privacy Mode' or 'Masked View,' we empower the user to remain in control of their professional narrative. This is similar to the technical considerations we faced when Implementing Local-Only Data, where the primary objective was ensuring user sovereignty over sensitive information.

Architectural Approach: The ViewModel Projection

To implement field-level masking effectively in an Android environment, you should avoid logic that hides UI elements manually in every fragment or activity. This is brittle and prone to 'leaks' where a developer forgets to hide a field in a new UI update. Instead, use a projection-based approach at the ViewModel or Repository layer.

In this model, your domain object (e.g., InterviewRecord) contains all data. You then define a MaskingProfile—a simple data class or bitmask that tracks which fields the user has marked as 'Private'. When the UI requests data for a 'Public Share' view, the Repository returns a 'Masked' version of the object where sensitive strings are replaced with placeholders (like '••••' or '[Redacted]') and numeric values are nulled out.

Data TypeMasking StrategyUser Experience
Salary/NumbersNulling or Range-RoundingShows a range (e.g., $80k-$100k) instead of the exact figure.
Employer NamesAlias GenerationReplaces 'Google' with 'Large Tech Corp' or 'Company A'.
Free TextRegex ScrubbingScans for keywords like email addresses or phone numbers to redact.
TimestampsGranularity ReductionChanges 'Oct 12, 2:45 PM' to 'October' to prevent schedule tracking.

Implementing the Masking Logic

When we look at the internal logic for an app like Employ Ready, the masking needs to be reactive. If a user is looking at their dashboard and toggles 'Privacy Mode', the UI should reflect that change instantly. Using Jetpack Compose makes this relatively straightforward by tying the masking state to the UI state.

```kotlin data class ProfessionalProfile( val name: String, val currentEmployer: String, val currentSalary: Double, val notes: String )

data class MaskingPreferences( val maskEmployer: Boolean = false, val maskSalary: Boolean = false )

fun ProfessionalProfile.toMaskedView(prefs: MaskingPreferences): ProfessionalProfile { return this.copy( currentEmployer = if (prefs.maskEmployer) "[Employer Masked]" else this.currentEmployer, currentSalary = if (prefs.maskSalary) 0.0 else this.currentSalary ) } ```

By ensuring the toMaskedView function is the only way data reaches the 'Share' UI, you create a central point of failure that is easy to test. You can write unit tests to verify that if maskSalary is true, the resulting string or double is never the original value.

There are two primary ways a user shares data in a productivity app: by showing someone their physical screen or by sending a digital export/link.

  1. 1.Live Screen Masking: This is a UI-level overlay. It is useful for when a user is in a coffee shop or recording a screen demo. The data remains in the device memory, but the UI renders it as masked. This is the 'Privacy Mode' often found in banking apps.
  2. 2.Export/Link Masking: This is much more critical. If the user generates a PDF or a web-share link to show their interview progress to a coach, the masked data must never leave the device. You should not send the full data to a server and ask the server to hide it; the masking should happen locally before the data is serialized for export.

This mirrors the design philosophy we used in ShariahSignal, where financial data must be processed accurately and presented clearly without overwhelming the user. In that case, we filtered stocks based on complex criteria; here, we filter data based on user-defined privacy boundaries.

Granular Toggles: A Checklist for Implementation

When designing the settings screen for these privacy controls, avoid a single 'Private' checkbox. Instead, provide a list of data categories. This gives the user the confidence that they can be transparent about their skills while remaining opaque about their current contract terms.

  • Identity: Name, photo, and social links.
  • Current Employment: Company name, job title, and tenure.
  • Financials: Current salary, target salary, and bonus structures.
  • Narrative Details: STAR method examples, specific project names, and stakeholder names mentioned in practice answers.
  • Metrology: How long they practiced, how many rounds they completed, and their overall 'Ready' score.

Handling the 'Mentorship' Use Case

In Employ Ready, we recognize that a mentor doesn't need to know you are interviewing at 'Apple' to tell you that your answer to 'Tell me about a time you failed' needs more work. By masking the company name to 'Fortune 500 Tech', the mentor gets the context (the scale of the company) without the specific identifying details.

Technically, this requires a 'Categorical Mask'. Instead of just replacing a string with asterisks, you map specific inputs to broader categories. This is more complex to implement because it requires a lookup table or an AI-based categorization, but it adds significantly more value to the shared report than a simple redaction.

Ensuring Non-Reversibility

One common engineering mistake in masking is providing the data in a way that can be reversed by the recipient. If you are generating a web view for a mentor, do not send the full JSON object and hide the fields with CSS (display: none). Anyone with 'Inspect Element' tools can see the sensitive data.

Always ensure that the data transformation happens at the source. If a field is masked, the underlying data package sent to the browser or the PDF generator should physically contain the string "[REDACTED]" or a null value. There should be no path for the recipient to 'unmask' the data, as they never possessed the original keys.

User Experience and Trust

Finally, the UI must clearly communicate what is being shared. A 'Preview' feature is essential. Before a user hits 'Send' or 'Generate Link', show them exactly what the recipient will see. In our experience building Salah Companion, we learned that clarity in how data is tracked and displayed is the foundation of user trust. If a user feels that an app is 'leaky' with their professional secrets, they will stop using it for their most important preparations.

Include a 'Privacy Health Check' in your app. This is a simple screen that summarizes: "You are currently sharing 5 metrics with your mentor. Salary and Employer names are currently HIDDEN." This high-level summary provides peace of mind that granular settings haven't been forgotten.

What to do next

  1. 1.Audit your data model: Identify every field in your app that could be considered sensitive (Salary, Company, Project Names) and group them into 'Privacy Buckets'.
  2. 2.Implement a Projection Layer: Create a function in your Repository or UseCase that takes a MaskingPreference object and returns a sanitized version of your data model.
  3. 3.Add a 'Share Preview' screen: Before any data export happens, show the user a read-only view of the sanitized data so they can verify that their sensitive details are correctly masked.
#engineering#privacy#android-development#data-security

One email per launch. No spam, unsubscribe any time.