Skip to content

Adressing the "view password" feature implementation- Issue #577#612

Merged
ochedru merged 9 commits into
dhatim:masterfrom
ArisOIKON:master
Jun 8, 2026
Merged

Adressing the "view password" feature implementation- Issue #577#612
ochedru merged 9 commits into
dhatim:masterfrom
ArisOIKON:master

Conversation

@ArisOIKON

Copy link
Copy Markdown
Contributor

Summary

Added protectWithViewPassword(String password) to Worksheet,
allowing users to hide a sheet and lock the workbook structure
with a password so unauthorized users cannot unhide it.

How it works

  • Worksheet.protectWithViewPassword(password) hides the sheet
    by setting its visibility state to HIDDEN and calls
    Workbook.protectStructure(password) to lock the workbook structure.

  • Workbook.protectStructure(password) hashes the password and writes
    <workbookProtection workbookPassword="..." lockStructure="1"/>
    to workbook.xml.

Usage

java Worksheet ws = wb.newWorksheet("SecretSheet"); ws.value(0, 0, "Sensitive Data"); ws.protectWithViewPassword("myPassword");

Testing

  • WorkbookProtectionTest: verifies workbook structure locking
  • ViewPasswordE2ETest: verifies full round-trip: sheet
    visibility, data preservation and combined view/edit protection
  • All test failures shown in the PR CI pipeline are pre-existing

As is the case with the pre-existing password, this is not full file encryption.
It uses Excel's built-in sheet hiding and workbook structure protection, which is meant to
discourage casual access rather than provide strong security.

@ArisOIKON ArisOIKON changed the title Adressing the "view password" feature implementation Adressing the "view password" feature implementation- Issue #577 May 27, 2026
@coveralls

coveralls commented Jun 1, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 88.791% (+0.07%) from 88.719% — ArisOIKON:master into dhatim:master

@ochedru

ochedru commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! Could you add a note to the README about this new feature? Thanks!

@ochedru ochedru merged commit 68b4f4a into dhatim:master Jun 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants