Skip to content

Encrypt and password protect sensitive CSV and XLSX files

License

Notifications You must be signed in to change notification settings

verystar/secure-spreadsheet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Secure Spreadsheet

🔥 Secure your data exports - encrypt and password protect sensitive CSV and XLSX files

The Office Open XML format provides a standard for encryption and password protection

Works with Excel, Numbers, and LibreOffice Calc

Getting Started

Install the CLI

npm install -g secure-spreadsheet

Convert a CSV into password-protected, AES-256 encrypted XLSX

cat input.csv | secure-spreadsheet --password secret > output.xlsx

Protect an existing XLSX

cat input.xlsx | secure-spreadsheet --password secret --input-format xlsx > output.xlsx

Languages

Many languages don’t have libraries to create encrypted spreadsheets. Luckily, we can use the CLI.

Ruby

require "csv"

csv_str = CSV.generate do |csv|
  csv << ["awesome", "csv"]
end

result = IO.popen("secure-spreadsheet --password secret", "r+") do |io|
  io.write(csv_str)
  io.close_write
  io.read
end

File.open("output.xlsx", "w") { |f| f.write(result) }

Other Approaches

An alternative approach to secure your data is to create a password-protected ZIP archive. However, this leaves the data exposed after it’s unzipped.

Notes

The content type for XLSX is application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.

Credits

Thanks to xlsx-populate for providing the encryption and password protection.

History

View the changelog

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

About

Encrypt and password protect sensitive CSV and XLSX files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%