Skip to content

nronzel/docxfree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

$$$$$$$\                                 $$$$$$\
$$  __$$\                               $$  __$$\
$$ |  $$ | $$$$$$\   $$$$$$$\ $$\   $$\ $$ /  \__|$$$$$$\   $$$$$$\   $$$$$$\
$$ |  $$ |$$  __$$\ $$  _____|\$$\ $$  |$$$$\    $$  __$$\ $$  __$$\ $$  __$$\
$$ |  $$ |$$ /  $$ |$$ /       \$$$$  / $$  _|   $$ |  \__|$$$$$$$$ |$$$$$$$$ |
$$ |  $$ |$$ |  $$ |$$ |       $$  $$<  $$ |     $$ |      $$   ____|$$   ____|
$$$$$$$  |\$$$$$$  |\$$$$$$$\ $$  /\$$\ $$ |     $$ |      \$$$$$$$\ \$$$$$$$\
\_______/  \______/  \_______|\__/  \__|\__|     \__|       \_______| \_______|

Overview

Removes password protection from .docx files.

Forgot the password to your .docx file? Docxfree will create a copy of the original file with the password protection removed, append unlocked- to the beginning of the filename, and saves them into a docxfreed/ directory. A copy is created to avoid potential corruption of the original file.

Warning

Only works on .docx files. (Office 2007 or newer) Will NOT work with .doc files.

Features

  • Easy to use CLI
  • Single file operation
  • Batch operations on a specified directory
  • Optional depth argument to process nested directories

Installation

Manual Installation

Clone the repo:

git clone https://github.com/nronzel/docxfree.git

cd docxfree

Build the program:

go build

Release

Download the correct binary from the latest release.

Usage

You can specify a single filename, or a path to a directory.

If you specify a path, you can also specify an optional depth argument if there are sub-directories that contain .docx files that you need processed. The default depth (1) means it will only process the specified directory and no sub-directories. Use a depth of 2 or higher to include nested directories.

Arguments

Arg Description
-f (file) Specify a single .docx file.
-p (path) Specify a directory of .docx files.
-d (depth) *Optional - Recursion depth. Default: 1

Help Message

Arguments:
	-f: Specify a single filename.
	-p: Specify a path to a directory of files.
	-d: *Optional - Depth of recursion when specifying a path. Default: 1 (specified dir only)

Usage:
	> Single File:
	docxfree -f [filename]

	> Batch Operations:
	docxfree -p [path/to/files]
	docxfree -p [path/to/files] -d [recursion-depth]

Examples:
	docxfree -f document.docx
	docxfree -p protected_docs/
	docxfree -p /path/to/files -d 3

How It Works

Office 2007 and newer .docx files are actually just a zip archive with multiple XML files. When you apply password protection to the document, a <w:documentProtection> node is added to the settings.xml file in the archive.

This utility creates a copy of all of the XML files in the .docx archive, and creates a modified copy of the settings.xml file with the protection node removed.

Older Office files (.doc) are a single binary file and not an XML archive, so this method of removing password protection will not work.